2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-04-17 16:45:20 +02:00
|
|
|
#
|
|
|
|
# This file contains the download helpers for the various package
|
|
|
|
# infrastructures. It is used to handle downloads from HTTP servers,
|
|
|
|
# FTP servers, Git repositories, Subversion repositories, Mercurial
|
|
|
|
# repositories, Bazaar repositories, and SCP servers.
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-04-17 16:45:20 +02:00
|
|
|
|
2012-04-17 16:45:19 +02:00
|
|
|
# Download method commands
|
2015-01-02 16:53:41 +01:00
|
|
|
export WGET := $(call qstrip,$(BR2_WGET))
|
2014-07-02 23:11:20 +02:00
|
|
|
export SVN := $(call qstrip,$(BR2_SVN))
|
2014-07-02 23:11:21 +02:00
|
|
|
export CVS := $(call qstrip,$(BR2_CVS))
|
2014-07-02 23:11:24 +02:00
|
|
|
export BZR := $(call qstrip,$(BR2_BZR))
|
2014-07-02 23:11:19 +02:00
|
|
|
export GIT := $(call qstrip,$(BR2_GIT))
|
2015-01-02 16:53:41 +01:00
|
|
|
export HG := $(call qstrip,$(BR2_HG))
|
|
|
|
export SCP := $(call qstrip,$(BR2_SCP))
|
|
|
|
SSH := $(call qstrip,$(BR2_SSH))
|
2014-07-02 23:11:26 +02:00
|
|
|
export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
|
2012-04-17 16:45:19 +02:00
|
|
|
|
2014-12-11 23:52:05 +01:00
|
|
|
DL_WRAPPER = support/download/dl-wrapper
|
|
|
|
|
2014-02-04 16:18:51 +01:00
|
|
|
# DL_DIR may have been set already from the environment
|
2014-02-10 22:48:55 +01:00
|
|
|
ifeq ($(origin DL_DIR),undefined)
|
2014-02-04 16:18:51 +01:00
|
|
|
DL_DIR ?= $(call qstrip,$(BR2_DL_DIR))
|
2012-04-17 16:45:19 +02:00
|
|
|
ifeq ($(DL_DIR),)
|
2013-07-20 08:52:43 +02:00
|
|
|
DL_DIR := $(TOPDIR)/dl
|
2012-04-17 16:45:19 +02:00
|
|
|
endif
|
2014-02-10 22:48:55 +01:00
|
|
|
else
|
|
|
|
# Restore the BR2_DL_DIR that was overridden by the .config file
|
|
|
|
BR2_DL_DIR = $(DL_DIR)
|
|
|
|
endif
|
2012-04-17 16:45:19 +02:00
|
|
|
|
2012-09-10 12:38:29 +02:00
|
|
|
# ensure it exists and a absolute path
|
2013-07-20 08:52:43 +02:00
|
|
|
DL_DIR := $(shell mkdir -p $(DL_DIR) && cd $(DL_DIR) >/dev/null && pwd)
|
2012-09-10 12:38:29 +02:00
|
|
|
|
2012-04-17 16:45:19 +02:00
|
|
|
#
|
|
|
|
# URI scheme helper functions
|
|
|
|
# Example URIs:
|
|
|
|
# * http://www.example.com/dir/file
|
|
|
|
# * scp://www.example.com:dir/file (with domainseparator :)
|
|
|
|
#
|
|
|
|
# geturischeme: http
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
geturischeme = $(firstword $(subst ://, ,$(call qstrip,$(1))))
|
2012-04-17 16:45:19 +02:00
|
|
|
# stripurischeme: www.example.com/dir/file
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
stripurischeme = $(lastword $(subst ://, ,$(call qstrip,$(1))))
|
2012-04-17 16:45:19 +02:00
|
|
|
# domain: www.example.com
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
domain = $(firstword $(subst $(call domainseparator,$(2)), ,$(call stripurischeme,$(1))))
|
2012-04-17 16:45:19 +02:00
|
|
|
# notdomain: dir/file
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
notdomain = $(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(call stripurischeme,$(1)))
|
2012-04-17 16:45:19 +02:00
|
|
|
#
|
|
|
|
# default domainseparator is /, specify alternative value as first argument
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
domainseparator = $(if $(1),$(1),/)
|
2012-04-17 16:45:19 +02:00
|
|
|
|
2014-06-02 17:55:59 +02:00
|
|
|
# github(user,package,version): returns site of GitHub repository
|
2014-03-09 19:54:35 +01:00
|
|
|
github = https://github.com/$(1)/$(2)/archive/$(3)
|
2013-12-05 18:20:44 +01:00
|
|
|
|
support/download: add possibility to not fail on missing hash
In very constrained cases, it might be needed to not fail if a hash is
missing. This is notably the case for custom external toolchains to be
downloaded, because we do have a .hash file for external toolchains,
but we obviously can not have hashes for all existing custom toolchains
(he, "custom"!).
So, add a way to avoid failing in that case.
>From the Makefile, we export the list of files for which not to check
the hash. Then, from the check-hash script, if no check was done, and
the file we were trying to match in in this exclusion list, we just exit
without error.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
changes v6 -> v7:
- /beautify/ the pattern in the case clause
Changed v5 -> v6: (Arnout)
- fix the pattern in the case clause
Changes v4 -> v5:
- micro-optimisation, use case-esac instead of a for-loop (Arnout)
- typoes (Arnout)
Changes v3 -> v4:
- drop the magic value, use a list of excluded files (Arnout)
Changes v1 -> v2:
- fix typoes in commit log
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-23 00:08:38 +02:00
|
|
|
# Expressly do not check hashes for those files
|
2015-05-02 11:05:00 +02:00
|
|
|
# Exported variables default to immediately expanded in some versions of
|
|
|
|
# make, but we need it to be recursively-epxanded, so explicitly assign it.
|
|
|
|
export BR_NO_CHECK_HASH_FOR =
|
support/download: add possibility to not fail on missing hash
In very constrained cases, it might be needed to not fail if a hash is
missing. This is notably the case for custom external toolchains to be
downloaded, because we do have a .hash file for external toolchains,
but we obviously can not have hashes for all existing custom toolchains
(he, "custom"!).
So, add a way to avoid failing in that case.
>From the Makefile, we export the list of files for which not to check
the hash. Then, from the check-hash script, if no check was done, and
the file we were trying to match in in this exclusion list, we just exit
without error.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
changes v6 -> v7:
- /beautify/ the pattern in the case clause
Changed v5 -> v6: (Arnout)
- fix the pattern in the case clause
Changes v4 -> v5:
- micro-optimisation, use case-esac instead of a for-loop (Arnout)
- typoes (Arnout)
Changes v3 -> v4:
- drop the magic value, use a list of excluded files (Arnout)
Changes v1 -> v2:
- fix typoes in commit log
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-23 00:08:38 +02:00
|
|
|
|
2012-04-17 16:45:19 +02:00
|
|
|
################################################################################
|
2013-09-11 14:12:04 +02:00
|
|
|
# The DOWNLOAD_* helpers are in charge of getting a working copy
|
|
|
|
# of the source repository for their corresponding SCM,
|
2012-04-17 16:45:19 +02:00
|
|
|
# checking out the requested version / commit / tag, and create an
|
|
|
|
# archive out of it. DOWNLOAD_SCP uses scp to obtain a remote file with
|
|
|
|
# ssh authentication. DOWNLOAD_WGET is the normal wget-based download
|
|
|
|
# mechanism.
|
|
|
|
#
|
2013-09-11 14:12:04 +02:00
|
|
|
# The SOURCE_CHECK_* helpers are in charge of simply checking that the source
|
|
|
|
# is available for download. This can be used to make sure one will be able
|
|
|
|
# to get all the sources needed for one's build configuration.
|
2012-04-17 16:45:19 +02:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
define DOWNLOAD_GIT
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b git \
|
|
|
|
-o $(DL_DIR)/$($(PKG)_SOURCE) \
|
2016-07-01 11:01:19 +02:00
|
|
|
$(if $($(PKG)_GIT_SUBMODULES),-r) \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2014-08-03 19:53:38 +02:00
|
|
|
$($(PKG)_SITE) \
|
|
|
|
$($(PKG)_DL_VERSION) \
|
pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.
This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.
This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
This does not include standard github downloads, which download a pre-made
archive.
- there should be a hash file containing the hash of the downloaded archive.
Since normally there is no hash file for packages with sources coming from
a version control system, this restricts even further. Some examples of
packages in this category that do have a hash file (but not necessarily
match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
and thus be downloaded later using a non-version-controlled method, like
wget or scp. This is because the version control download methods do not
receive a '-H' parameter pointing to the hash file and thus no hashes are
checked at all even if the file is present.
While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.
Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'. Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.
Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
-e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y' .config
$ make host-squashfs-dirclean host-squashfs-source
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-17 15:08:07 +02:00
|
|
|
$($(PKG)_RAW_BASE_NAME) \
|
2016-08-23 14:19:45 +02:00
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# TODO: improve to check that the given PKG_DL_VERSION exists on the remote
|
|
|
|
# repository
|
|
|
|
define SOURCE_CHECK_GIT
|
2015-04-26 11:51:10 +02:00
|
|
|
$(GIT) ls-remote --heads $($(PKG)_SITE) > /dev/null
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define DOWNLOAD_BZR
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
|
|
|
|
-o $(DL_DIR)/$($(PKG)_SOURCE) \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2014-08-03 19:53:35 +02:00
|
|
|
$($(PKG)_SITE) \
|
|
|
|
$($(PKG)_DL_VERSION) \
|
pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.
This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.
This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
This does not include standard github downloads, which download a pre-made
archive.
- there should be a hash file containing the hash of the downloaded archive.
Since normally there is no hash file for packages with sources coming from
a version control system, this restricts even further. Some examples of
packages in this category that do have a hash file (but not necessarily
match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
and thus be downloaded later using a non-version-controlled method, like
wget or scp. This is because the version control download methods do not
receive a '-H' parameter pointing to the hash file and thus no hashes are
checked at all even if the file is present.
While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.
Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'. Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.
Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
-e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y' .config
$ make host-squashfs-dirclean host-squashfs-source
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-17 15:08:07 +02:00
|
|
|
$($(PKG)_RAW_BASE_NAME) \
|
2016-08-23 14:19:45 +02:00
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK_BZR
|
|
|
|
$(BZR) ls --quiet $($(PKG)_SITE) > /dev/null
|
|
|
|
endef
|
|
|
|
|
2013-09-11 14:12:04 +02:00
|
|
|
define DOWNLOAD_CVS
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
|
|
|
|
-o $(DL_DIR)/$($(PKG)_SOURCE) \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2014-08-03 19:53:37 +02:00
|
|
|
$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
|
|
|
|
$($(PKG)_DL_VERSION) \
|
|
|
|
$($(PKG)_RAWNAME) \
|
pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.
This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.
This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
This does not include standard github downloads, which download a pre-made
archive.
- there should be a hash file containing the hash of the downloaded archive.
Since normally there is no hash file for packages with sources coming from
a version control system, this restricts even further. Some examples of
packages in this category that do have a hash file (but not necessarily
match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
and thus be downloaded later using a non-version-controlled method, like
wget or scp. This is because the version control download methods do not
receive a '-H' parameter pointing to the hash file and thus no hashes are
checked at all even if the file is present.
While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.
Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'. Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.
Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
-e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y' .config
$ make host-squashfs-dirclean host-squashfs-source
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-17 15:08:07 +02:00
|
|
|
$($(PKG)_RAW_BASE_NAME) \
|
2016-08-23 14:19:45 +02:00
|
|
|
$($(PKG)_DL_OPTS)
|
2013-09-11 14:12:04 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# Not all CVS servers support ls/rls, use login to see if we can connect
|
|
|
|
define SOURCE_CHECK_CVS
|
|
|
|
$(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login
|
|
|
|
endef
|
|
|
|
|
2012-04-17 16:45:19 +02:00
|
|
|
define DOWNLOAD_SVN
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b svn \
|
|
|
|
-o $(DL_DIR)/$($(PKG)_SOURCE) \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2014-08-03 19:53:41 +02:00
|
|
|
$($(PKG)_SITE) \
|
|
|
|
$($(PKG)_DL_VERSION) \
|
pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.
This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.
This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
This does not include standard github downloads, which download a pre-made
archive.
- there should be a hash file containing the hash of the downloaded archive.
Since normally there is no hash file for packages with sources coming from
a version control system, this restricts even further. Some examples of
packages in this category that do have a hash file (but not necessarily
match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
and thus be downloaded later using a non-version-controlled method, like
wget or scp. This is because the version control download methods do not
receive a '-H' parameter pointing to the hash file and thus no hashes are
checked at all even if the file is present.
While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.
Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'. Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.
Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
-e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y' .config
$ make host-squashfs-dirclean host-squashfs-source
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-17 15:08:07 +02:00
|
|
|
$($(PKG)_RAW_BASE_NAME) \
|
2016-08-23 14:19:45 +02:00
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK_SVN
|
2015-04-26 11:51:10 +02:00
|
|
|
$(SVN) ls $($(PKG)_SITE)@$($(PKG)_DL_VERSION) > /dev/null
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# SCP URIs should be of the form scp://[user@]host:filepath
|
|
|
|
# Note that filepath is relative to the user's home directory, so you may want
|
|
|
|
# to prepend the path with a slash: scp://[user@]host:/absolutepath
|
|
|
|
define DOWNLOAD_SCP
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b scp \
|
|
|
|
-o $(DL_DIR)/$(2) \
|
2014-12-11 23:52:07 +01:00
|
|
|
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2016-08-23 14:19:45 +02:00
|
|
|
'$(call stripurischeme,$(call qstrip,$(1)))' \
|
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK_SCP
|
|
|
|
$(SSH) $(call domain,$(1),:) ls '$(call notdomain,$(1),:)' > /dev/null
|
|
|
|
endef
|
|
|
|
|
|
|
|
define DOWNLOAD_HG
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b hg \
|
|
|
|
-o $(DL_DIR)/$($(PKG)_SOURCE) \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2014-08-03 19:53:39 +02:00
|
|
|
$($(PKG)_SITE) \
|
|
|
|
$($(PKG)_DL_VERSION) \
|
pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.
This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.
This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
This does not include standard github downloads, which download a pre-made
archive.
- there should be a hash file containing the hash of the downloaded archive.
Since normally there is no hash file for packages with sources coming from
a version control system, this restricts even further. Some examples of
packages in this category that do have a hash file (but not necessarily
match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
and thus be downloaded later using a non-version-controlled method, like
wget or scp. This is because the version control download methods do not
receive a '-H' parameter pointing to the hash file and thus no hashes are
checked at all even if the file is present.
While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.
Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'. Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.
Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
-e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y' .config
$ make host-squashfs-dirclean host-squashfs-source
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-17 15:08:07 +02:00
|
|
|
$($(PKG)_RAW_BASE_NAME) \
|
2016-08-23 14:19:45 +02:00
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# TODO: improve to check that the given PKG_DL_VERSION exists on the remote
|
|
|
|
# repository
|
|
|
|
define SOURCE_CHECK_HG
|
2015-04-26 11:51:10 +02:00
|
|
|
$(HG) incoming --force -l1 $($(PKG)_SITE) > /dev/null
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define DOWNLOAD_WGET
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b wget \
|
|
|
|
-o $(DL_DIR)/$(2) \
|
2014-12-11 23:52:07 +01:00
|
|
|
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2016-08-23 14:19:45 +02:00
|
|
|
'$(call qstrip,$(1))' \
|
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK_WGET
|
2015-04-26 11:51:10 +02:00
|
|
|
$(WGET) --spider '$(call qstrip,$(1))'
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define DOWNLOAD_LOCALFILES
|
2014-12-11 23:52:05 +01:00
|
|
|
$(EXTRA_ENV) $(DL_WRAPPER) -b cp \
|
|
|
|
-o $(DL_DIR)/$(2) \
|
2014-12-11 23:52:07 +01:00
|
|
|
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
|
2015-01-02 16:53:40 +01:00
|
|
|
$(QUIET) \
|
2014-12-11 23:52:05 +01:00
|
|
|
-- \
|
2016-08-23 14:19:45 +02:00
|
|
|
$(call stripurischeme,$(call qstrip,$(1))) \
|
|
|
|
$($(PKG)_DL_OPTS)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK_LOCALFILES
|
2015-04-26 11:51:10 +02:00
|
|
|
test -e $(call stripurischeme,$(call qstrip,$(1)))
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# DOWNLOAD -- Download helper. Will try to download source from:
|
|
|
|
# 1) BR2_PRIMARY_SITE if enabled
|
2012-06-22 07:37:03 +02:00
|
|
|
# 2) Download site, unless BR2_PRIMARY_SITE_ONLY is set
|
|
|
|
# 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set
|
2012-04-17 16:45:19 +02:00
|
|
|
#
|
|
|
|
# Argument 1 is the source location
|
|
|
|
#
|
|
|
|
# E.G. use like this:
|
2014-03-02 18:51:34 +01:00
|
|
|
# $(call DOWNLOAD,$(FOO_SITE))
|
2012-04-17 16:45:19 +02:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
define DOWNLOAD
|
2015-04-26 11:51:09 +02:00
|
|
|
$(call DOWNLOAD_INNER,$(1),$(notdir $(1)),DOWNLOAD)
|
2015-04-26 11:51:04 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define SOURCE_CHECK
|
|
|
|
$(call DOWNLOAD_INNER,$(1),$(notdir $(1)),SOURCE_CHECK)
|
2012-04-17 16:45:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define DOWNLOAD_INNER
|
core/pkg-download: ignore hashes from mirror for VCS downloads
When a download via a VCS method fails, Buildroot attempts the download
from the backup mirror (if any is set). Such a download is done with the
wget helper.
Given a package that has a .hash file for relase tarballs, which also
allows the user to use a random revision from a VCS, the normal download
wrapper will not check for hashes, on the assumption that maybe they are
not reproducible [*] (or user configurable).
However, when the download fails (for any reason: network error,
upstream removed the revision, old machine with incomplete set of CA
certificates...), the backup download now proceeds over with http (or
https) with the wget wrapper. The wget wrapper *always* checks for
hashes, and when a .hash file is present but no hash is found for the
download, this is considered an error.
However, when we download from the backup mirror for a main download that
should have been done with git/hq/svn/.., we in this situation have no hash
for the download. Thus, we should not fail on a missing hash for that
download. Same situation if a primary site is used.
Add a test for the site-method in the DOWNLOAD_INNER macro; if it was either
one of the VCS method, pass a one-off BR_NO_CHECK_HASH_FOR variable set to
contain the tarball to download.
Fixes issues like those reported by the Travis build bots:
https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/123624879
[Peter: Move logic to beginning of DOWNLOAD_INNER so it also applies for BR2_PRIMARY_SITE]
Reported-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-04-18 00:17:12 +02:00
|
|
|
$(Q)$(if $(filter bzr cvs git hg svn,$($(PKG)_SITE_METHOD)),export BR_NO_CHECK_HASH_FOR=$(2);) \
|
|
|
|
if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \
|
2012-04-17 16:45:19 +02:00
|
|
|
case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \
|
2015-11-18 10:03:25 +01:00
|
|
|
file) $(call $(3)_LOCALFILES,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
|
2015-04-26 11:51:04 +02:00
|
|
|
scp) $(call $(3)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
|
|
|
|
*) $(call $(3)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \
|
2012-04-17 16:45:19 +02:00
|
|
|
esac ; \
|
|
|
|
fi ; \
|
2012-06-22 07:37:03 +02:00
|
|
|
if test "$(BR2_PRIMARY_SITE_ONLY)" = "y" ; then \
|
|
|
|
exit 1 ; \
|
|
|
|
fi ; \
|
2012-04-17 16:45:19 +02:00
|
|
|
if test -n "$(1)" ; then \
|
2015-11-19 11:36:02 +01:00
|
|
|
case "$($(PKG)_SITE_METHOD)" in \
|
2015-04-26 11:51:04 +02:00
|
|
|
git) $($(3)_GIT) && exit ;; \
|
|
|
|
svn) $($(3)_SVN) && exit ;; \
|
|
|
|
cvs) $($(3)_CVS) && exit ;; \
|
|
|
|
bzr) $($(3)_BZR) && exit ;; \
|
|
|
|
file) $($(3)_LOCALFILES) && exit ;; \
|
|
|
|
scp) $($(3)_SCP) && exit ;; \
|
|
|
|
hg) $($(3)_HG) && exit ;; \
|
|
|
|
*) $(call $(3)_WGET,$(1),$(2)) && exit ;; \
|
2012-04-17 16:45:19 +02:00
|
|
|
esac ; \
|
|
|
|
fi ; \
|
|
|
|
if test -n "$(call qstrip,$(BR2_BACKUP_SITE))" ; then \
|
2015-04-26 11:51:04 +02:00
|
|
|
$(call $(3)_WGET,$(BR2_BACKUP_SITE)/$(2),$(2)) && exit ; \
|
2012-04-17 16:45:19 +02:00
|
|
|
fi ; \
|
|
|
|
exit 1
|
|
|
|
endef
|