Browse Source

sde-reschedule: fix no-filename case in remove_package()

stable/0.6
Alejandro Mery 11 years ago
parent
commit
83fcf61148
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      bin/sde-reschedule-package

+ 9
- 7
bin/sde-reschedule-package

@ -90,20 +90,22 @@ done
remove_package() {
local root="$1" pkg="$2"
local flist="$root/var/adm/flists/$pkg"
local tag=f=
local tag= f=
sort -r "$flist" | while read tag f; do
f="$root/$f"
if [ "$tag" != "$pkg:" ]; then
echo_warning "$pkg: invalid tag '$tag' in $flist"
elif [ -z "$f" ]; then
echo_warning "$pkg: missing filename in $flist"
elif [ -L "$f" ]; then
rm -f "$f"
elif [ -d "$f" ]; then
rmdir "$f"
else
rm -f "$f"
f="$root/$f"
if [ -L "$f" ]; then
rm -f "$f"
elif [ -d "$f" ]; then
rmdir "$f"
else
rm -f "$f"
fi
fi
done
}

Loading…
Cancel
Save