diff --git a/debian/clean b/debian/clean deleted file mode 100644 index 4586283..0000000 --- a/debian/clean +++ /dev/null @@ -1 +0,0 @@ -debian/dash.templates diff --git a/debian/control b/debian/control index f97039d..474b251 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,7 @@ Architecture: any Multi-Arch: foreign Essential: yes Priority: required -Pre-Depends: ${shlibs:Depends} +Pre-Depends: ${shlibs:Depends}, debconf Depends: debianutils (>= 5.6-0.1), ${misc:Depends}, diff --git a/debian/dash.preinst b/debian/dash.preinst new file mode 100644 index 0000000..4714a2b --- /dev/null +++ b/debian/dash.preinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 0.5.12-9~; then + # Upgrading from pre-/usr-move DEP17 + truename=$(dpkg-divert --truename /bin/sh) + if [ "$truename" != /bin/sh ] && + [ "$(dpkg-divert --listpackage /bin/sh)_$truename" != "dash_/bin/sh.distrib" ] && + [ "$(dpkg-divert --truename /usr/bin/sh)" = "/usr/bin/sh" ]; then + # There is a diversion of /bin/sh and it is not our own + # diversion to /bin/sh.distrib that will be removed in + # postinst and there is no matching diversion of /usr/bin/sh. + . /usr/share/debconf/confmodule + db_input critical dash/ineffectivediversion || true + db_go || true + # We have no other debconf usage in dash, so we can purge rightaway. + db_purge || true + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/dash.templates b/debian/dash.templates new file mode 100644 index 0000000..5ac513d --- /dev/null +++ b/debian/dash.templates @@ -0,0 +1,10 @@ +Template: dash/ineffectivediversion +Type: error +_Description: /bin/sh is ineffectively diverted + A diversion of /bin/sh was found. + . + After this update, dash will be recorded in the dpkg database at its new path, /usr/bin/sh. Since there is no diversion set for /usr/bin/sh, the existing diversion for /bin/sh will no longer work. + . + To keep using your preferred default shell, you need to set up another diversion for /usr/bin/sh. If you don’t do so now, your changes to /bin/sh will be lost after this upgrade. + . + Once the upgrade is complete, the diversion for /bin/sh will no longer be needed and can be removed. diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 0000000..48a60ab --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1,2 @@ +[encoding: UTF-8] +[type: gettext/rfc822deb] dash.templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..38a4db5 --- /dev/null +++ b/debian/po/templates.pot @@ -0,0 +1,55 @@ +# debconf templates for dash +# Copyright (C) 2024 Debian dash maintainers +# This file is distributed under the same license as the dash package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: dash\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2025-01-03 14:21+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: error +#. Description +#: ../dash.templates:1001 +msgid "/bin/sh is ineffectively diverted" +msgstr "" + +#. Type: error +#. Description +#: ../dash.templates:1001 +msgid "A diversion of /bin/sh was found." +msgstr "" + +#. Type: error +#. Description +#: ../dash.templates:1001 +msgid "" +"After this update, dash will be recorded in the dpkg database at its new " +"path, /usr/bin/sh. Since there is no diversion set for /usr/bin/sh, the " +"existing diversion for /bin/sh will no longer work." +msgstr "" + +#. Type: error +#. Description +#: ../dash.templates:1001 +msgid "" +"To keep using your preferred default shell, you need to set up another " +"diversion for /usr/bin/sh. If you don’t do so now, your changes to /bin/sh " +"will be lost after this upgrade." +msgstr "" + +#. Type: error +#. Description +#: ../dash.templates:1001 +msgid "" +"Once the upgrade is complete, the diversion for /bin/sh will no longer be " +"needed and can be removed." +msgstr ""