Bug#1004171: bash: Replace add-shell/remove-shell with declarative shells.d trigger

2022-05-12 Thread Johannes Schauer Marin Rodrigues
Hi,

Quoting Johannes Schauer Marin Rodrigues (2022-04-13 12:10:16)
> Quoting Johannes Schauer Marin Rodrigues (2022-01-22 09:25:43)
> > the attached patch replaces add-shell/remove-shell with the declarative
> > shells.d trigger from debianutils.
> > 
> > For details about this new mechanism see https://bugs.debian.org/990440.
> > 
> > This further reduces the number of maintainer scripts in the
> > Essential:yes set and is the last missing piece for DPKG_ROOT support in
> > bash.
> > 
> > I also submitted the same improvement to dash:
> > 
> > https://salsa.debian.org/debian/dash/-/merge_requests/8
> 
> the shells.d patch has been applied in dash in unstable for over a month now
> and the dash maintainer states that there have been no problems since then.
> 
> I'd thus like to send a friendly ping to this bug and ask about applying
> shells.d support from debianutils to bash as well.
> 
> If you have no objections, I can also prepare an NMU as I've done for #958083.

I've uploaded a NMU with attached debdiff to DELAYED/15.

Thanks!

cheers, joschdiff -Nru bash-5.1/debian/bash.postinst bash-5.1/debian/bash.postinst
--- bash-5.1/debian/bash.postinst	2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash.postinst	2022-05-12 17:01:36.0 +0200
@@ -14,13 +14,6 @@
 10 \
   || true
 
-if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-3 \
-&& which add-shell >/dev/null
-then
-add-shell /bin/bash
-add-shell /bin/rbash
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru bash-5.1/debian/bash.postrm bash-5.1/debian/bash.postrm
--- bash-5.1/debian/bash.postrm	2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash.postrm	1970-01-01 01:00:00.0 +0100
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
-upgrade|failed-upgrade|abort-install|abort-upgrade)
-	;;
-remove|purge|disappear)
-	if which remove-shell >/dev/null && [ -f /etc/shells ]; then
-	remove-shell /bin/bash
-	remove-shell /bin/rbash
-	fi
-	;;
-*)
-echo "postrm called with unknown argument \`$1'" >&2
-exit 1
-	;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/bash-static.postinst bash-5.1/debian/bash-static.postinst
--- bash-5.1/debian/bash-static.postinst	2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash-static.postinst	1970-01-01 01:00:00.0 +0100
@@ -1,13 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-4 \
-&& which add-shell >/dev/null
-then
-add-shell /bin/bash-static
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/bash-static.postrm bash-5.1/debian/bash-static.postrm
--- bash-5.1/debian/bash-static.postrm	2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash-static.postrm	1970-01-01 01:00:00.0 +0100
@@ -1,21 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
-upgrade|failed-upgrade|abort-install|abort-upgrade)
-	;;
-remove|purge|disappear)
-	if which remove-shell >/dev/null && [ -f /etc/shells ]; then
-	remove-shell /bin/bash-static
-	fi
-	;;
-*)
-echo "postrm called with unknown argument \`$1'" >&2
-exit 1
-	;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/changelog bash-5.1/debian/changelog
--- bash-5.1/debian/changelog	2022-01-06 17:16:52.0 +0100
+++ bash-5.1/debian/changelog	2022-05-12 17:05:40.0 +0200
@@ -1,3 +1,12 @@
+bash (5.1-6.1) unstable; urgency=medium
+
+  [ Helmut Grohne ]
+  * Non-maintainer upload.
+  * Replace add-shell/remove-shell with declarative shells.d trigger.
+Closes: #1004171
+
+ -- Johannes Schauer Marin Rodrigues   Thu, 12 May 2022 17:05:40 +0200
+
 bash (5.1-6) unstable; urgency=medium
 
   * Apply upstream patches 013 - 016.
diff -Nru bash-5.1/debian/control bash-5.1/debian/control
--- bash-5.1/debian/control	2021-11-27 09:37:56.0 +0100
+++ bash-5.1/debian/control	2022-05-12 17:01:36.0 +0200
@@ -17,7 +17,7 @@
 Architecture: any
 Multi-Arch: foreign
 Pre-Depends: ${shlibs:Pre-Depends}, ${misc:Depends}
-Depends: base-files (>= 2.1.12), debianutils (>= 2.15)
+Depends: base-files (>= 2.1.12), debianutils (>= 5.6-0.1)
 Recommends: bash-completion (>= 20060301-0)
 Conflicts: bash-completion (<< 20060301-0)
 Replaces: bash-doc (<= 2.05-1), bash-completion (<< 20060301-0)
@@ -39,7 +39,7 @@
 Package: bash-static
 Architecture: any
 Multi-Arch: foreign
-Depends: passwd (>= 1:4.0.3-10), ${misc:Depends}
+Depends: passwd (>= 1:4.0.3-10), debianutils (>= 5.6-0.1), ${misc:Depends}
 Suggests: bash-doc
 Section: shells
 Priority: optional
diff -Nru bash-5.1/debian/rules bash-5.1/debian/rules
--- bash-5.1/debian/rules	2021-11-27 09:50:18.0 +0100
+++ bash-5.1/debian/rules	2022-05-12 17:01:36.0 +0200
@@ -227,6 +227,9 @@
 	$(ID) debian/clear_console.1 $(d)/usr/share/man/man1/
 endif
 
+	: # /etc/shells integration
+	$(ID) -D debian/shells.d/bash $(d)/usr/share/debianutils/shells.d/bash
+
 	: # files for the bash-doc package
 
 	dh_installexamples -p$(p_doc) examples/*
@@ 

Bug#1004171: bash: Replace add-shell/remove-shell with declarative shells.d trigger

2022-04-13 Thread Johannes Schauer Marin Rodrigues
Hi,

Quoting Johannes Schauer Marin Rodrigues (2022-01-22 09:25:43)
> the attached patch replaces add-shell/remove-shell with the declarative
> shells.d trigger from debianutils.
> 
> For details about this new mechanism see https://bugs.debian.org/990440.
> 
> This further reduces the number of maintainer scripts in the
> Essential:yes set and is the last missing piece for DPKG_ROOT support in
> bash.
> 
> I also submitted the same improvement to dash:
> 
> https://salsa.debian.org/debian/dash/-/merge_requests/8

the shells.d patch has been applied in dash in unstable for over a month now
and the dash maintainer states that there have been no problems since then.

I'd thus like to send a friendly ping to this bug and ask about applying
shells.d support from debianutils to bash as well.

If you have no objections, I can also prepare an NMU as I've done for #958083.

Thanks!

cheers, josch

signature.asc
Description: signature


Bug#1004171: bash: Replace add-shell/remove-shell with declarative shells.d trigger

2022-01-22 Thread Johannes Schauer Marin Rodrigues
Package: bash
Version: 5.1-3+b2
Severity: normal
Tags: patch
X-Debbugs-Cc: jo...@debian.org

Hi,

the attached patch replaces add-shell/remove-shell with the declarative
shells.d trigger from debianutils.

For details about this new mechanism see https://bugs.debian.org/990440.

This further reduces the number of maintainer scripts in the
Essential:yes set and is the last missing piece for DPKG_ROOT support in
bash.

I also submitted the same improvement to dash:

https://salsa.debian.org/debian/dash/-/merge_requests/8

Thanks!

cheers, josch
diff -Nru bash-5.1/debian/bash.postinst bash-5.1/debian/bash.postinst
--- bash-5.1/debian/bash.postinst   2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash.postinst   2022-01-22 09:12:42.0 +0100
@@ -14,13 +14,6 @@
 10 \
   || true
 
-if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-3 \
-&& which add-shell >/dev/null
-then
-add-shell /bin/bash
-add-shell /bin/rbash
-fi
-
 #DEBHELPER#
 
 exit 0
diff -Nru bash-5.1/debian/bash.postrm bash-5.1/debian/bash.postrm
--- bash-5.1/debian/bash.postrm 2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash.postrm 1970-01-01 01:00:00.0 +0100
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
-upgrade|failed-upgrade|abort-install|abort-upgrade)
-   ;;
-remove|purge|disappear)
-   if which remove-shell >/dev/null && [ -f /etc/shells ]; then
-   remove-shell /bin/bash
-   remove-shell /bin/rbash
-   fi
-   ;;
-*)
-echo "postrm called with unknown argument \`$1'" >&2
-exit 1
-   ;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/bash-static.postinst 
bash-5.1/debian/bash-static.postinst
--- bash-5.1/debian/bash-static.postinst2013-10-23 14:41:22.0 
+0200
+++ bash-5.1/debian/bash-static.postinst1970-01-01 01:00:00.0 
+0100
@@ -1,13 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = configure ] && dpkg --compare-versions "$2" le 3.2-4 \
-&& which add-shell >/dev/null
-then
-add-shell /bin/bash-static
-fi
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/bash-static.postrm bash-5.1/debian/bash-static.postrm
--- bash-5.1/debian/bash-static.postrm  2013-10-23 14:41:22.0 +0200
+++ bash-5.1/debian/bash-static.postrm  1970-01-01 01:00:00.0 +0100
@@ -1,21 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
-upgrade|failed-upgrade|abort-install|abort-upgrade)
-   ;;
-remove|purge|disappear)
-   if which remove-shell >/dev/null && [ -f /etc/shells ]; then
-   remove-shell /bin/bash-static
-   fi
-   ;;
-*)
-echo "postrm called with unknown argument \`$1'" >&2
-exit 1
-   ;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff -Nru bash-5.1/debian/changelog bash-5.1/debian/changelog
--- bash-5.1/debian/changelog   2022-01-06 17:16:52.0 +0100
+++ bash-5.1/debian/changelog   2022-01-22 09:12:42.0 +0100
@@ -1,3 +1,11 @@
+bash (5.1-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Replace add-shell/remove-shell with declarative shells.d trigger.
+Closes: #XXX
+
+ -- Johannes Schauer Marin Rodrigues   Sat, 22 Jan 2022 
09:12:42 +0100
+
 bash (5.1-6) unstable; urgency=medium
 
   * Apply upstream patches 013 - 016.
diff -Nru bash-5.1/debian/control bash-5.1/debian/control
--- bash-5.1/debian/control 2021-11-27 09:37:56.0 +0100
+++ bash-5.1/debian/control 2022-01-22 09:12:42.0 +0100
@@ -17,7 +17,7 @@
 Architecture: any
 Multi-Arch: foreign
 Pre-Depends: ${shlibs:Pre-Depends}, ${misc:Depends}
-Depends: base-files (>= 2.1.12), debianutils (>= 2.15)
+Depends: base-files (>= 2.1.12), debianutils (>= 5.6-0.1)
 Recommends: bash-completion (>= 20060301-0)
 Conflicts: bash-completion (<< 20060301-0)
 Replaces: bash-doc (<= 2.05-1), bash-completion (<< 20060301-0)
@@ -39,7 +39,7 @@
 Package: bash-static
 Architecture: any
 Multi-Arch: foreign
-Depends: passwd (>= 1:4.0.3-10), ${misc:Depends}
+Depends: passwd (>= 1:4.0.3-10), debianutils (>= 5.6-0.1), ${misc:Depends}
 Suggests: bash-doc
 Section: shells
 Priority: optional
diff -Nru bash-5.1/debian/rules bash-5.1/debian/rules
--- bash-5.1/debian/rules   2021-11-27 09:50:18.0 +0100
+++ bash-5.1/debian/rules   2022-01-22 09:12:42.0 +0100
@@ -227,6 +227,9 @@
$(ID) debian/clear_console.1 $(d)/usr/share/man/man1/
 endif
 
+   : # /etc/shells integration
+   $(ID) -D debian/shells.d/bash $(d)/usr/share/debianutils/shells.d/bash
+
: # files for the bash-doc package
 
dh_installexamples -p$(p_doc) examples/*
@@ -339,6 +342,7 @@
usr/share/man/man1
cp -p build-static/bash $(d_stat)/bin/bash-static
cp -p doc/bash.1 $(d_stat)/usr/share/man/man1/bash-static.1
+   $(ID) -D debian/shells.d/bash-static 
$(d_stat)/usr/share/debianutils/shells.d/bash-static
dh_installdocs -p$(p_stat)
dh_installchangelogs -p$(p_stat)
install -D