From 03c3e02fb7a336f2e3016a8ea339163ebdef8c9a Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 2 Aug 2011 23:10:37 +0200 Subject: scripts: try the mirror even if downloads are forbidden Signed-off-by: "Yann E. MORIN" --- scripts/functions | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index 24bebb4d..b95879c2 100644 --- a/scripts/functions +++ b/scripts/functions @@ -540,7 +540,9 @@ CT_GetFile() { URLS+=( "${CT_MIRROR_BASE_URL}" ) fi - URLS+=( "${@}" ) + if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then + URLS+=( "${@}" ) + fi # Scan all URLs in turn, and try to grab a tarball from there # Do *not* try git trees (ext=/.git), this is handled in a specific @@ -588,6 +590,11 @@ CT_GetCVS() { return 0 fi + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then + CT_DoLog WARN "Downloads forbidden, not trying cvs retrieval" + return 1 + fi + CT_MktempDir tmp_dir CT_Pushd "${tmp_dir}" @@ -627,6 +634,11 @@ CT_GetSVN() { return 0 fi + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then + CT_DoLog WARN "Downloads forbidden, not trying svn retrieval" + return 1 + fi + CT_MktempDir tmp_dir CT_Pushd "${tmp_dir}" @@ -652,6 +664,11 @@ CT_GetGit() { local url local cloned=0 + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then + CT_DoLog WARN "Downloads forbidden, not trying git retrieval" + return 1 + fi + # Do we have it in our tarballs dir? if [ -d "${CT_TARBALLS_DIR}/${basename}/.git" ]; then CT_DoLog EXTRA "Updating git tree '${basename}'" -- cgit v1.2.3