diff --git a/debian/initramfs-tools-core.postinst b/debian/initramfs-tools-core.postinst index c4d7b75..3fe757d 100644 --- a/debian/initramfs-tools-core.postinst +++ b/debian/initramfs-tools-core.postinst @@ -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 diff --git a/debian/initramfs-tools.maintscript b/debian/initramfs-tools.maintscript deleted file mode 100644 index d79ab79..0000000 --- a/debian/initramfs-tools.maintscript +++ /dev/null @@ -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~ diff --git a/debian/initramfs-tools.postinst b/debian/initramfs-tools.postinst index 4e35c79..7b7a789 100644 --- a/debian/initramfs-tools.postinst +++ b/debian/initramfs-tools.postinst @@ -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 diff --git a/debian/initramfs-tools.postrm b/debian/initramfs-tools.postrm deleted file mode 100755 index 69f1dca..0000000 --- a/debian/initramfs-tools.postrm +++ /dev/null @@ -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# diff --git a/debian/initramfs-tools.preinst b/debian/initramfs-tools.preinst deleted file mode 100755 index 3084c4a..0000000 --- a/debian/initramfs-tools.preinst +++ /dev/null @@ -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#