From: Valentin Vidic Date: Mon, 13 Feb 2012 12:07:13 +0000 (+0100) Subject: Group removal of orphaned packages. X-Git-Tag: debian/6.0.3~3 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=carnet-upgrade.git;a=commitdiff_plain;h=225e91339e9f16cf7e96c3be59d41c3d2927d2f1 Group removal of orphaned packages. --- diff --git a/src/functions.sh b/src/functions.sh index f85117d..209d79a 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -828,15 +828,20 @@ is_orphaned () { # remove old and unused libraries remove_orphaned () { - local package + local package remove apt_autoremove + remove= for package in $orphaned_packages; do if is_orphaned $package; then - pkgrm $package + remove="$remove $package" fi done + + if [ "$remove" ]; then + pkgrm $remove + fi } # monit it causing problems for postinst scripts