@@ -175,8 +175,17 @@ endef
# the next time the download is tried.
define DOWNLOAD_WGET
test -e $(DL_DIR)/$(2) || \
- ($(WGET) -O $(DL_DIR)/$(2).tmp '$(call qstrip,$(1))' && \
- mv $(DL_DIR)/$(2).tmp $(DL_DIR)/$(2)) || \
+ (($(WGET) -O $(DL_DIR)/$(2).tmp '$(call qstrip,$(1))' ; \
+ case "$(2)" in \
+ *.bz2|*.gz|*.tbz|*.tbz2|*.tgz|*.xz|*.tar) \
+ file $(DL_DIR)/$(2).tmp | grep -q 'HTML\ document' && \
+ (rm -f $(DL_DIR)/$(2).tmp ; \
+ echo "error: Cannot retrieve $(2) from '$(call qstrip,$(1))'." ; \
+ echo "error: Wrong package URL: $(call qstrip,$(1))") || \
+ exit 0 ;; \
+ *) exit 0 ;; \
+ esac) && \
+ mv $(DL_DIR)/$(2).tmp $(DL_DIR)/$(2)) || \
(rm -f $(DL_DIR)/$(2).tmp ; exit 1)
endef
@@ -131,7 +131,7 @@ if ! $SHELL --version 2>&1 | grep -q '^GNU bash'; then
fi;
# Check that a few mandatory programs are installed
-for prog in awk bison flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio python unzip rsync ${DL_TOOLS} ; do
+for prog in awk bison file flex msgfmt makeinfo patch gzip bzip2 perl tar wget cpio python unzip rsync ${DL_TOOLS} ; do
if ! which $prog > /dev/null ; then
/bin/echo -e "\nYou must install '$prog' on your build machine";
if test $prog = "makeinfo" ; then
In case of wrong package source url, the retrieved file is a html page; this lead to a build failure at the extraction time. So, in case of tarballs, check the file type of the downloaded material and remove the temporary file if it is wrong. As a side effect of this, if the source location has changed since the package integration in Buildroot, the download will fall back on the Buildroot backup site. Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- package/pkg-download.mk | 13 +++++++++++-- support/dependencies/dependencies.sh | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-)