From: Valentin Vidic Date: Thu, 9 Feb 2012 09:11:54 +0000 (+0100) Subject: Cleanup dpkg available file. X-Git-Tag: debian/6.0.3~7 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=1e7fccdeae88ff8dd143dd1c38083f8c5fcce67b;p=carnet-upgrade.git Cleanup dpkg available file. --- diff --git a/src/actions/main.queue b/src/actions/main.queue index c087301..12aea51 100644 --- a/src/actions/main.queue +++ b/src/actions/main.queue @@ -17,6 +17,7 @@ pkg slapd backup_slapd_db true backup_etc_dir # etc i drugo true create_sources_list true apt_update +true cleanup_available true check_archives_space true check_kernel_space true apt_download # skini pakete diff --git a/src/functions.sh b/src/functions.sh index fa0406b..83fc87d 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -128,6 +128,21 @@ apt_autoremove () { } } +# remove stale package information from available +# warning, in file '/var/lib/dpkg/available' +# near line 58185 package 'vim-cn': missing architecture +cleanup_available () { + log "Cleaning dpkg available file" + + available=$(mktemp /var/lib/carnet-upgrade/available.XXXXXX) + apt-cache dumpavail > $available + + dpkg --clear-avail + dpkg --update-avail $available + + rm -f $available +} + remove_x() { LC_MESSAGES=hr_HR dialog --backtitle "$title" --yesno "$msg_remove_x" 18 75 if [ $? -eq 0 ]; then