summaryrefslogtreecommitdiff
path: root/core
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
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')
-rw-r--r--core/mk/pkg-macros/download.mk34
-rw-r--r--core/mk/pkg-macros/vars.mk5
2 files changed, 15 insertions, 24 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
diff --git a/core/mk/pkg-macros/vars.mk b/core/mk/pkg-macros/vars.mk
index 3fdd108..9cb3506 100644
--- a/core/mk/pkg-macros/vars.mk
+++ b/core/mk/pkg-macros/vars.mk
@@ -58,10 +58,13 @@ __embtk_patch_site = $(embtk_ftp)
__embtk_patch_url = $(__embtk_patch_site)/$(__embtk_pkg_name)/$(__embtk_pkg_version)
__embtk_pkg_patch_site = $(strip $(or $($(PKGV)_PATCH_SITE),$(__embtk_patch_url)))
__embtk_pkg_patch_f = $(strip $(embtk_dldir))/$(__embtk_pkg_name)-$(__embtk_pkg_version).patch
-__embtk_pkg_mirror = $(embtk_ftp/packages-mirror)
+
+___embtk_pkg_mirror = $(call embtk_uquote,$(CONFIG_EMBTK_$(PKGV)_MIRRORS)) $($(PKGV)_MIRRORS)
+__embtk_pkg_mirror = $(___embtk_pkg_mirror) $(embtk_ftp/packages-mirror)
__embtk_pkg_mirror1 = $(strip $($(PKGV)_MIRROR1))
__embtk_pkg_mirror2 = $(strip $($(PKGV)_MIRROR2))
__embtk_pkg_mirror3 = $(strip $($(PKGV)_MIRROR3))
+__embtk_pkg_mirrors = $(strip $(__embtk_pkg_mirror1) $(__embtk_pkg_mirror2) $(__embtk_pkg_mirror3) $(__embtk_pkg_mirror))
__embtk_pkg_package = $(strip $($(PKGV)_PACKAGE))
__embtk_pkg_package_remote = $(or $(strip $($(PKGV)_PACKAGE_REMOTE)),$(__embtk_pkg_package))
__embtk_pkg_tarball_fmt = $(or $(__embtk_pkg_tarball_targz),\