Don't print anything about LAN mirror if it is not used.
Don't re-compute a variable that has already been computed.
/trunk/scripts/functions | 16 9 7 0 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
1.1 --- a/scripts/functions Sun Jan 11 18:05:25 2009 +0000
1.2 +++ b/scripts/functions Mon Jan 12 18:54:34 2009 +0000
1.3 @@ -452,7 +452,7 @@
1.4 local basename="${file##*/}"
1.5
1.6 if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
1.7 - CT_DoLog EXTRA "Saving '${file##*/}' to local storage"
1.8 + CT_DoLog EXTRA "Saving '${basename}' to local storage"
1.9 # The file may already exist if downloads are forced: remove it first
1.10 CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${basename}"
1.11 CT_DoExecLog ALL mv -f "${file}" "${CT_LOCAL_TARBALLS_DIR}"
1.12 @@ -490,17 +490,18 @@
1.13 # Add URLs on the LAN mirror
1.14 LAN_URLS=
1.15 if [ "${CT_USE_MIRROR}" = "y" ]; then
1.16 - CT_DoLog DEBUG "Trying to retrieve a copy of '${file}' from LAN mirror '${CT_MIRROR_HOSTNAME}'"
1.17 CT_TestOrAbort "Please set the LAN mirror hostname" -n "${CT_MIRROR_HOSTNAME}"
1.18 CT_TestOrAbort "Please tell me where to find tarballs on the LAN mirror '${CT_MIRROR_HOSTNAME}'" -n "${CT_MIRROR_BASE}"
1.19 LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}/${file%-*}"
1.20 LAN_URLS="${LAN_URLS} ${CT_MIRROR_SCHEME}://${CT_MIRROR_HOSTNAME}/${CT_MIRROR_BASE}"
1.21 - fi
1.22
1.23 - if [ "${CT_PREFER_MIRROR}" = "y" ]; then
1.24 - URLS="${LAN_URLS} ${@}"
1.25 - else
1.26 - URLS="${@} ${LAN_URLS}"
1.27 + if [ "${CT_PREFER_MIRROR}" = "y" ]; then
1.28 + CT_DoLog DEBUG "Pre-pending LAN mirror URLs"
1.29 + URLS="${LAN_URLS} ${@}"
1.30 + else
1.31 + CT_DoLog DEBUG "Appending LAN mirror URLs"
1.32 + URLS="${@} ${LAN_URLS}"
1.33 + fi
1.34 fi
1.35
1.36 # Scan all URLs in turn, and try to grab a tarball from there
1.37 @@ -765,6 +766,7 @@
1.38 local state_dir="${CT_STATE_DIR}/${state_name}"
1.39
1.40 CT_DoLog DEBUG "Saving state to restart at step '${state_name}'..."
1.41 +
1.42 rm -rf "${state_dir}"
1.43 mkdir -p "${state_dir}"
1.44