summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-12-04 03:08:04 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-12-05 08:39:36 (GMT)
commit894608bf4dae46d6b140037df5a75f68bdf81fc0 (patch)
treee46f0d32c0b3aeb62ab1bd3db123441879c37db7 /Makefile
parenteeed35b5f1efd709b00ce416ff782a5a8cc90399 (diff)
downloadmxe-894608bf4dae46d6b140037df5a75f68bdf81fc0.zip
mxe-894608bf4dae46d6b140037df5a75f68bdf81fc0.tar.gz
mxe-894608bf4dae46d6b140037df5a75f68bdf81fc0.tar.bz2
pkg download: do not append to previous attempt
Slow HTTP server with lag for tests: https://gist.github.com/45472174f8bd97989c1eb9bc64d50468 Fix https://github.com/mxe/mxe/issues/1552
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 8 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 793ccf7..7cc18c9 100644
--- a/Makefile
+++ b/Makefile
@@ -230,29 +230,30 @@ ESCAPE_PKG = \
BACKUP_DOWNLOAD = \
(echo "MXE Warning! Downloading $(1) from backup." >&2 && \
- ($(WGET) -O- $(PKG_MIRROR)/`$(call ESCAPE_PKG,$(1))` || \
- $(WGET) -O- $(PKG_CDN)/`$(call ESCAPE_PKG,$(1))`))
+ ($(WGET) -O '$(PKG_DIR)/.tmp-$($(1)_FILE)' $(PKG_MIRROR)/`$(call ESCAPE_PKG,$(1))` || \
+ $(WGET) -O '$(PKG_DIR)/.tmp-$($(1)_FILE)' $(PKG_CDN)/`$(call ESCAPE_PKG,$(1))`))
DOWNLOAD_PKG_ARCHIVE = \
$(if $($(1)_SOURCE_TREE),\
true\
$(else),\
mkdir -p '$(PKG_DIR)' && ( \
- $(WGET) -T 30 -t 3 -O- '$($(1)_URL)' \
+ $(WGET) -T 30 -t 3 -O '$(PKG_DIR)/.tmp-$($(1)_FILE)' '$($(1)_URL)' \
$(if $($(1)_URL_2), \
|| (echo "MXE Warning! Downloading $(1) from second URL." >&2 && \
- $(WGET) -T 30 -t 3 -O- '$($(1)_URL_2)')) \
+ $(WGET) -T 30 -t 3 -O '$(PKG_DIR)/.tmp-$($(1)_FILE)' '$($(1)_URL_2)')) \
$(if $(MXE_NO_BACKUP_DL),, \
|| $(BACKUP_DOWNLOAD)) \
- ) \
+ ) && cat '$(PKG_DIR)/.tmp-$($(1)_FILE)' \
$(if $($(1)_FIX_GZIP), \
| gzip -d | gzip -9n, \
) \
- > '$(PKG_DIR)/$($(1)_FILE)' || \
+ > '$(PKG_DIR)/$($(1)_FILE)' && \
+ rm '$(PKG_DIR)/.tmp-$($(1)_FILE)' || \
( echo; \
echo 'Download failed!'; \
echo; \
- rm -f '$(PKG_DIR)/$($(1)_FILE)'; )\
+ rm -f '$(PKG_DIR)/$($(1)_FILE)' '$(PKG_DIR)/.tmp-$($(1)_FILE)'; )\
)
# open issue from 2002: