Blame SOURCES/redhat-rpm-config-9.1.0-java-repack-spaces-in-filenames.patch

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