scripts/functions
changeset 523 010f6f4e4dd6
parent 508 4968462088aa
child 527 4ac12179ef23
     1.1 --- a/scripts/functions	Thu May 15 20:45:18 2008 +0000
     1.2 +++ b/scripts/functions	Tue May 20 21:32:39 2008 +0000
     1.3 @@ -5,15 +5,15 @@
     1.4  # Prepare the fault handler
     1.5  CT_OnError() {
     1.6      ret=$?
     1.7 -    CT_DoLog ERROR "Build failed in step \"${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}\""
     1.8 +    CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'"
     1.9      for((step=(CT_STEP_COUNT-1); step>1; step--)); do
    1.10 -        CT_DoLog ERROR "      called in step \"${CT_STEP_MESSAGE[${step}]}\""
    1.11 +        CT_DoLog ERROR "      called in step '${CT_STEP_MESSAGE[${step}]}'"
    1.12      done
    1.13 -    CT_DoLog ERROR "Error happened in \"${BASH_SOURCE[1]}\" in function \"${FUNCNAME[1]}\" (line unknown, sorry)"
    1.14 +    CT_DoLog ERROR "Error happened in '${BASH_SOURCE[1]}' in function '${FUNCNAME[1]}' (line unknown, sorry)"
    1.15      for((depth=2; ${BASH_LINENO[$((${depth}-1))]}>0; depth++)); do
    1.16 -        CT_DoLog ERROR "      called from \"${BASH_SOURCE[${depth}]}\" at line # ${BASH_LINENO[${depth}-1]} in function \"${FUNCNAME[${depth}]}\""
    1.17 +        CT_DoLog ERROR "      called from '${BASH_SOURCE[${depth}]}' at line # ${BASH_LINENO[${depth}-1]} in function '${FUNCNAME[${depth}]}'"
    1.18      done
    1.19 -    [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at \"${CT_LOG_FILE}\" for more info on this error."
    1.20 +    [ "${CT_LOG_TO_FILE}" = "y" ] && CT_DoLog ERROR "Look at '${CT_LOG_FILE}' for more info on this error."
    1.21      CT_STEP_COUNT=1
    1.22      CT_DoEnd ERROR
    1.23      exit $ret
    1.24 @@ -75,7 +75,11 @@
    1.25      else
    1.26          echo "${1}"
    1.27      fi |( IFS="\n" # We want the full lines, even leading spaces
    1.28 -          CT_PROG_BAR_CPT=0
    1.29 +          _prog_bar_cpt=0
    1.30 +          _prog_bar[0]='/'
    1.31 +          _prog_bar[1]='-'
    1.32 +          _prog_bar[2]='\'
    1.33 +          _prog_bar[3]='|'
    1.34            indent=$((2*CT_STEP_COUNT))
    1.35            while read line; do
    1.36                case "${CT_LOG_SEE_TOOLS_WARN},${line}" in
    1.37 @@ -85,19 +89,15 @@
    1.38                  *"make["?*"]:"*"Stop.") cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};;
    1.39                  *)                      cur_L="${LEVEL}"; cur_l="${level}";;
    1.40                esac
    1.41 -              l="`printf \"[%-5s]%*s%s%s\" \"${cur_L}\" \"${indent}\" \" \" \"${line}\"`"
    1.42 -              # There will always be a log file, be it /dev/null
    1.43 -              echo -e "${l}"
    1.44 +              # There will always be a log file (stdout, fd #1), be it /dev/null
    1.45 +              printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
    1.46                if [ ${cur_l} -le ${max_level} ]; then
    1.47 -                  echo -e "\r${l}" >&6
    1.48 +                  # Only print to console (fd #6) if log level is high enough.
    1.49 +                  printf "\r[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
    1.50                fi
    1.51                if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
    1.52 -                  [ ${CT_PROG_BAR_CPT} -eq 0  ] && bar="/"
    1.53 -                  [ ${CT_PROG_BAR_CPT} -eq 10 ] && bar="-"
    1.54 -                  [ ${CT_PROG_BAR_CPT} -eq 20 ] && bar="\\"
    1.55 -                  [ ${CT_PROG_BAR_CPT} -eq 30 ] && bar="|"
    1.56 -                  printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${bar}" >&6
    1.57 -                  CT_PROG_BAR_CPT=$(((CT_PROG_BAR_CPT+1)%40))
    1.58 +                  printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${_prog_bar[$((_prog_bar_cpt/10))]}" >&6
    1.59 +                  _prog_bar_cpt=$(((_prog_bar_cpt+1)%40))
    1.60                fi
    1.61            done
    1.62          )
    1.63 @@ -110,13 +110,13 @@
    1.64  CT_DoEnd()
    1.65  {
    1.66      local level="$1"
    1.67 -    CT_STOP_DATE=`CT_DoDate +%s%N`
    1.68 -    CT_STOP_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
    1.69 +    CT_STOP_DATE=$(CT_DoDate +%s%N)
    1.70 +    CT_STOP_DATE_HUMAN=$(CT_DoDate +%Y%m%d.%H%M%S)
    1.71      CT_DoLog "${level:-INFO}" "Build completed at ${CT_STOP_DATE_HUMAN}"
    1.72      elapsed=$((CT_STOP_DATE-CT_STAR_DATE))
    1.73      elapsed_min=$((elapsed/(60*1000*1000*1000)))
    1.74 -    elapsed_sec=`printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000)))`
    1.75 -    elapsed_csec=`printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000)))`
    1.76 +    elapsed_sec=$(printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000))))
    1.77 +    elapsed_csec=$(printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000))))
    1.78      CT_DoLog ${level:-INFO} "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})"
    1.79  }
    1.80  
    1.81 @@ -158,7 +158,7 @@
    1.82  # Test the presence of a tool, or abort if not found
    1.83  # Usage: CT_HasOrAbort <tool>
    1.84  CT_HasOrAbort() {
    1.85 -    CT_TestAndAbort "\"${1}\" not found and needed for successful toolchain build." -z "`CT_Which \"${1}\"`"
    1.86 +    CT_TestAndAbort "'${1}' not found and needed for successful toolchain build." -z ""$(CT_Which "${1}")
    1.87      return 0
    1.88  }
    1.89  
    1.90 @@ -183,7 +183,7 @@
    1.91  # Memorise a step being done so that any error is caught
    1.92  # Usage: CT_DoStep <loglevel> <message>
    1.93  CT_DoStep() {
    1.94 -    local start=`CT_DoDate +%s%N`
    1.95 +    local start=$(CT_DoDate +%s%N)
    1.96      CT_DoLog "$1" "================================================================="
    1.97      CT_DoLog "$1" "$2"
    1.98      CT_STEP_COUNT=$((CT_STEP_COUNT+1))
    1.99 @@ -196,8 +196,8 @@
   1.100  # End the step just being done
   1.101  # Usage: CT_EndStep
   1.102  CT_EndStep() {
   1.103 -    local stop=`CT_DoDate +%s%N`
   1.104 -    local duration=`printf "%032d" $((stop-${CT_STEP_START[${CT_STEP_COUNT}]})) |sed -r -e 's/([[:digit:]]{2})[[:digit:]]{7}$/\.\1/; s/^0+//; s/^\./0\./;'`
   1.105 +    local stop=$(CT_DoDate +%s%N)
   1.106 +    local duration=$(printf "%032d" $((stop-${CT_STEP_START[${CT_STEP_COUNT}]})) |sed -r -e 's/([[:digit:]]{2})[[:digit:]]{7}$/\.\1/; s/^0+//; s/^\./0\./;')
   1.107      local level="${CT_STEP_LEVEL[${CT_STEP_COUNT}]}"
   1.108      local message="${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}"
   1.109      CT_STEP_COUNT=$((CT_STEP_COUNT-1))
   1.110 @@ -225,7 +225,7 @@
   1.111          # No such directory, fail back to guessing
   1.112          case "$1" in
   1.113              /*)  echo "$1";;
   1.114 -            *)   echo "`pwd`/$1";;
   1.115 +            *)   echo "$(pwd)/$1";;
   1.116          esac
   1.117      fi
   1.118      
   1.119 @@ -237,7 +237,7 @@
   1.120  # Usage: CT_MktempDir foo
   1.121  CT_MktempDir() {
   1.122      # Some mktemp do not allow more than 6 Xs
   1.123 -    eval "$1"="`mktemp -q -d \"${CT_BUILD_DIR}/.XXXXXX\"`"
   1.124 +    eval "$1"=$(mktemp -q -d "${CT_BUILD_DIR}/.XXXXXX")
   1.125      CT_TestOrAbort "Could not make temporary directory" -n "${!1}" -a -d "${!1}"
   1.126  }
   1.127  
   1.128 @@ -302,8 +302,8 @@
   1.129      || true
   1.130  }
   1.131  
   1.132 -_wget=`CT_Which wget`
   1.133 -_curl=`CT_Which curl`
   1.134 +_wget=$(CT_Which wget)
   1.135 +_curl=$(CT_Which curl)
   1.136  # Wrapper function to call one of curl or wget
   1.137  # Usage: CT_DoGetFile <URL>
   1.138  CT_DoGetFile() {
   1.139 @@ -330,9 +330,9 @@
   1.140      esac
   1.141  
   1.142      # Do we already have it?
   1.143 -    ext=`CT_GetFileExtension "${file}"`
   1.144 +    ext=$(CT_GetFileExtension "${file}")
   1.145      if [ -n "${ext}" ]; then
   1.146 -        CT_DoLog DEBUG "Already have \"${file}\""
   1.147 +        CT_DoLog DEBUG "Already have '${file}'"
   1.148          return 0
   1.149      fi
   1.150  
   1.151 @@ -341,27 +341,27 @@
   1.152      # or, as a failover, a file without extension.
   1.153      # Try local copy first, if it exists
   1.154      for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
   1.155 -        CT_DoLog DEBUG "Trying \"${CT_LOCAL_TARBALLS_DIR}/${file}${ext}\""
   1.156 +        CT_DoLog DEBUG "Trying '${CT_LOCAL_TARBALLS_DIR}/${file}${ext}'"
   1.157          if [ -r "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" -a \
   1.158               "${CT_FORCE_DOWNLOAD}" != "y" ]; then
   1.159 -            CT_DoLog EXTRA "Using \"${file}\" from local storage"
   1.160 +            CT_DoLog EXTRA "Using '${file}' from local storage"
   1.161              ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL
   1.162              return 0
   1.163          fi
   1.164      done
   1.165      # Try to download it
   1.166 -    CT_DoLog EXTRA "Retrieving \"${file}\" from network"
   1.167 +    CT_DoLog EXTRA "Retrieving '${file}' from network"
   1.168      for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
   1.169          # Try all urls in turn
   1.170          for url in "$@"; do
   1.171 -            CT_DoLog DEBUG "Trying \"${url}/${file}${ext}\""
   1.172 +            CT_DoLog DEBUG "Trying '${url}/${file}${ext}'"
   1.173              CT_DoGetFile "${url}/${file}${ext}"
   1.174              if [ -f "${file}${ext}" ]; then
   1.175                  # No need to test if the file already exists because
   1.176                  # it does NOT. If it did exist, we'd have been stopped
   1.177                  # above, when looking for local copies.
   1.178                  if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
   1.179 -                    CT_DoLog EXTRA "Saving \"${file}\" to local storage"
   1.180 +                    CT_DoLog EXTRA "Saving '${file}' to local storage"
   1.181                      mv "${file}${ext}" "${CT_LOCAL_TARBALLS_DIR}" |CT_DoLog ALL
   1.182                      ln -sv "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog ALL
   1.183                  fi
   1.184 @@ -371,7 +371,7 @@
   1.185      done
   1.186      CT_Popd
   1.187  
   1.188 -    CT_Abort "Could not download \"${file}\", and not present in \"${CT_LOCAL_TARBALLS_DIR}\""
   1.189 +    CT_Abort "Could not download '${file}', and not present in '${CT_LOCAL_TARBALLS_DIR}'"
   1.190  }
   1.191  
   1.192  # Extract a tarball and patch the resulting sources if necessary.
   1.193 @@ -380,13 +380,13 @@
   1.194  # in the extra/locale sub-directory of uClibc.
   1.195  CT_ExtractAndPatch() {
   1.196      local file="$1"
   1.197 -    local base_file=`echo "${file}" |cut -d - -f 1`
   1.198 -    local ver_file=`echo "${file}" |cut -d - -f 2-`
   1.199 +    local base_file=$(echo "${file}" |cut -d - -f 1)
   1.200 +    local ver_file=$(echo "${file}" |cut -d - -f 2-)
   1.201      local official_patch_dir
   1.202      local custom_patch_dir
   1.203      local libc_addon
   1.204 -    local ext=`CT_GetFileExtension "${file}"`
   1.205 -    CT_TestAndAbort "\"${file}\" not found in \"${CT_TARBALLS_DIR}\"" -z "${ext}"
   1.206 +    local ext=$(CT_GetFileExtension "${file}")
   1.207 +    CT_TestAndAbort "'${file}' not found in '${CT_TARBALLS_DIR}'" -z "${ext}"
   1.208      local full_file="${CT_TARBALLS_DIR}/${file}${ext}"
   1.209  
   1.210      CT_Pushd "${CT_SRC_DIR}"
   1.211 @@ -394,14 +394,14 @@
   1.212      # Add-ons need a little love, really.
   1.213      case "${file}" in
   1.214          glibc-[a-z]*-*)
   1.215 -            CT_TestAndAbort "Trying to extract the C-library addon/locales \"${file}\" when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
   1.216 +            CT_TestAndAbort "Trying to extract the C-library addon/locales '${file}' when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
   1.217              cd "${CT_LIBC_FILE}"
   1.218              libc_addon=y
   1.219              [ -f ".${file}.extracted" ] && return 0
   1.220              touch ".${file}.extracted"
   1.221              ;;
   1.222          uClibc-locale-*)
   1.223 -            CT_TestAndAbort "Trying to extract the C-library addon/locales \"${file}\" when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
   1.224 +            CT_TestAndAbort "Trying to extract the C-library addon/locales '${file}' when C-library not yet extracted" ! -d "${CT_LIBC_FILE}"
   1.225              cd "${CT_LIBC_FILE}/extra/locale"
   1.226              libc_addon=y
   1.227              [ -f ".${file}.extracted" ] && return 0
   1.228 @@ -411,16 +411,16 @@
   1.229  
   1.230      # If the directory exists, then consider extraction and patching done
   1.231      if [ -d "${file}" ]; then
   1.232 -        CT_DoLog DEBUG "Already extracted \"${file}\""
   1.233 +        CT_DoLog DEBUG "Already extracted '${file}'"
   1.234          return 0
   1.235      fi
   1.236  
   1.237 -    CT_DoLog EXTRA "Extracting \"${file}\""
   1.238 +    CT_DoLog EXTRA "Extracting '${file}'"
   1.239      case "${ext}" in
   1.240          .tar.bz2)     tar xvjf "${full_file}" |CT_DoLog ALL;;
   1.241          .tar.gz|.tgz) tar xvzf "${full_file}" |CT_DoLog ALL;;
   1.242          .tar)         tar xvf  "${full_file}" |CT_DoLog ALL;;
   1.243 -        *)            CT_Abort "Don't know how to handle \"${file}\": unknown extension" ;;
   1.244 +        *)            CT_Abort "Don't know how to handle '${file}': unknown extension" ;;
   1.245      esac
   1.246  
   1.247      # Snapshots might not have the version number in the extracted directory
   1.248 @@ -428,23 +428,23 @@
   1.249      # Overcome this issue by symlink'ing the directory.
   1.250      if [ ! -d "${file}" -a "${libc_addon}" != "y" ]; then
   1.251          case "${ext}" in
   1.252 -            .tar.bz2)     base=`tar tjf "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
   1.253 -            .tar.gz|.tgz) base=`tar tzf "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
   1.254 -            .tar)         base=`tar tf  "${full_file}" |head -n 1 |cut -d / -f 1 || true`;;
   1.255 +            .tar.bz2)     base=$(tar tjf "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
   1.256 +            .tar.gz|.tgz) base=$(tar tzf "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
   1.257 +            .tar)         base=$(tar tf  "${full_file}" |head -n 1 |cut -d / -f 1 || true);;
   1.258          esac
   1.259 -        CT_TestOrAbort "There was a problem when extracting \"${file}\"" -d "${base}" -o "${base}" != "${file}"
   1.260 +        CT_TestOrAbort "There was a problem when extracting '${file}'" -d "${base}" -o "${base}" != "${file}"
   1.261          ln -s "${base}" "${file}"
   1.262      fi
   1.263  
   1.264      # Kludge: outside this function, we wouldn't know if we had just extracted
   1.265      # a libc addon, or a plain package. Apply patches now.
   1.266 -    CT_DoLog EXTRA "Patching \"${file}\""
   1.267 +    CT_DoLog EXTRA "Patching '${file}'"
   1.268  
   1.269      if [ "${libc_addon}" = "y" ]; then
   1.270          # Some addon tarballs directly contain the correct addon directory,
   1.271          # while others have the addon directory named after the tarball.
   1.272          # Fix that by always using the short name (eg: linuxthreads, ports, etc...)
   1.273 -        addon_short_name=`echo "${file}" |sed -r -e 's/^[^-]+-//; s/-[^-]+$//;'`
   1.274 +        addon_short_name=$(echo "${file}" |sed -r -e 's/^[^-]+-//; s/-[^-]+$//;')
   1.275          [ -d "${addon_short_name}" ] || ln -s "${file}" "${addon_short_name}"
   1.276          # If libc addon, we're already in the correct place
   1.277      else
   1.278 @@ -459,9 +459,9 @@
   1.279          if [ -n "${patch_dir}" -a -d "${patch_dir}" ]; then
   1.280              for p in "${patch_dir}"/*.patch; do
   1.281                  if [ -f "${p}" ]; then
   1.282 -                    CT_DoLog DEBUG "Applying patch \"${p}\""
   1.283 +                    CT_DoLog DEBUG "Applying patch '${p}'"
   1.284                      patch -g0 -F1 -p1 -f <"${p}" |CT_DoLog ALL
   1.285 -                    CT_TestAndAbort "Failed while applying patch file \"${p}\"" ${PIPESTATUS[0]} -ne 0
   1.286 +                    CT_TestAndAbort "Failed while applying patch file '${p}'" ${PIPESTATUS[0]} -ne 0
   1.287                  fi
   1.288              done
   1.289          fi
   1.290 @@ -542,7 +542,7 @@
   1.291      case "${CT_KERNEL}" in
   1.292          linux*)  CT_TARGET_KERNEL=linux;;
   1.293      esac
   1.294 -    CT_TARGET=`CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}"`
   1.295 +    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET_ARCH}-${CT_TARGET_VENDOR:-unknown}-${CT_TARGET_KERNEL}-${CT_TARGET_SYS}")
   1.296  
   1.297      # Prepare the target CFLAGS
   1.298      CT_ARCH_TARGET_CFLAGS="${CT_ARCH_ARCH_CFLAG}"
   1.299 @@ -560,7 +560,7 @@
   1.300      local foo
   1.301      local message="${1:-Pausing for your pleasure}"
   1.302      CT_DoLog INFO "${message}"
   1.303 -    read -p "Press \"Enter\" to continue, or Ctrl-C to stop..." foo >&6
   1.304 +    read -p "Press 'Enter' to continue, or Ctrl-C to stop..." foo >&6
   1.305      return 0
   1.306  }
   1.307  
   1.308 @@ -572,7 +572,7 @@
   1.309      local state_name="$1"
   1.310      local state_dir="${CT_STATE_DIR}/${state_name}"
   1.311  
   1.312 -    CT_DoLog DEBUG "Saving state to restart at step \"${state_name}\"..."
   1.313 +    CT_DoLog DEBUG "Saving state to restart at step '${state_name}'..."
   1.314      rm -rf "${state_dir}"
   1.315      mkdir -p "${state_dir}"
   1.316  
   1.317 @@ -590,17 +590,17 @@
   1.318           $0 == "}" { _p = 1; }
   1.319           ' >"${state_dir}/env.sh"
   1.320  
   1.321 -    CT_DoLog DEBUG "  Saving CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
   1.322 +    CT_DoLog DEBUG "  Saving CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
   1.323      CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
   1.324      tar cv${tar_opt}f "${state_dir}/cc_core_static_prefix_dir.tar${tar_ext}" . |CT_DoLog DEBUG
   1.325      CT_Popd
   1.326  
   1.327 -    CT_DoLog DEBUG "  Saving CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
   1.328 +    CT_DoLog DEBUG "  Saving CT_CC_CORE_SHARED_PREFIX_DIR='${CT_CC_CORE_SHARED_PREFIX_DIR}'"
   1.329      CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
   1.330      tar cv${tar_opt}f "${state_dir}/cc_core_shared_prefix_dir.tar${tar_ext}" . |CT_DoLog DEBUG
   1.331      CT_Popd
   1.332  
   1.333 -    CT_DoLog DEBUG "  Saving CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
   1.334 +    CT_DoLog DEBUG "  Saving CT_PREFIX_DIR='${CT_PREFIX_DIR}'"
   1.335      CT_Pushd "${CT_PREFIX_DIR}"
   1.336      tar cv${tar_opt}f "${state_dir}/prefix_dir.tar${tar_ext}" --exclude '*.log' . |CT_DoLog DEBUG
   1.337      CT_Popd
   1.338 @@ -624,13 +624,13 @@
   1.339      local old_RESTART="${CT_RESTART}"
   1.340      local old_STOP="${CT_STOP}"
   1.341  
   1.342 -    CT_TestOrAbort "The previous build did not reach the point where it could be restarted at \"${CT_RESTART}\"" -d "${state_dir}"
   1.343 +    CT_TestOrAbort "The previous build did not reach the point where it could be restarted at '${CT_RESTART}'" -d "${state_dir}"
   1.344  
   1.345      # We need to do something special with the log file!
   1.346      if [ "${CT_LOG_TO_FILE}" = "y" ]; then
   1.347          exec >"${state_dir}/tail.log"
   1.348      fi
   1.349 -    CT_DoLog INFO "Restoring state at step \"${state_name}\", as requested."
   1.350 +    CT_DoLog INFO "Restoring state at step '${state_name}', as requested."
   1.351  
   1.352      case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
   1.353          y)  tar_opt=z; tar_ext=.gz;;
   1.354 @@ -642,17 +642,17 @@
   1.355      rm -rf         "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
   1.356      mkdir -p       "${CT_PREFIX_DIR}" "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
   1.357  
   1.358 -    CT_DoLog DEBUG "  Restoring CT_PREFIX_DIR=\"${CT_PREFIX_DIR}\""
   1.359 +    CT_DoLog DEBUG "  Restoring CT_PREFIX_DIR='${CT_PREFIX_DIR}'"
   1.360      CT_Pushd "${CT_PREFIX_DIR}"
   1.361      tar xv${tar_opt}f "${state_dir}/prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
   1.362      CT_Popd
   1.363  
   1.364 -    CT_DoLog DEBUG "  Restoring CT_CC_CORE_SHARED_PREFIX_DIR=\"${CT_CC_CORE_SHARED_PREFIX_DIR}\""
   1.365 +    CT_DoLog DEBUG "  Restoring CT_CC_CORE_SHARED_PREFIX_DIR='${CT_CC_CORE_SHARED_PREFIX_DIR}'"
   1.366      CT_Pushd "${CT_CC_CORE_SHARED_PREFIX_DIR}"
   1.367      tar xv${tar_opt}f "${state_dir}/cc_core_shared_prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
   1.368      CT_Popd
   1.369  
   1.370 -    CT_DoLog DEBUG "  Restoring CT_CC_CORE_STATIC_PREFIX_DIR=\"${CT_CC_CORE_STATIC_PREFIX_DIR}\""
   1.371 +    CT_DoLog DEBUG "  Restoring CT_CC_CORE_STATIC_PREFIX_DIR='${CT_CC_CORE_STATIC_PREFIX_DIR}'"
   1.372      CT_Pushd "${CT_CC_CORE_STATIC_PREFIX_DIR}"
   1.373      tar xv${tar_opt}f "${state_dir}/cc_core_static_prefix_dir.tar${tar_ext}" |CT_DoLog DEBUG
   1.374      CT_Popd