Use quotes around rpm file names to prevent issues with spaces.

This commit is contained in:
Sam Hegarty
2013-09-15 09:42:02 +12:00
committed by Matthias Mailänder
parent 3c497e638e
commit 954b070736

View File

@@ -14,31 +14,31 @@ rootdir=`readlink -f $2`
sed -i "s|{ROOT_DIR}|$rootdir|" openra.spec
# List files to avoid owning standard dirs.
find $rootdir/usr/bin -type f -print0 | xargs -0 -n 1 echo | while read x
`find $rootdir/usr/bin -type f -print0` | xargs -0 -n 1 echo | while read x
do
y="${x#$rootdir}"
sed -i "/%files/ a ${y}" openra.spec
sed -i "/%files/ a \"${y}\"" openra.spec
done
find $rootdir/usr/share/icons -type f -print0 | xargs -0 -n 1 echo | while read x
`find $rootdir/usr/share/icons -type f -print0` | xargs -0 -n 1 echo | while read x
do
y="${x#$rootdir}"
sed -i "/%files/ a ${y}" openra.spec
sed -i "/%files/ a \"${y}\"" openra.spec
done
find $rootdir/usr/share/applications -type f -print0 | \
`find $rootdir/usr/share/applications -type f -print0` | \
xargs -0 -n 1 echo | \
while read x
do
y="${x#$rootdir}"
sed -i "/%files/ a ${y}" openra.spec
sed -i "/%files/ a \"${y}\"" openra.spec
done
# List directories only to avoid spam
find $rootdir/usr/share/openra -type d -print0 | xargs -0 -n 1 echo | while read x
`find $rootdir/usr/share/openra -type d -print0` | xargs -0 -n 1 echo | while read x
do
y="${x#$rootdir}"
sed -i "/%files/ a ${y}" openra.spec
sed -i "/%files/ a \"${y}\"" openra.spec
done
cp openra.spec "$3/SPECS/"