make_mirror.sh: quote paths

This commit is contained in:
Johannes 'josch' Schauer 2019-02-24 11:06:57 +01:00
parent 1b18b11a86
commit c747f6ba1f
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -221,13 +221,13 @@ END
find "$rootdir" -depth -print0 | xargs -0 rmdir find "$rootdir" -depth -print0 | xargs -0 rmdir
} }
for nativearch in $arch1 $arch2; do for nativearch in "$arch1" "$arch2"; do
for dist in stable testing unstable; do for dist in stable testing unstable; do
cat << END | update_cache $dist $nativearch cat << END | update_cache "$dist" "$nativearch"
deb [arch=$nativearch] $mirror $dist $components deb [arch=$nativearch] $mirror $dist $components
END END
if [ "$dist" = "stable" ]; then if [ "$dist" = "stable" ]; then
cat << END | update_cache $dist $nativearch cat << END | update_cache "$dist" "$nativearch"
deb [arch=$nativearch] $mirror $dist $components deb [arch=$nativearch] $mirror $dist $components
deb [arch=$nativearch] $mirror stable-updates main deb [arch=$nativearch] $mirror stable-updates main
deb [arch=$nativearch] $security_mirror stable/updates main deb [arch=$nativearch] $security_mirror stable/updates main
@ -401,15 +401,15 @@ for dist in stable testing unstable; do
fi fi
done done
if [ -e $oldcachedir/debian-unstable.qcow ]; then if [ -e $oldcachedir/debian-unstable.qcow ]; then
rm --one-file-system $oldcachedir/debian-unstable.qcow rm --one-file-system "$oldcachedir/debian-unstable.qcow"
fi fi
if [ -e $oldcachedir/debian/pool/main ]; then if [ -e "$oldcachedir/debian/pool/main" ]; then
rm --one-file-system --recursive $oldcachedir/debian/pool/main rm --one-file-system --recursive "$oldcachedir/debian/pool/main"
fi fi
if [ -e $oldcachedir/debian-security/pool/updates/main ]; then if [ -e "$oldcachedir/debian-security/pool/updates/main" ]; then
rm --one-file-system --recursive $oldcachedir/debian-security/pool/updates/main rm --one-file-system --recursive "$oldcachedir/debian-security/pool/updates/main"
fi fi
# now the rest should only be empty directories # now the rest should only be empty directories
if [ -e $oldcachedir ]; then if [ -e "$oldcachedir" ]; then
find $oldcachedir -depth -print0 | xargs -0 --no-run-if-empty rmdir find "$oldcachedir" -depth -print0 | xargs -0 --no-run-if-empty rmdir
fi fi