configure
changeset 1333 93d889b9d9bd
parent 1332 61e81db78cf4
child 1347 93b2bdb78e61
     1.1 --- a/configure	Mon May 11 20:24:29 2009 +0000
     1.2 +++ b/configure	Mon May 11 20:44:47 2009 +0000
     1.3 @@ -18,7 +18,7 @@
     1.4  
     1.5  # Simply print the error message, and exit. Obvious, he?
     1.6  do_error() {
     1.7 -    echo "${myname}: ${@}"
     1.8 +    printf "${myname}: ${@}\n"
     1.9      exit 1
    1.10  }
    1.11  
    1.12 @@ -29,11 +29,11 @@
    1.13  get_optval(){
    1.14      case "$1" in
    1.15          --*=?*)
    1.16 -            echo "${1#*=}"
    1.17 +            printf "${1#*=}"
    1.18              return 0
    1.19              ;;
    1.20          *)
    1.21 -            echo "${2}"
    1.22 +            printf "${2}"
    1.23              return 1
    1.24              ;;
    1.25      esac
    1.26 @@ -100,7 +100,6 @@
    1.27      local val
    1.28      local item
    1.29      local where
    1.30 -    local version
    1.31      local status
    1.32  
    1.33      for item in "${@}"; do
    1.34 @@ -128,8 +127,7 @@
    1.35                      printf "no\n"
    1.36                      continue
    1.37                  elif [ -n "${ver}" ]; then
    1.38 -                    version=$( ${where} --version 2>&1 )
    1.39 -                    str=$( echo "${version}" |grep -E "${ver}" |head -n 1 )
    1.40 +                    str=$( "${where}" --version 2>&1 |grep -E "${ver}" |head -n 1 )
    1.41                      if [ -z "${str}" ]; then
    1.42                          printf "no\n"
    1.43                          unset where
    1.44 @@ -243,7 +241,7 @@
    1.45          --with-*)   set_tool   "$1" "$2" && shift || shift 2;;
    1.46          --force)    FORCE=1; shift;;
    1.47          --help|-h)  do_help; exit 0;;
    1.48 -        *)          echo "Unrecognised option: '${1}'"; do_help; exit 1;;
    1.49 +        *)          printf "Unrecognised option: '${1}'\n"; do_help; exit 1;;
    1.50      esac
    1.51  done
    1.52  
    1.53 @@ -265,54 +263,54 @@
    1.54  # We check for grep and sed manually, because they are used in has_or_abort
    1.55  printf "Checking for 'grep'... "
    1.56  if [ -n "${grep}" ]; then
    1.57 -    echo "${grep} (cached)"
    1.58 +    printf "${grep} (cached)\n"
    1.59  else
    1.60      grep="$( which grep 2>/dev/null )"
    1.61      if [ -z "${grep}" ]; then
    1.62 -        echo "not found"
    1.63 +        printf "not found\n"
    1.64      else
    1.65 -        echo "${grep}"
    1.66 +        printf "${grep}\n"
    1.67          printf "Checking whether '${grep}' supports -E... "
    1.68          if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
    1.69 -            echo "yes"
    1.70 +            printf "yes\n"
    1.71          else
    1.72 -            echo "no"
    1.73 +            printf "no\n"
    1.74              grep=
    1.75          fi
    1.76      fi
    1.77  fi
    1.78  if [ -z "${grep}" ]; then
    1.79 -    echo "Either you are missing entirely the needed tool,"
    1.80 -    echo "or the version you have is too old."
    1.81 -    echo "You can give the path to this tool using: --with-grep=PATH"
    1.82 +    printf "Either you are missing entirely the needed tool,\n"
    1.83 +    printf "or the version you have is too old.\n"
    1.84 +    printf "You can give the path to this tool using: --with-grep=PATH\n"
    1.85      do_error "Bailing out..."
    1.86  fi
    1.87  add_to_var_list grep
    1.88  
    1.89  printf "Checking for 'sed'... "
    1.90  if [ -n "${sed}" ]; then
    1.91 -    echo "${sed} (cached)"
    1.92 +    printf "${sed} (cached)\n"
    1.93  else
    1.94      sed="$( which sed 2>/dev/null )"
    1.95      if [ -z "${sed}" ]; then
    1.96 -        echo "not found"
    1.97 +        printf "not found\n"
    1.98      else
    1.99 -        echo "${sed}"
   1.100 +        printf "${sed}\n"
   1.101          printf "Checking whether '${sed}' supports -i and -e... "
   1.102          touch .ct-ng.sed.test
   1.103          if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
   1.104 -            echo "yes"
   1.105 +            printf "yes\n"
   1.106          else
   1.107 -            echo "no"
   1.108 +            printf "no\n"
   1.109              sed=
   1.110          fi
   1.111          rm -f .ct-ng.sed.test
   1.112      fi
   1.113  fi
   1.114  if [ -z "${sed}" ]; then
   1.115 -    echo "Either you are missing entirely the needed tool,"
   1.116 -    echo "or the version you have is too old."
   1.117 -    echo "You can give the path to this tool using: --with-sed=PATH"
   1.118 +    printf "Either you are missing entirely the needed tool,\n"
   1.119 +    printf "or the version you have is too old.\n"
   1.120 +    printf "You can give the path to this tool using: --with-sed=PATH\n"
   1.121      do_error "Bailing out..."
   1.122  fi
   1.123  add_to_var_list sed
   1.124 @@ -386,7 +384,7 @@
   1.125          esac
   1.126          # Arrange to have no / in the directory name, no need to create an
   1.127          # arbitrarily deep directory structure
   1.128 -        VERSION="$( echo "${VERSION}" |"${sed}" -r -e 's|/+|_|g;' )"
   1.129 +        VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
   1.130          ;;
   1.131  esac
   1.132  echo "${VERSION}"