# HG changeset patch # User "Yann E. MORIN" # Date 1218305429 0 # Node ID 33c13a486d8934e601518249e320ad778af1232e # Parent da5cd379de06d0ccba2d44454aa06ac75097c37b Backport #926 from trunk: Fix saving tarballs locally in case downloads are forced. /branches/1.2/scripts/functions | 18 8 10 0 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff -r da5cd379de06 -r 33c13a486d89 scripts/functions --- a/scripts/functions Sat Aug 09 18:06:43 2008 +0000 +++ b/scripts/functions Sat Aug 09 18:10:29 2008 +0000 @@ -385,12 +385,11 @@ 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" - mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" |CT_DoLog ALL - ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL + 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 return 0 fi @@ -406,12 +405,11 @@ 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" - mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" |CT_DoLog ALL - ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL + 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 return 0 fi