summaryrefslogtreecommitdiff
path: root/core/mk/pkg-macros/download.mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2015-03-22 20:51:52 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2015-03-22 20:51:52 +0100
commit899229dfdfdb5314442b98dc0f861d074678d297 (patch)
tree0665b47b62e352d27989d21eb625405d683b1f7e /core/mk/pkg-macros/download.mk
parent4fcb055713dbd6af30f642c43f558083b3a04fe0 (diff)
downloadembtoolkit-899229dfdfdb5314442b98dc0f861d074678d297.tar.gz
embtoolkit-899229dfdfdb5314442b98dc0f861d074678d297.tar.bz2
embtoolkit-899229dfdfdb5314442b98dc0f861d074678d297.tar.xz
Build system: improve ability to download packages from mirrors
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'core/mk/pkg-macros/download.mk')
-rw-r--r--core/mk/pkg-macros/download.mk34
1 files changed, 11 insertions, 23 deletions
diff --git a/core/mk/pkg-macros/download.mk b/core/mk/pkg-macros/download.mk
index ee4f657..0e77821 100644
--- a/core/mk/pkg-macros/download.mk
+++ b/core/mk/pkg-macros/download.mk
@@ -116,33 +116,21 @@ define __embtk_download_pkg_from_tarball
$(call embtk_echo_blue,"\tCategory : $(__embtk_$(pkgv)_category)"))
$(call embtk_echo_blue,"\tDependency of : $(or $(__embtk_pkg_depof),N/A)")
test -e $(__embtk_pkg_package_f) || \
- $(call embtk_wget, \
- $(__embtk_pkg_package), \
- $(__embtk_pkg_site), \
- $(__embtk_pkg_package_remote)) || \
- $(if $(__embtk_pkg_mirror1), \
- $(call embtk_wget, \
- $(__embtk_pkg_package), \
- $(__embtk_pkg_mirror1), \
- $(__embtk_pkg_package_remote)) ||) \
- $(if $(__embtk_pkg_mirror2), \
- $(call embtk_wget, \
- $(__embtk_pkg_package), \
- $(__embtk_pkg_mirror2), \
- $(__embtk_pkg_package_remote)) ||) \
- $(if $(__embtk_pkg_mirror3), \
- $(call embtk_wget, \
- $(__embtk_pkg_package), \
- $(__embtk_pkg_mirror3), \
- $(__embtk_pkg_package_remote)) ||) \
- $(call embtk_wget, \
- $(__embtk_pkg_package), \
- $(__embtk_pkg_mirror), \
- $(__embtk_pkg_package)) || \
+ $(foreach m,$(__embtk_pkg_site) $(__embtk_pkg_mirrors), \
+ $(call __embtk_download_pkg_tarball,$(1),$(m)) ||) \
$(call __embtk_download_pkg_exitfailure,$(__embtk_pkg_package_f))
$(call __embtk_download_pkg_patches,$(1)) || \
$(call __embtk_download_pkg_exitfailure,$(__embtk_pkg_patch_f))
endef
+#
+# Download package tarball from a given site and check its hash if specified
+# $(1): package name
+# $(2): site
+#
+define __embtk_download_pkg_tarball
+ $(call embtk_wget, \
+ $(__embtk_pkg_package),$(2),$(__embtk_pkg_package_remote))
+endef
__embtk_pkgdl_src = $(or $(__embtk_pkg_usegit),$(__embtk_pkg_usesvn),tarball)
define embtk_download_pkg