|
|
eaaa62 |
Index: redhat-rpm-config-9.1.0/brp-java-repack-jars
|
|
|
eaaa62 |
===================================================================
|
|
|
eaaa62 |
--- redhat-rpm-config-9.1.0.orig/brp-java-repack-jars
|
|
|
eaaa62 |
+++ redhat-rpm-config-9.1.0/brp-java-repack-jars
|
|
|
eaaa62 |
@@ -25,17 +25,19 @@ if [ ! -z "$JARS" ]; then
|
|
|
eaaa62 |
|
|
|
eaaa62 |
# unpack every jar, set the date of the files and directories and
|
|
|
eaaa62 |
# repack the jar
|
|
|
eaaa62 |
+ OLD_IFS="$IFS"
|
|
|
eaaa62 |
+ IFS=$(printf '\n\t')
|
|
|
eaaa62 |
for j in $JARS ; do
|
|
|
eaaa62 |
- JARNAME=`basename $j`
|
|
|
eaaa62 |
- JTMPDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp $JARNAME.tmpdir.XXXXXXXXXX` || exit 1
|
|
|
eaaa62 |
- JARDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp $JARNAME.jardir.XXXXXXXXXX` || exit 1
|
|
|
eaaa62 |
- TIMEREF=`mktemp -p $RPM_BUILD_ROOT/tmp $JARNAME.timeref.XXXXXXXXXX` || exit 1
|
|
|
eaaa62 |
+ JARNAME=`basename "$j"`
|
|
|
eaaa62 |
+ JTMPDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp "$JARNAME.tmpdir.XXXXXXXXXX"` || exit 1
|
|
|
eaaa62 |
+ JARDIR=`mktemp -d -p $RPM_BUILD_ROOT/tmp "$JARNAME.jardir.XXXXXXXXXX"` || exit 1
|
|
|
eaaa62 |
+ TIMEREF=`mktemp -p $RPM_BUILD_ROOT/tmp "$JARNAME.timeref.XXXXXXXXXX"` || exit 1
|
|
|
eaaa62 |
|
|
|
eaaa62 |
- pushd $JTMPDIR > /dev/null
|
|
|
eaaa62 |
- /usr/bin/unzip -qq -o $j
|
|
|
eaaa62 |
+ pushd "$JTMPDIR" > /dev/null
|
|
|
eaaa62 |
+ /usr/bin/unzip -qq -o "$j"
|
|
|
eaaa62 |
find -type d -exec chmod a+rx {} \;
|
|
|
eaaa62 |
find -type f -exec chmod a+r {} \;
|
|
|
eaaa62 |
- rm -f $j
|
|
|
eaaa62 |
+ rm -f "$j"
|
|
|
eaaa62 |
|
|
|
eaaa62 |
# Create the directories first.
|
|
|
eaaa62 |
find -type d | LC_ALL=C sort | while read d; do
|
|
|
eaaa62 |
@@ -76,24 +78,25 @@ if [ ! -z "$JARS" ]; then
|
|
|
eaaa62 |
done
|
|
|
eaaa62 |
|
|
|
eaaa62 |
# make the jar
|
|
|
eaaa62 |
- pushd $JARDIR > /dev/null
|
|
|
eaaa62 |
+ pushd "$JARDIR" > /dev/null
|
|
|
eaaa62 |
|
|
|
eaaa62 |
if [ -n "`find -not -name '.'`" ]; then
|
|
|
eaaa62 |
if [ -e META-INF/MANIFEST.MF ]; then
|
|
|
eaaa62 |
- /usr/bin/zip -q -X -9 $j META-INF/MANIFEST.MF
|
|
|
eaaa62 |
+ /usr/bin/zip -q -X -9 "$j" META-INF/MANIFEST.MF
|
|
|
eaaa62 |
fi
|
|
|
eaaa62 |
- find * -not -name '.' | LC_ALL=C sort | /usr/bin/zip -u -q -X -9 $j -@
|
|
|
eaaa62 |
+ find * -not -name '.' | LC_ALL=C sort | /usr/bin/zip -u -q -X -9 "$j" -@
|
|
|
eaaa62 |
else
|
|
|
eaaa62 |
# Put the empty jar back
|
|
|
eaaa62 |
- touch $j
|
|
|
eaaa62 |
+ touch "$j"
|
|
|
eaaa62 |
fi
|
|
|
eaaa62 |
popd > /dev/null
|
|
|
eaaa62 |
|
|
|
eaaa62 |
# Cleanup.
|
|
|
eaaa62 |
- rm -rf $JTMPDIR
|
|
|
eaaa62 |
- rm -rf $JARDIR
|
|
|
eaaa62 |
- rm -f $TIMEREF
|
|
|
eaaa62 |
+ rm -rf "$JTMPDIR"
|
|
|
eaaa62 |
+ rm -rf "$JARDIR"
|
|
|
eaaa62 |
+ rm -f "$TIMEREF"
|
|
|
eaaa62 |
done
|
|
|
eaaa62 |
+ IFS="$OLD_IFS"
|
|
|
eaaa62 |
|
|
|
eaaa62 |
# remove $RPM_BUILD_ROOT/tmp if we created it
|
|
|
eaaa62 |
if [ $rmtmp -eq 1 ]; then
|