From 96be9823506f5d02e6961813746cacea38fc7f203ee58a65853aaee1ed7672c7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Oct 2014 15:40:10 +0000 Subject: [PATCH] Do quoting over the place OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-filesystem?expand=0&rev=78 --- mingw64-install-post.sh | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/mingw64-install-post.sh b/mingw64-install-post.sh index 78418a3..6cee007 100644 --- a/mingw64-install-post.sh +++ b/mingw64-install-post.sh @@ -12,40 +12,36 @@ LC_ALL= LANG= LC_TIME=POSIX -cd $RPM_BUILD_ROOT +cd "$RPM_BUILD_ROOT" [ -z "$STRIP" ] && STRIP=x86_64-w64-mingw32-strip for f in `find . -type f -name "*.exe" -or -name "*.dll"`; do - case $(x86_64-w64-mingw32-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in + case $(x86_64-w64-mingw32-objdump -h "$f" 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in *debuglink*) continue ;; *debug*) ;; *gnu.version*) - echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!" + echo "WARNING: "`echo "$f" | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!" continue ;; *) continue ;; esac - $STRIP --strip-unneeded $f; -done -for f in `find . -type f -name "*.a"`; do - chmod -x $f; -done -for f in `find . -name "*.la"`; do - rm -f $f; + "$STRIP" --strip-unneeded "$f" done +find . -type f -name "*.a" -exec chmod -x "{}" "+" +find . -type f -name "*.la" -delete if [ -d "$RPM_BUILD_ROOT/usr/x86_64-w64-mingw32/sys-root/mingw/share/man" ]; then - pushd $RPM_BUILD_ROOT/usr/x86_64-w64-mingw32/sys-root/mingw/share/man + pushd "$RPM_BUILD_ROOT/usr/x86_64-w64-mingw32/sys-root/mingw/share/man" for f in `find -type f`; do case "$f" in - *.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;; - *.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;; - *.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;; - *) b=$f;; + *.Z) gunzip "$f"; b=`echo "$f" | sed -e 's/\.Z$//'`;; + *.gz) gunzip "$f"; b=`echo "$f" | sed -e 's/\.gz$//'`;; + *.bz2) bunzip2 "$f"; b=`echo "$f" | sed -e 's/\.bz2$//'`;; + *) b="$f";; esac - gzip -9 -n $b + gzip -9 -n "$b" done popd fi