From 8dff29f4cd9663746b51ffad9317e68a2cd00a55 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 2 Nov 2022 10:46:56 +0100 Subject: Update /etc/shells using dpkg triggers Closes: #1023317 --- debian/control | 6 ++++-- debian/rules | 2 ++ debian/zsh-static.postinst | 3 --- debian/zsh-static.postrm | 11 ----------- debian/zsh-static.shells | 1 + debian/zsh.postinst | 3 --- debian/zsh.postrm | 3 --- debian/zsh.shells | 2 ++ 8 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 debian/zsh-static.postrm create mode 100644 debian/zsh-static.shells create mode 100644 debian/zsh.shells diff --git a/debian/control b/debian/control index c131cd9d0..042d6113e 100644 --- a/debian/control +++ b/debian/control @@ -56,7 +56,8 @@ Package: zsh Architecture: any Depends: zsh-common (= ${source:Version}), ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, + debianutils (>= 5.3-1~) Pre-Depends: ${misc:Pre-Depends} Recommends: ${shlibs:Recommends} Suggests: zsh-doc @@ -88,7 +89,8 @@ Description: zsh documentation - info/HTML format Package: zsh-static Architecture: any -Depends: ${misc:Depends} +Depends: ${misc:Depends}, + debianutils (>= 5.3-1~) Recommends: zsh-common Suggests: zsh-doc Built-Using: ${Built-Using} diff --git a/debian/rules b/debian/rules index 37eb8380e..d18d6333f 100755 --- a/debian/rules +++ b/debian/rules @@ -158,6 +158,8 @@ execute_after_dh_install-arch: xargs sed -e 's@\.\./config\.h@config.h@;s@#\(\s*\)include "\([^"]\+\)"@#\1include @' -i cd debian/zsh-dev/usr/share/aclocal; mv aczshoot.m4 zshoot.m4 + install -D -m644 debian/zsh.shells debian/zsh/usr/share/debianutils/shells.d/zsh + install -D -m644 debian/zsh-static.shells debian/zsh-static/usr/share/debianutils/shells.d/zsh-static override_dh_gencontrol-arch: dh_gencontrol -a -- -VBuilt-Using="$(BUILT_USING)" diff --git a/debian/zsh-static.postinst b/debian/zsh-static.postinst index 2d04961d3..6139e0a08 100644 --- a/debian/zsh-static.postinst +++ b/debian/zsh-static.postinst @@ -4,9 +4,6 @@ set -e case "$1" in (configure) -# if test -z "$2"; then - add-shell /bin/zsh-static -# fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/zsh-static.postrm b/debian/zsh-static.postrm deleted file mode 100644 index 6fc83e6fa..000000000 --- a/debian/zsh-static.postrm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - (remove) - remove-shell /bin/zsh-static - ;; -esac - -#DEBHELPER# diff --git a/debian/zsh-static.shells b/debian/zsh-static.shells new file mode 100644 index 000000000..304ff6abb --- /dev/null +++ b/debian/zsh-static.shells @@ -0,0 +1 @@ +/bin/zsh-static diff --git a/debian/zsh.postinst b/debian/zsh.postinst index 273d43882..03b9e8a1c 100644 --- a/debian/zsh.postinst +++ b/debian/zsh.postinst @@ -12,9 +12,6 @@ update-alternatives --remove rzsh /bin/zsh5 case "$1" in (configure) - add-shell /bin/zsh - add-shell /usr/bin/zsh - # New hardcoded symlinks which unfortunately can't be shipped inside # the package itself since some people want to merge /bin and /usr/bin # against FHS and all Unix tradition. diff --git a/debian/zsh.postrm b/debian/zsh.postrm index 5991d7e53..d9cb0582e 100644 --- a/debian/zsh.postrm +++ b/debian/zsh.postrm @@ -4,9 +4,6 @@ set -e case "$1" in (remove) - remove-shell /bin/zsh - remove-shell /usr/bin/zsh - # Remove hardcoded symlink again if [ -L /usr/bin/zsh ]; then rm -f /usr/bin/zsh diff --git a/debian/zsh.shells b/debian/zsh.shells new file mode 100644 index 000000000..de570bc0a --- /dev/null +++ b/debian/zsh.shells @@ -0,0 +1,2 @@ +/bin/zsh +/usr/bin/zsh -- cgit v1.2.3