From: Valentin Vidic Date: Fri, 30 Sep 2011 11:34:02 +0000 (+0200) Subject: Handle package cleanup. X-Git-Tag: debian/6.0.0~11 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=carnet-upgrade.git;a=commitdiff_plain;h=2c023c2132b166ffc24941cd2a7c35f182c2468e Handle package cleanup. --- 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