From 83fcf611488f1e73b0d4449579cc7faea33247ef Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Mon, 26 Aug 2013 11:39:20 +0200 Subject: [PATCH] sde-reschedule: fix no-filename case in remove_package() --- bin/sde-reschedule-package | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/sde-reschedule-package b/bin/sde-reschedule-package index b24003d..2dcf2f1 100755 --- a/bin/sde-reschedule-package +++ b/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 }