summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-01-06 22:34:36 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-01-06 22:34:36 (GMT)
commitf3263568749070b8d03c809c10caa78747073e26 (patch)
treef7f75e2010fc6de555e0f2fc7b0205581a6950c7 /scripts/functions
parenta45c6b0232594a424fcbbd1affe7962261cafdc9 (diff)
Add an option to forbid downloads.
Idea and code-base from Don Elwell <don@manifoldlabs.com>, adapted by me. /trunk/scripts/functions | 6 6 0 0 ++++++ /trunk/config/global/download.in | 18 18 0 0 ++++++++++++++++++ 2 files changed, 24 insertions(+)
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index fa6ed3e..3a540a3 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -480,6 +480,9 @@ CT_GetFile() {
CT_GetLocal "${file}" ${first_ext} && return 0 || true
# No, it does not...
+ # Are downloads allowed ?
+ CT_TestAndAbort "File '${file}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
+
# Try to retrieve the file
CT_DoLog EXTRA "Retrieving '${file}'"
CT_Pushd "${CT_TARBALLS_DIR}"
@@ -539,6 +542,9 @@ CT_GetCVS() {
CT_GetLocal "${basename}" && return 0 || true
# No, it does not...
+ # Are downloads allowed ?
+ CT_TestAndAbort "File '${file}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
+
CT_DoLog EXTRA "Retrieving '${basename}'"
CT_MktempDir tmp_dir