summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-12-02 00:13:47 +0100
committerJan Holesovsky <kendy@suse.cz>2010-12-02 00:14:48 +0100
commit4d4a49043e942d1a2abbfd938576065f1537963b (patch)
tree4abc09cfcdfa006888c9e6bfee813281345609f2
parent5613267b68ae4b83bf6f037032e223170079a2ae (diff)
autogen.sh: Even more portable.
-rwxr-xr-xautogen.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/autogen.sh b/autogen.sh
index 1ce957a5b..c7a11362e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -11,23 +11,27 @@ fi
requote()
{
- local q=\'
- set -- "${@//\'/$q\'$q}" # quote inner instances of '
- set -- "${@/#/$q}" # add ' to start of each param
- set -- "${@/%/$q}" # add ' to end of each param
- echo "$*" # ' in a comment to stop confusing vim
+ out=""
+ for param in "$@" ; do
+ p=`echo "$param" | sed "s/'/'\\\\\\''/g"`
+ if test -z "$out" ; then
+ out="'$p'"
+ else
+ out="$out '$p'"
+ fi
+ done
+ echo "$out"
}
distro()
{
name=''
- while test "$#" -gt 0 ; do
- case "$1" in
- --with-distro=*) name=${1#--with-distro=} ;;
+ for param in "$@" ; do
+ case "$param" in
+ --with-distro=*) name=${param#--with-distro=} ;;
esac
- shift
done
- echo $name
+ echo "$name"
}
old_args=""