Control: tags -1 + patch

On 2023-08-28 17:31 +0200, Sven Joachim wrote:

> Package: debianutils
> Version: 5.9
>
> The following snippet from the postinst script cannot possibly be
> right, as it creates two broken symlinks on non-usrmerged systems:
>
> ,----
> | usrmerge(){
> |     for p in run-parts tmpfile; do
> |             [ -e /usr/bin/$p ] || ln -s /bin/which /usr/bin/$p
> |     done
> `----
>
> Apart from the typo ("tmpfile" should be "tempfile"), the intention
> probably was to symlink /bin/$p to /usr/bin/$p, not the non-existent
> /bin/which.

Attached is a quick & dirty patch which fixes the problem for me, I have
tested the upgrade from 5.9 in an unmerged chroot.

Cheers,
       Sven

From e02afe8a760733f5ae0e9f7d1d851ef19139f97a Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenj...@gmx.de>
Date: Mon, 28 Aug 2023 18:22:45 +0200
Subject: [PATCH] Create correct symlinks on non-usrmerged systems

Remove the dangling symlinks created by the 5.9 postinst first, as
otherwise "ln -s /bin/runparts /usr/bin/runparts" would fail with
EEXIST.

Closes: #1050725
---
 debian/postinst | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/postinst b/debian/postinst
index 1d9f317..15b227f 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -14,7 +14,10 @@ ua() {

 usrmerge(){
 	for p in run-parts tmpfile; do
-		[ -e /usr/bin/$p ] || ln -s /bin/which /usr/bin/$p
+		[ -e /usr/bin/$p ] || rm -f /usr/bin/$p
+	done
+	for p in run-parts tempfile; do
+		[ -e /usr/bin/$p ] || ln -s /bin/$p /usr/bin/$p
 	done
 	[ -e /usr/sbin/installkernel ] || \
 				ln -s /sbin/installkernel /usr/sbin/installkernel
--
2.40.1

Reply via email to