[Libreoffice-commits] core.git: desktop/scripts

Thorsten Behrens Thorsten.Behrens at CIB.de
Mon May 11 14:06:30 PDT 2015


 desktop/scripts/soffice.sh     |   14 +++++++-------
 desktop/scripts/unoinfo-mac.sh |    4 ++--
 desktop/scripts/unoinfo.sh     |    4 ++--
 desktop/scripts/unopkg.sh      |   16 ++++++++--------
 4 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 23c0e00b50f7fae7a82134ef064eabf9514a941b
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Mon May 11 22:58:25 2015 +0200

    Add some quoting to shell scripts.
    
    I'd be surprised if the places given want globs and word
    splitting...
    
    Change-Id: I0eb9f2d39ac43479ee06a2477ba309a8e1944d20

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index b1ab4c9..3a83c22 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -18,7 +18,7 @@
 #
 
 # use POSIX locale for well-defined tool output
-LO_SAVE_LC_ALL=$LC_ALL
+LO_SAVE_LC_ALL="$LC_ALL"
 LC_ALL=C
 export LC_ALL
 
@@ -45,7 +45,7 @@ export SAL_ENABLE_FILE_LOCKING
 
 # resolve installation directory
 sd_cwd=`pwd`
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
     cd "`dirname "$sd_res"`"
     sd_basename=`basename "$sd_res"`
@@ -56,8 +56,8 @@ sd_prog=`pwd`
 cd "$sd_cwd"
 
 # linked build needs additional settings
-if [ -e $sd_prog/ooenv ] ; then
-    . $sd_prog/ooenv
+if [ -e "${sd_prog}/ooenv" ] ; then
+    . "${sd_prog}/ooenv}"
 fi
 
 # try to get some debug output?
@@ -107,7 +107,7 @@ for arg in $@ $VALGRINDOPT ; do
                 VALGRINDCHECK="valgrind --tool=$VALGRIND --trace-children=yes $valgrind_skip --num-callers=50 --error-limit=no"
                 echo "use kill -SIGUSR2 pid to dump traces of active allocations"
                 checks="c$checks"
-                case $VALGRIND in
+                case "$VALGRIND" in
                 helgrind|memcheck)
                     export G_SLICE=always-malloc
                     export GLIBCXX_FORCE_NEW=1
@@ -130,7 +130,7 @@ fi
 case "`uname -s`" in
 NetBSD|OpenBSD|FreeBSD|DragonFly)
 # this is a temporary hack until we can live with the default search paths
-    LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+    LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
     JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
     export LD_LIBRARY_PATH
     if [ -n "${JAVA_HOME}" ]; then
@@ -138,7 +138,7 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
     fi
     ;;
 AIX)
-    LIBPATH=$sd_prog${LIBPATH:+:$LIBPATH}
+    LIBPATH="$sd_prog${LIBPATH:+:$LIBPATH}"
     export LIBPATH
     ;;
 esac
diff --git a/desktop/scripts/unoinfo-mac.sh b/desktop/scripts/unoinfo-mac.sh
index 3c482fc..ca15291 100755
--- a/desktop/scripts/unoinfo-mac.sh
+++ b/desktop/scripts/unoinfo-mac.sh
@@ -20,7 +20,7 @@
 set -e
 
 # resolve installation directory
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
     cd "`dirname "$sd_res"`"
     sd_basename=`basename "$sd_res"`
@@ -29,7 +29,7 @@ done
 cd "`dirname "$sd_res"`"
 sd_prog=`pwd`
 
-case $1 in
+case "$1" in
 c++)
     printf '%s' "$sd_prog/../Frameworks"
     ;;
diff --git a/desktop/scripts/unoinfo.sh b/desktop/scripts/unoinfo.sh
index 464d1b8..bf5b14f 100755
--- a/desktop/scripts/unoinfo.sh
+++ b/desktop/scripts/unoinfo.sh
@@ -20,7 +20,7 @@
 set -e
 
 # resolve installation directory
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
     cd "`dirname "$sd_res"`"
     sd_basename=`basename "$sd_res"`
@@ -29,7 +29,7 @@ done
 cd "`dirname "$sd_res"`"
 sd_prog=`pwd`
 
-case $1 in
+case "$1" in
 c++)
     printf '%s' "$sd_prog"
     ;;
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index f21e4d1..a9d43bf 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -23,7 +23,7 @@ export SAL_ENABLE_FILE_LOCKING
 
 # resolve installation directory
 sd_cwd=`pwd`
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
     cd "`dirname "$sd_res"`"
     sd_basename=`basename "$sd_res"`
@@ -36,7 +36,7 @@ cd "$sd_cwd"
 # this is a temporary hack until we can live with the default search paths
 case "`uname -s`" in
 NetBSD|OpenBSD|FreeBSD|DragonFly)
-    LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+    LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
     JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
     export LD_LIBRARY_PATH
     if [ -n "${JAVA_HOME}" ]; then
@@ -44,7 +44,7 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
     fi
     ;;
 AIX)
-    LIBPATH=$sd_prog${LIBPATH:+:${LIBPATH}}
+    LIBPATH="$sd_prog${LIBPATH:+:${LIBPATH}}"
     export LIBPATH
     ;;
 esac
@@ -61,18 +61,18 @@ do
 done
 
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
-if [ -x "$sd_prog/javaldx" ] ; then
-    my_path=`"$sd_prog/javaldx" $BOOTSTRAPVARS \
+if [ -x "${sd_prog}/javaldx" ] ; then
+    my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
         "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
     if [ -n "$my_path" ] ; then
         sd_platform=`uname -s`
-        case $sd_platform in
+        case "$sd_platform" in
           AIX)
-            LIBPATH=$my_path${LIBPATH:+:$LIBPATH}
+            LIBPATH="$my_path${LIBPATH:+:$LIBPATH}"
             export LIBPATH
             ;;
           *)
-            LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+            LD_LIBRARY_PATH="$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
             export LD_LIBRARY_PATH
             ;;
         esac


More information about the Libreoffice-commits mailing list