diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-08-09 17:48:13 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-08-09 17:48:13 +0000 |
commit | dfad0fbd2f97b73c9f9b4e835dd6de513e3ae654 (patch) | |
tree | 88fded3a7530bbe241d5122e9cbfb03cd00c5ce8 /scripts/functions | |
parent | 5bc276a6f0e2a5e7cdd1b0c23098f1bf4bfb3015 (diff) | |
download | crosstool-ng-dfad0fbd2f97b73c9f9b4e835dd6de513e3ae654.tar.gz crosstool-ng-dfad0fbd2f97b73c9f9b4e835dd6de513e3ae654.tar.bz2 crosstool-ng-dfad0fbd2f97b73c9f9b4e835dd6de513e3ae654.zip |
Merge #920 from branches/eglibc:
Fix saving tarballs locally in case downloads are forced.
/trunk/scripts/functions | 14 6 8 0 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/functions b/scripts/functions index b6c0bff4..7c4d7b91 100644 --- a/scripts/functions +++ b/scripts/functions @@ -491,11 +491,10 @@ CT_GetFile() { CT_DoGetFile "${url}/${file}${ext}" if [ -f "${file}${ext}" ]; then if [ "${CT_SAVE_TARBALLS}" = "y" ]; then - # No need to test if the file already exists because - # it does NOT. If it did exist, we'd have been stopped - # above, when looking for local copies. + # The file may already exist if downloads are forced: remove it first CT_DoLog EXTRA "Saving '${file}' to local storage" - CT_DoExecLog ALL mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" + CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" + CT_DoExecLog ALL mv -f "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" fi CT_DoLog EXTRA "Got '${file}' from the LAN mirror" @@ -514,11 +513,10 @@ CT_GetFile() { CT_DoGetFile "${url}/${file}${ext}" if [ -f "${file}${ext}" ]; then if [ "${CT_SAVE_TARBALLS}" = "y" ]; then - # No need to test if the file already exists because - # it does NOT. If it did exist, we'd have been stopped - # above, when looking for local copies. + # The file may already exist if downloads are forced: remove it first CT_DoLog EXTRA "Saving '${file}' to local storage" - CT_DoExecLog ALL mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" + CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" + CT_DoExecLog ALL mv -f "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" fi CT_DoLog EXTRA "Got '${file}' from the Internet" |