From 225e91339e9f16cf7e96c3be59d41c3d2927d2f1 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Mon, 13 Feb 2012 13:07:13 +0100 Subject: [PATCH] Group removal of orphaned packages. --- src/functions.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 1.7.10.4