Group removal of orphaned packages.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Mon, 13 Feb 2012 12:07:13 +0000 (13:07 +0100)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Mon, 13 Feb 2012 12:07:13 +0000 (13:07 +0100)
src/functions.sh

index f85117d..209d79a 100644 (file)
@@ -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