Merge branch 'maintscripts-no-oldoldstable' into 'master'

d/initramfs-tools.maintscripts: Remove code for ancient versions

See merge request kernel-team/initramfs-tools!65
This commit is contained in:
Ben Hutchings 2023-08-20 20:51:58 +00:00
commit cf964bfb43
5 changed files with 0 additions and 148 deletions

View File

@ -7,39 +7,6 @@ if [ ! -e /etc/initramfs-tools/modules ]; then
> /etc/initramfs-tools/modules
fi
mvverbose=-v
# from dpkg-maintscript-helper, modified
ensure_package_owns_file() {
local PACKAGE="$1"
local FILE="$2"
dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"
}
# from dpkg-maintscript-helper, modified
finish_mv_conffile() {
local CONFFILE="$1"
local PACKAGE="$2"
rm $mvverbose -f "$CONFFILE.dpkg-remove"
[ -e "$CONFFILE.dpkg-backup" ] || return 0
ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
echo "Preserving user changes to $CONFFILE (now owned by $PACKAGE)..."
if [ -e "$CONFFILE" ]; then
mv $mvverbose -f "$CONFFILE" "$CONFFILE.dpkg-new"
fi
mv $mvverbose -f "$CONFFILE.dpkg-backup" "$CONFFILE"
}
# When installing as a new dependency of initramfs-tools, or upgrading
# from <0.123, we need to move initramfs.conf back into place.
if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.123~; then
finish_mv_conffile /etc/initramfs-tools/initramfs.conf initramfs-tools-core
fi
# Remove obsolete state directory
if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.138~; then
rm -rf /var/lib/initramfs-tools

View File

@ -1,2 +0,0 @@
rm_conffile /etc/bash_completion.d/initramfs-tools 0.126~
rm_conffile /etc/kernel/signed_postinst.d/initramfs-tools 0.126~

View File

@ -2,39 +2,6 @@
set -e
mvverbose=-v
# from dpkg-maintscript-helper, modified
ensure_package_owns_file() {
local PACKAGE="$1"
local FILE="$2"
dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"
}
# from dpkg-maintscript-helper, modified
finish_mv_conffile() {
local CONFFILE="$1"
local PACKAGE="$2"
rm $mvverbose -f "$CONFFILE.dpkg-remove"
[ -e "$CONFFILE.dpkg-backup" ] || return 0
ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
echo "Preserving user changes to $CONFFILE (now owned by $PACKAGE)..."
if [ -e "$CONFFILE" ]; then
mv $mvverbose -f "$CONFFILE" "$CONFFILE.dpkg-new"
fi
mv $mvverbose -f "$CONFFILE.dpkg-backup" "$CONFFILE"
}
# If initramfs-tools-core was fully upgraded to 0.123 before our
# preinst ran, we need to move initramfs.conf back into place.
if [ "$1" = configure ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt 0.123~; then
finish_mv_conffile /etc/initramfs-tools/initramfs.conf initramfs-tools-core
fi
# Regenerate initramfs whenever we go to dpkg state `installed'
if [ "x$1" != xtriggered ]; then
# this activates the trigger, if triggers are working

View File

@ -1,38 +0,0 @@
#!/bin/sh
set -e
mvverbose=-v
# from dpkg-maintscript-helper, modified
ensure_package_owns_file() {
local PACKAGE="$1"
local FILE="$2"
dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"
}
# from dpkg-maintscript-helper
abort_rm_conffile() {
local CONFFILE="$1"
local PACKAGE="$2"
ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
if [ -e "$CONFFILE.dpkg-remove" ]; then
echo "Reinstalling $CONFFILE that was moved away"
mv $mvverbose "$CONFFILE.dpkg-remove" "$CONFFILE"
fi
if [ -e "$CONFFILE.dpkg-backup" ]; then
echo "Reinstalling $CONFFILE that was backupped"
mv $mvverbose "$CONFFILE.dpkg-backup" "$CONFFILE"
fi
}
# If aborting an upgrade from <0.123, we need to move initramfs.conf back
# into place.
if [ "$1" = abort-upgrade ] && dpkg --compare-versions "$2" lt 0.123~; then
abort_rm_conffile /etc/initramfs-tools/initramfs.conf initramfs-tools
fi
#DEBHELPER#

View File

@ -1,42 +0,0 @@
#!/bin/sh
set -e
mvverbose=-v
# from dpkg-maintscript-helper, modified
ensure_package_owns_file() {
local PACKAGE="$1"
local FILE="$2"
dpkg-query -L "$PACKAGE" | grep -F -q -x "$FILE"
}
# from dpkg-maintscript-helper
prepare_rm_conffile() {
local CONFFILE="$1"
local PACKAGE="$2"
[ -e "$CONFFILE" ] || return 0
ensure_package_owns_file "$PACKAGE" "$CONFFILE" || return 0
local md5sum old_md5sum
md5sum="$(md5sum "$CONFFILE" | sed -e 's/ .*//')"
old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$PACKAGE" | \
sed -n -e "\\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
if [ "$md5sum" != "$old_md5sum" ]; then
mv $mvverbose -f "$CONFFILE" "$CONFFILE.dpkg-backup"
else
mv $mvverbose -f "$CONFFILE" "$CONFFILE.dpkg-remove"
fi
}
# When upgrading from <0.123, we need to move initramfs.conf away so
# dpkg will stop remembering it as an 'obsolete' conffile for us. The
# postinst of either initramfs-tools or initramfs-tools-core will move
# it back.
if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 0.123~; then
prepare_rm_conffile /etc/initramfs-tools/initramfs.conf initramfs-tools
fi
#DEBHELPER#