base-files: improved vkpurge for kernel-snapshot pkgs.

This commit is contained in:
Juan RP 2011-11-08 08:18:09 +01:00
parent 56d421a0a5
commit c72ccd5015
2 changed files with 10 additions and 4 deletions

View File

@ -23,13 +23,14 @@ _EOF
list_kernels()
{
local k kpkg installed kver skip
local k kpkg installed kver kvertmp skip
for k in /var/lib/initramfs-tools/*; do
kver=$(basename $k|sed -e 's|-rc|rc|')
kver=$(basename $k)
kvertmp=$(basename $k|sed -e 's|-rc|rc|')
for kpkg in kernel kernel-snapshot; do
installed=$(xbps-uhelper -r / version $kpkg)
if [ "$installed" = "$kver" ]; then
if [ "$installed" = "$kvertmp" ]; then
skip=1
break
fi
@ -87,6 +88,11 @@ remove_kernel()
fi
# Execute post-remove kernel hooks.
run_hooks post-remove $rmkver
# Make sure there are no stale files.
if [ -f /var/lib/initramfs-tools/${rmkver} ]; then
rm -f /var/lib/initramfs-tools/${rmkver}
fi
}
if [ "$1" = "list" ]; then

View File

@ -1,6 +1,6 @@
# Template file for 'base-files'
pkgname=base-files
version=0.55
version=0.56
short_desc="Void GNU/Linux base system files"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://code.google.com/p/xbps"