# HG changeset patch # User Francisco J Ballesteros # Date 1316019265 -7200 # Node ID ed29067d02325e6c28b1ab60938fc18f77412286 # Parent 74ae106c3ac573dc9e0f4a01903cc9d693760405 pm: replace root.tgz with a .lst file install tars t into a .lst file remove uses that file (or the .tgz if any) clean and depclean are gone R=nix-dev, john CC=nix-dev http://codereview.appspot.com/5018042 diff -r 74ae106c3ac5 -r ed29067d0232 rc/bin/pm/remove --- a/rc/bin/pm/remove Wed Sep 14 18:46:17 2011 +0200 +++ b/rc/bin/pm/remove Wed Sep 14 18:54:25 2011 +0200 @@ -36,25 +36,22 @@ if not { grep -v '^'^$PKGNAME^'$' $ROOT^/contrib/packages/installed> /tmp/installed-removed cp /tmp/installed-removed $ROOT^/contrib/packages/installed - # ignore directories, remove regular files first - echo -n $PKGNAME^: Removing regular files. - echo may take a while. be patient. - for (i in `{awk '!/ - 20000000/{print $1}' < db}) { - #echo rm -f $ROOT^/^$i - rm -f $ROOT^/^$i + + rms=() + files='' + if(test -e root.tgz) + files=`{tar ztf root.tgz} + if not + files=`{cat root.lst} + for(f in $files){ + rms=($f $rms) } - - echo - - # remove empty directories only - # we have to reverse the file first, that's what the first sed is doing - dirs=`{awk '/ - 20000000/{print $1}' db | sed '1!G;h;$!d'} - echo $PKGNAME^: Removing directories - for (i in $dirs) { - if (test -e $ROOT^/^$i && ~ `{ls $ROOT^/^$i} '') { - #echo rm -rf $ROOT^/$i - rm -rf $ROOT^/^$i - } + for(f in $rms){ + if(~ $ROOT /) + echo rm -f $f + if not + echo rm -f $ROOT$f + rm -f $ROOT$f } } }