[Libreoffice-commits] .: autogen.sh

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Dec 1 10:50:46 PST 2010


 autogen.sh |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit c84f3afb7d9966c1e57d5c5115d312189db4d5d8
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Dec 1 19:03:56 2010 +0100

    autogen.sh: Remove bashism / non-portable stuff.

diff --git a/autogen.sh b/autogen.sh
index cd54c90..1ce957a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,7 +15,19 @@ requote()
         set -- "${@//\'/$q\'$q}"        # quote inner instances of '
         set -- "${@/#/$q}"              # add ' to start of each param
         set -- "${@/%/$q}"              # add ' to end of each param
-        echo "$*"
+        echo "$*"                       # ' in a comment to stop confusing vim
+}
+
+distro()
+{
+    name=''
+    while test "$#" -gt 0 ; do
+	case "$1" in
+	    --with-distro=*) name=${1#--with-distro=} ;;
+	esac
+	shift
+    done
+    echo $name
 }
 
 old_args=""
@@ -34,16 +46,16 @@ if test "z`uname -s`" != "zDarwin" ; then
 fi
 
 conf_args=$(requote "$@")
-distro_name=$(requote "$@" | sed -n -e "s/.*'--with-distro=\([^']*\)'.*/\1/p")
+distro_name=$(distro "$@")
 if test "z${distro_name}" != "z" ; then
     cumul=""
     if test -f "./distro-configs/${distro_name}.conf" ; then
-        IFS=$'\n'
+        IFS="$(printf '\n')"
         for opt in $(cat distro-configs/${distro_name}.conf) ; do cumul="$cumul $opt" ; done ;
         unset IFS
         conf_args=$(requote "$@" | sed -e "s/'--with-distro=[^']*'/$cumul/")
     else
-        echo "Warning: there is no pre-set configuration for ${distro_config}, ignoring --with-distro=${distro_config}"
+        echo "Warning: there is no pre-set configuration for ${distro_name}, ignoring --with-distro=${distro_name}"
     fi
 fi
 


More information about the Libreoffice-commits mailing list