[Libreoffice-commits] core.git: solenv/bin sysui/desktop

Muhammet Kara muhammet.kara at pardus.org.tr
Wed Jan 4 15:42:29 UTC 2017


 solenv/bin/bin_library_info.sh  |    2 +-
 sysui/desktop/share/apparmor.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 801e8041438636f264d8d11aa2b6f088fab3d073
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Wed Dec 28 17:43:29 2016 +0300

    Remove useless cat, and replace backtick
    
    cat is a tool for con"cat"enating files. Reading a single file
    as input to a program is considered a Useless Use Of Cat (UUOC).
    It's more efficient and less roundabout to simply give file as input.
    
    Also use $(..) instead of legacy `..`
    Backtick command substitution `..` is legacy syntax with several issues.
    It has a series of undefined behaviors related to quoting in POSIX.
    It imposes a custom escaping mode with surprising results.
    It's exceptionally hard to nest.
    $(..) command substitution has none of these problems, and is therefore strongly encouraged.
    
    Change-Id: Ia668c6323660641bbb5084ee824ae9ae7631c76f
    Reviewed-on: https://gerrit.libreoffice.org/32473
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/solenv/bin/bin_library_info.sh b/solenv/bin/bin_library_info.sh
index 88925bf..94bc262 100755
--- a/solenv/bin/bin_library_info.sh
+++ b/solenv/bin/bin_library_info.sh
@@ -34,7 +34,7 @@ die()
 get_config_sha()
 {
     pushd ${SRCDIR?} > /dev/null
-    cat ${BUILDDIR?}/config_host.mk | git hash-object --stdin
+    git hash-object ${BUILDDIR?}/config_host.mk
     popd > /dev/null
 }
 
diff --git a/sysui/desktop/share/apparmor.sh b/sysui/desktop/share/apparmor.sh
index 4a91310..59803e1 100755
--- a/sysui/desktop/share/apparmor.sh
+++ b/sysui/desktop/share/apparmor.sh
@@ -37,10 +37,10 @@ INST_ROOT_FORMAT=${INST_ROOT_FORMAT////.}
 #Need to escape / for sed
 INST_ROOT_SED=${INST_ROOT////\\/}
 
-for filename in `ls $PROFILESFROM`
+for filename in $(ls $PROFILESFROM)
 do
     tourl=$INSTALLTO$INST_ROOT_FORMAT$filename
-    cat $PROFILESFROM$filename | sed "s/INSTDIR-/$INST_ROOT_SED/g" > $tourl
+    sed "s/INSTDIR-/$INST_ROOT_SED/g" $PROFILESFROM$filename > $tourl
     echo "$tourl"
 
 done


More information about the Libreoffice-commits mailing list