Bug#1006694: debianutils: update-shells --root default and merged-/usr support

2022-07-27 Thread Johannes Schauer Marin Rodrigues
Hi,

On Wed, 02 Mar 2022 15:49:46 +0100 Johannes Schauer Marin Rodrigues 
 wrote:
> I'm filing this as a tracking bug with usertags for the following two MR I
> filed on salsa:
> 
> https://salsa.debian.org/debian/debianutils/-/merge_requests/21
> https://salsa.debian.org/debian/debianutils/-/merge_requests/22
> 
> I think MR !22 is optional and only useful if you agree that it would
> make sense to have the same defaults for the --root argument as
> update-alternatives and dpkg-divert.

I just did an NMU with a delay of 10 days to unstable with the attached
debdiff, applying both of above merge requests and thus fixing this bug.

I hope that's okay. If not, feel free to cancel.

Thanks!

cheers, joschdiff -Nru debianutils-5.7/debian/changelog debianutils-5.7/debian/changelog
--- debianutils-5.7/debian/changelog	2022-05-01 18:47:00.0 +0200
+++ debianutils-5.7/debian/changelog	2022-07-27 08:20:06.0 +0200
@@ -1,3 +1,11 @@
+debianutils (5.7-0.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * update-shells: workaround for merged-/usr (closes: #1006694)
+  * update-shells: set the default for ROOT to $DPKG_ROOT
+
+ -- Johannes Schauer Marin Rodrigues   Wed, 27 Jul 2022 08:20:06 +0200
+
 debianutils (5.7-0.2) unstable; urgency=medium
 
   * Non-maintainer upload
diff -Nru debianutils-5.7/debian/patches/dpkg-root debianutils-5.7/debian/patches/dpkg-root
--- debianutils-5.7/debian/patches/dpkg-root	1970-01-01 01:00:00.0 +0100
+++ debianutils-5.7/debian/patches/dpkg-root	2022-07-27 08:17:42.0 +0200
@@ -0,0 +1,31 @@
+--- a/update-shells
 b/update-shells
+@@ -23,7 +23,7 @@ log() {
+ 	fi
+ }
+ 
+-ROOT=
++ROOT=${DPKG_ROOT:-}
+ VERBOSE=0
+ NOACT=0
+ 
+@@ -79,7 +79,7 @@ for f in "$PKG_DIR/"*; do
+ 	while IFS='#' read -r line _; do
+ 		[ -n "$line" ] || continue
+ 		PKG_SHELLS="$PKG_SHELLS$line#"
+-		realshell=$(dpkg-realpath --root "$ROOT" "$line")
++		realshell=$(dirname "$(dpkg-realpath --root "$ROOT" "$line")")/$(basename "$line")
+ 		if [ "$line" != "$realshell" ]; then
+ 			PKG_SHELLS="$PKG_SHELLS$realshell#"
+ 		fi
+--- a/update-shells.8
 b/update-shells.8
+@@ -24,6 +24,8 @@ Do not actually perform the changes to
+ 
+ Operate on a chroot at
+ .I ROOT .
++Defaults to the value of the environment variable
++.I DPKG_ROOT .
+ .TP
+ .B \-\-verbose
+ Print the shells that are being added or removed.
diff -Nru debianutils-5.7/debian/patches/series debianutils-5.7/debian/patches/series
--- debianutils-5.7/debian/patches/series	1970-01-01 01:00:00.0 +0100
+++ debianutils-5.7/debian/patches/series	2022-07-27 08:17:42.0 +0200
@@ -0,0 +1 @@
+dpkg-root
diff -Nru debianutils-5.7/debian/postinst debianutils-5.7/debian/postinst
--- debianutils-5.7/debian/postinst	2022-05-01 18:43:27.0 +0200
+++ debianutils-5.7/debian/postinst	2022-07-27 08:17:42.0 +0200
@@ -19,11 +19,11 @@
 
 case "$1" in
 (configure)
-	update-shells --root "${DPKG_ROOT:-}"
+	update-shells
 	ua
 ;;
 (triggered)
-	update-shells --root "${DPKG_ROOT:-}"
+	update-shells
 ;;
 
 (abort-upgrade|abort-remove|abort-deconfigure)


signature.asc
Description: signature


Bug#1006694: debianutils: update-shells --root default and merged-/usr support

2022-03-02 Thread Johannes Schauer Marin Rodrigues
Source: debianutils
Version: 5.7-0.1
Severity: normal
Tags: patch
User: debian-d...@lists.debian.org
Usertags: dpkg-root-support
X-Debbugs-Cc: jo...@debian.org

Hi,

I'm filing this as a tracking bug with usertags for the following two MR
I filed on salsa:

https://salsa.debian.org/debian/debianutils/-/merge_requests/21
https://salsa.debian.org/debian/debianutils/-/merge_requests/22

I think MR !22 is optional and only useful if you agree that it would
make sense to have the same defaults for the --root argument as
update-alternatives and dpkg-divert.

Thanks!

cheers, josch