From 2c023c2132b166ffc24941cd2a7c35f182c2468e Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Fri, 30 Sep 2011 13:34:02 +0200 Subject: [PATCH] Handle package cleanup. --- src/data.sh | 6 +++++- src/functions.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/data.sh b/src/data.sh index cc05ba6..fe7114a 100644 --- a/src/data.sh +++ b/src/data.sh @@ -112,8 +112,12 @@ xinetd-cn xinetd # simulate deborphan orphaned_packages=' -libsnmp9 libsensors3 +diff +libcompress-zlib-perl +dhcp3-client +dhcp3-common +mktemp ' # new packages to be installed diff --git a/src/functions.sh b/src/functions.sh index 79c2bfd..5ea115d 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -159,6 +159,14 @@ dist_upgrade () { } } +apt_autoremove () { + log "Running autoremove ..." + apt-get -y$s --purge autoremove || { + dpkg --configure -a + apt-get -yf install + } +} + remove_x() { LC_MESSAGES=hr_HR dialog --backtitle "$title" --yesno "$msg_remove_x" 18 75 if [ $? -eq 0 ]; then @@ -971,6 +979,8 @@ is_orphaned () { remove_orphaned () { local package + apt_autoremove + for package in $orphaned_packages; do if is_orphaned $package; then pkgrm $package -- 1.7.10.4