diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-05-27 12:57:46 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2009-05-27 12:57:46 +0000 |
commit | aad8776a0c6c20b3b5452d3ddbe3e84b566461b0 (patch) | |
tree | f59bb19ad074182eab9c53e00d3fee949d97792c | |
parent | a9e7540d3f32574c33902353dcc9e42102dc8389 (diff) | |
download | ptxdist-aad8776a0c6c20b3b5452d3ddbe3e84b566461b0.tar.gz ptxdist-aad8776a0c6c20b3b5452d3ddbe3e84b566461b0.tar.xz |
[setup] add feature to disable downloads
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10574 33e552b5-05e3-0310-8538-816dae2090ed
-rwxr-xr-x | bin/ptxdist | 8 | ||||
-rw-r--r-- | config/setup/Kconfig | 21 | ||||
-rw-r--r-- | rules/pre/Rules.make | 1 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_get.sh | 23 |
4 files changed, 51 insertions, 2 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index a871f69be..b10e6ccd6 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -785,6 +785,7 @@ Overwrite defaults: --collectionconfig=<config> use specified collectionconfig --toolchain=<toolchain> use specified toolchain --force select config even if MOJO is missing + --force-download allow downloading, even if disabled by setup Options: @@ -1115,6 +1116,7 @@ parse_first() unset PTX_MAKE_ARGS unset PTX_DEBUG unset PTX_FORCE + unset PTX_FORCE_DOWNLOAD unset PTX_SLEDGEHAMMER set -- "${PTXDIST_ARGS_FULL[@]}" @@ -1133,6 +1135,9 @@ parse_first() -f|--force) PTX_FORCE=true ;; + --force-download) + PTXDIST_FORCE_DOWNLOAD=true + ;; --sledgehammer) PTX_SLEDGEHAMMER=true ;; @@ -2123,7 +2128,8 @@ setup_export() { \ PTXDIST_PARALLELMFLAGS_INTERN \ \ - PTXDIST_QUIET + PTXDIST_QUIET \ + PTXDIST_FORCE_DOWNLOAD } diff --git a/config/setup/Kconfig b/config/setup/Kconfig index f4b250b6e..8db2f3df9 100644 --- a/config/setup/Kconfig +++ b/config/setup/Kconfig @@ -5,6 +5,11 @@ mainmenu "Setup" +config INVISIBLE + bool + help + don't delete this, it's to keep some menus in shape :) + comment "PTXDIST Setup Menu" menu "Proxies " @@ -71,7 +76,20 @@ config SETUP_KERNELDIR_PREFIX endmenu -menu "Mirrors " +menu "Source Download " + +config SETUP_NO_DOWNLOAD + bool "Do not download sources automatically" + help + Set this to y to disable automatic download at all. + + Note: this can be overwritten by adding the option + "--force-download" to the ptxdist call. + +comment "" + depends on INVISIBLE + +if !SETUP_NO_DOWNLOAD config SETUP_PTXMIRROR_ONLY bool @@ -128,6 +146,7 @@ config SETUP_XORGMIRROR For all x.org related packages enter an available mirror here. endif # !SETUP_PTXMIRROR_ONLY +endif # !SETUP_NO_DOWNLOAD endmenu diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make index 459a94d76..8a9c2c5fe 100644 --- a/rules/pre/Rules.make +++ b/rules/pre/Rules.make @@ -455,6 +455,7 @@ extract = \ # $1: Packet Label; this macro gets $1_URL # get = \ + PTXCONF_SETUP_NO_DOWNLOAD="$(PTXCONF_SETUP_NO_DOWNLOAD)"\ ptxd_make_get "$($(strip $(1))_URL)" diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh index 904a6f47b..9f8691063 100644 --- a/scripts/lib/ptxd_make_get.sh +++ b/scripts/lib/ptxd_make_get.sh @@ -61,6 +61,28 @@ ptxd_make_get_http() { export -f ptxd_make_get_http +# +# check if download is disabled +# +# in env: +# +# ${url} : the url to download +# +ptxd_make_get_downlaod_permitted() { + if [ -n "${PTXCONF_SETUP_NO_DOWNLOAD}" -a -z "${PTXDIST_FORCE_DOWNLOAD}" ]; then + cat >&2 <<EOF + +error: automatically download prohibited + +Please download '${url}' +manually into '${PTXDIST_SRCDIR}' + +EOF + exit 1 + fi +} +export -f ptxd_make_get_downlaod_permitted + # # $@: possible download URLs, seperated by space @@ -143,6 +165,7 @@ ptxd_make_get() { case "${url}" in http://*|https://|ftp://*) + ptxd_make_get_downlaod_permitted && ptxd_make_get_http && return ;; file*) |