mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-18 18:56:31 +00:00
configure:
- as per: http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html section "application Usage", change all occurences of: echo "..." with: printf "...\n" -------- diffstat follows -------- /trunk/configure | 46 22 24 0 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-)
This commit is contained in:
parent
674c493dd2
commit
7bc6829e38
46
configure
vendored
46
configure
vendored
@ -18,7 +18,7 @@ do_quit=
|
||||
|
||||
# Simply print the error message, and exit. Obvious, he?
|
||||
do_error() {
|
||||
echo "${myname}: ${@}"
|
||||
printf "${myname}: ${@}\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -29,11 +29,11 @@ do_error() {
|
||||
get_optval(){
|
||||
case "$1" in
|
||||
--*=?*)
|
||||
echo "${1#*=}"
|
||||
printf "${1#*=}"
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
echo "${2}"
|
||||
printf "${2}"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
@ -100,7 +100,6 @@ has_or_abort() {
|
||||
local val
|
||||
local item
|
||||
local where
|
||||
local version
|
||||
local status
|
||||
|
||||
for item in "${@}"; do
|
||||
@ -128,8 +127,7 @@ has_or_abort() {
|
||||
printf "no\n"
|
||||
continue
|
||||
elif [ -n "${ver}" ]; then
|
||||
version=$( ${where} --version 2>&1 )
|
||||
str=$( echo "${version}" |grep -E "${ver}" |head -n 1 )
|
||||
str=$( "${where}" --version 2>&1 |grep -E "${ver}" |head -n 1 )
|
||||
if [ -z "${str}" ]; then
|
||||
printf "no\n"
|
||||
unset where
|
||||
@ -243,7 +241,7 @@ while [ $# -ne 0 ]; do
|
||||
--with-*) set_tool "$1" "$2" && shift || shift 2;;
|
||||
--force) FORCE=1; shift;;
|
||||
--help|-h) do_help; exit 0;;
|
||||
*) echo "Unrecognised option: '${1}'"; do_help; exit 1;;
|
||||
*) printf "Unrecognised option: '${1}'\n"; do_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -265,54 +263,54 @@ fi
|
||||
# We check for grep and sed manually, because they are used in has_or_abort
|
||||
printf "Checking for 'grep'... "
|
||||
if [ -n "${grep}" ]; then
|
||||
echo "${grep} (cached)"
|
||||
printf "${grep} (cached)\n"
|
||||
else
|
||||
grep="$( which grep 2>/dev/null )"
|
||||
if [ -z "${grep}" ]; then
|
||||
echo "not found"
|
||||
printf "not found\n"
|
||||
else
|
||||
echo "${grep}"
|
||||
printf "${grep}\n"
|
||||
printf "Checking whether '${grep}' supports -E... "
|
||||
if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then
|
||||
echo "yes"
|
||||
printf "yes\n"
|
||||
else
|
||||
echo "no"
|
||||
printf "no\n"
|
||||
grep=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -z "${grep}" ]; then
|
||||
echo "Either you are missing entirely the needed tool,"
|
||||
echo "or the version you have is too old."
|
||||
echo "You can give the path to this tool using: --with-grep=PATH"
|
||||
printf "Either you are missing entirely the needed tool,\n"
|
||||
printf "or the version you have is too old.\n"
|
||||
printf "You can give the path to this tool using: --with-grep=PATH\n"
|
||||
do_error "Bailing out..."
|
||||
fi
|
||||
add_to_var_list grep
|
||||
|
||||
printf "Checking for 'sed'... "
|
||||
if [ -n "${sed}" ]; then
|
||||
echo "${sed} (cached)"
|
||||
printf "${sed} (cached)\n"
|
||||
else
|
||||
sed="$( which sed 2>/dev/null )"
|
||||
if [ -z "${sed}" ]; then
|
||||
echo "not found"
|
||||
printf "not found\n"
|
||||
else
|
||||
echo "${sed}"
|
||||
printf "${sed}\n"
|
||||
printf "Checking whether '${sed}' supports -i and -e... "
|
||||
touch .ct-ng.sed.test
|
||||
if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
|
||||
echo "yes"
|
||||
printf "yes\n"
|
||||
else
|
||||
echo "no"
|
||||
printf "no\n"
|
||||
sed=
|
||||
fi
|
||||
rm -f .ct-ng.sed.test
|
||||
fi
|
||||
fi
|
||||
if [ -z "${sed}" ]; then
|
||||
echo "Either you are missing entirely the needed tool,"
|
||||
echo "or the version you have is too old."
|
||||
echo "You can give the path to this tool using: --with-sed=PATH"
|
||||
printf "Either you are missing entirely the needed tool,\n"
|
||||
printf "or the version you have is too old.\n"
|
||||
printf "You can give the path to this tool using: --with-sed=PATH\n"
|
||||
do_error "Bailing out..."
|
||||
fi
|
||||
add_to_var_list sed
|
||||
@ -386,7 +384,7 @@ case "${VERSION}" in
|
||||
esac
|
||||
# Arrange to have no / in the directory name, no need to create an
|
||||
# arbitrarily deep directory structure
|
||||
VERSION="$( echo "${VERSION}" |"${sed}" -r -e 's|/+|_|g;' )"
|
||||
VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
|
||||
;;
|
||||
esac
|
||||
echo "${VERSION}"
|
||||
|
Loading…
Reference in New Issue
Block a user