summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJeff Tickle <jeff@jefftickle.com>2011-09-06 09:52:19 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-09-06 09:52:19 +0300
commit31d807ffa8cdf91addf7c39fdf9abf6c61d77944 (patch)
tree074dd4f037094a09927a08519f1369531304be5e /scripts
parent4fbf565ac0a603e204d79c0c8b19a96dc781f844 (diff)
downloadlibrpm-tizen-31d807ffa8cdf91addf7c39fdf9abf6c61d77944.tar.gz
librpm-tizen-31d807ffa8cdf91addf7c39fdf9abf6c61d77944.tar.bz2
librpm-tizen-31d807ffa8cdf91addf7c39fdf9abf6c61d77944.zip
$RPM_BUILD_ROOT breaks brp-* scripts if it contains spaces (ticket #843)
- This patch adds quotes around $RPM_BUILD_ROOT in places that I noticed they were missing, and attempts to handle some of the problems that can occur when looping over the output of find. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/brp-compress2
-rw-r--r--scripts/brp-java-gcjcompile7
-rw-r--r--scripts/brp-python-bytecompile4
-rwxr-xr-xscripts/brp-strip2
-rwxr-xr-xscripts/brp-strip-comment-note2
-rw-r--r--scripts/brp-strip-shared2
-rwxr-xr-xscripts/brp-strip-static-archive2
-rwxr-xr-xscripts/check-files2
-rw-r--r--scripts/find-debuginfo.sh2
-rwxr-xr-xscripts/find-lang.sh18
10 files changed, 22 insertions, 21 deletions
diff --git a/scripts/brp-compress b/scripts/brp-compress
index 1e8772d8d..247779e3c 100755
--- a/scripts/brp-compress
+++ b/scripts/brp-compress
@@ -5,7 +5,7 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
-cd $RPM_BUILD_ROOT
+cd "$RPM_BUILD_ROOT"
# Compress man pages
COMPRESS="gzip -9 -n"
diff --git a/scripts/brp-java-gcjcompile b/scripts/brp-java-gcjcompile
index 708a64952..ec9b93a93 100644
--- a/scripts/brp-java-gcjcompile
+++ b/scripts/brp-java-gcjcompile
@@ -17,12 +17,13 @@ cflags="$RPM_OPT_FLAGS -fPIC -findirect-dispatch"
ldflags="-Wl,-Bsymbolic"
# XXX make it so you can override the list, for mx4j et al.
-for jar in `find $RPM_BUILD_ROOT -type f -name "*.?ar"`; do
+find "$RPM_BUILD_ROOT" -type f -name "*.?ar" | while read jar ; do
[ `head -c 2 "$jar"` != "PK" ] && continue
[ -d "$RPM_BUILD_ROOT/$libdir" ] || mkdir -p "$RPM_BUILD_ROOT/$libdir"
- lib="$libdir/lib`basename $jar`.so"
+ bnjar=`basename "$jar"`
+ lib="$libdir/lib$bnjar.so"
[ -f "$RPM_BUILD_ROOT/$lib" ] && continue
# XXX need splits to handle #158308
@@ -32,7 +33,7 @@ for jar in `find $RPM_BUILD_ROOT -type f -name "*.?ar"`; do
[ -d "$RPM_BUILD_ROOT/$dbdir" ] || mkdir -p "$RPM_BUILD_ROOT/$dbdir"
- db="$dbdir/`basename $jar`.db"
+ db="$dbdir/$bnjar.db"
[ -f "$RPM_BUILD_ROOT/$db" ] && exit 1
$gcj-dbtool -n "$RPM_BUILD_ROOT/$db" 64
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
index 79996ea8f..4412eced4 100644
--- a/scripts/brp-python-bytecompile
+++ b/scripts/brp-python-bytecompile
@@ -14,7 +14,7 @@ fi
# Figure out how deep we need to descend. We could pick an insanely high
# number and hope it's enough, but somewhere, somebody's sure to run into it.
-depth=`(find $RPM_BUILD_ROOT -type f -name "*.py" -print0 ; echo /) | \
+depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \
xargs -0 -n 1 dirname | sed 's,[^/],,g' | sort -u | tail -n 1 | wc -c`
if [ -z "$depth" -o "$depth" -le "1" ]; then
exit 0
@@ -34,7 +34,7 @@ fi
# and below /usr/lib/python3.1/, we're targetting /usr/bin/python3.1
shopt -s nullglob
-for python_libdir in $RPM_BUILD_ROOT/usr/lib{,64}/python[0-9].[0-9]/ ;
+for python_libdir in "$RPM_BUILD_ROOT/usr/lib{,64}/python[0-9].[0-9]/" ;
do
python_binary=/usr/bin/$(basename $python_libdir)
real_libdir=${python_libdir/$RPM_BUILD_ROOT/}
diff --git a/scripts/brp-strip b/scripts/brp-strip
index 8acc22fab..2e99d1e6d 100755
--- a/scripts/brp-strip
+++ b/scripts/brp-strip
@@ -12,7 +12,7 @@ Darwin*) exit 0 ;;
esac
# Strip ELF binaries
-for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep -v ' shared object,' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
diff --git a/scripts/brp-strip-comment-note b/scripts/brp-strip-comment-note
index 90cd2ae6c..323c0410a 100755
--- a/scripts/brp-strip-comment-note
+++ b/scripts/brp-strip-comment-note
@@ -14,7 +14,7 @@ esac
# Strip .comment and .note sections (the latter only if it is not allocated)
# for already stripped elf files in the build root
-for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
note="-R .note"
diff --git a/scripts/brp-strip-shared b/scripts/brp-strip-shared
index da46431b3..e06ee4bf4 100644
--- a/scripts/brp-strip-shared
+++ b/scripts/brp-strip-shared
@@ -17,7 +17,7 @@ esac
# Strip ELF shared objects
# Please note we don't restrict our search to executable files because
# our libraries are not (should not be, at least) +x.
-for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \
+for f in `find "$RPM_BUILD_ROOT" -type f -a -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep ' shared object,' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
diff --git a/scripts/brp-strip-static-archive b/scripts/brp-strip-static-archive
index d7bff332e..ddd3b2422 100755
--- a/scripts/brp-strip-static-archive
+++ b/scripts/brp-strip-static-archive
@@ -12,7 +12,7 @@ Darwin*) exit 0 ;;
esac
# Strip static libraries.
-for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \
+for f in `find "$RPM_BUILD_ROOT" -type f -a -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
grep 'current ar archive' | \
sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p'`; do
diff --git a/scripts/check-files b/scripts/check-files
index b397f1cdb..cbdf740bd 100755
--- a/scripts/check-files
+++ b/scripts/check-files
@@ -17,7 +17,7 @@ fi
FILES_DISK=`mktemp $TMPDIR/rpmXXXXXX`
FILES_RPM=`mktemp $TMPDIR/rpmXXXXXX`
-find $RPM_BUILD_ROOT -type f -o -type l | LC_ALL=C sort > $FILES_DISK
+find "$RPM_BUILD_ROOT" -type f -o -type l | LC_ALL=C sort > $FILES_DISK
LC_ALL=C sort > $FILES_RPM
diff -d "$FILES_DISK" "$FILES_RPM" | grep "^< " | cut -c3- |
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 505dbde44..9f5fdd047 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -243,7 +243,7 @@ done || exit
# For each symlink whose target has a .debug file,
# make a .debug symlink to that file.
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*" -type l -print |
+find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
while read f
do
t=$(readlink -m "$f").debug
diff --git a/scripts/find-lang.sh b/scripts/find-lang.sh
index c3dbdbe64..56ed5bd03 100755
--- a/scripts/find-lang.sh
+++ b/scripts/find-lang.sh
@@ -97,7 +97,7 @@ while test $# -gt 0 ; do
esac
done
-find $TOP_DIR -type f -o -type l|sed '
+find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
@@ -105,7 +105,7 @@ s:^\([^%].*\)::
s:%lang(C) ::
/^$/d' > $MO_NAME
-find $TOP_DIR -type d|sed '
+find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
@@ -118,14 +118,14 @@ s:^\([^%].*\)::
s:%lang(C) ::
/^$/d' >> $MO_NAME
-find $TOP_DIR -type d|sed '
+find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
/^$/d' >> $MO_NAME
-find $TOP_DIR -type f|sed '
+find "$TOP_DIR" -type f|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
@@ -135,7 +135,7 @@ s:%lang(C) ::
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
-find $TOP_DIR$KDE3_HTML -type d|sed '
+find "$TOP_DIR$KDE3_HTML" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:
@@ -148,7 +148,7 @@ fi
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
if [ x"$KDE4_HTML" != x -a -d "$TOP_DIR$KDE4_HTML" ]; then
-find $TOP_DIR$KDE4_HTML -type d|sed '
+find "$TOP_DIR$KDE4_HTML" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
'"$NO_ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:
@@ -159,7 +159,7 @@ s:%lang(C) ::
/^$/d' >> $MO_NAME
fi
-find $TOP_DIR -type f -o -type l|sed '
+find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$QT"'s:\(.*/'"$NAME"'_\([a-zA-Z]\{2\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:\(.*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
@@ -170,7 +170,7 @@ s:^[^%].*::
s:%lang(C) ::
/^$/d' >> $MO_NAME
-find $TOP_DIR -type d|sed '
+find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
@@ -178,7 +178,7 @@ s:^\([^%].*\)::
s:%lang(C) ::
/^$/d' >> $MO_NAME
-find $TOP_DIR -type f -o -type l|sed '
+find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::