Bug#642076: lsb-core: no need to remove /lib/ld-lsb-x86-64.so.[23]

"Didier 'OdyX' Raboud" <[email protected]>
Newsgroups gmane.linux.debian.devel.lsb
Organization Debian, the Universal OS
Message-ID <4F50FB1A.8080607__44109.451029408$1330707459$gmane$org@debian.org>
Hi again,

Le 02.03.2012 13:18, Didier 'OdyX' Raboud a écrit :
> Hi Colin and Sven, and thanks for your input on this bug;
> 
> I propose the attached patch to get this fixed by removing the symlinks
> farm handling and replacing all symlinks by `solid` symlinks in the
> packages. Please review and comment!

According to the feedback I got on IRC, shipping files (or even worse;
symlinks) in /lib64 is definitely a bad idea and can only lead to bad
situations with the linker (which lives in there on amd64). Dropping the
symlink farm handled by postinst/prerm maintainer scripts in favour of
`real` package symlinks wouldn't lead to the simplicity I aimed at.

> Le 23.01.2012 21:44, Sven Joachim a écrit :
>>
>> It would probably be better to only remove those symlinks on upgrades
>> from versions < 3.2-28, and to do it before creating the new links.

Agreeing with that point of view, I prepared the attached patch that
does just that, in postinst before creating/updating the symlink farm
(as before, comments welcome).

Cheers,

OdyX
0001-Remove-lib-ld-lsb-x86-64.so.-only-on-upgrade.patch (text/plain, 2.1 KB)
From 7b5b25df6a3f4bdd9ae8325ecb4c2beecc0d1140 Mon Sep 17 00:00:00 2001
From: Didier Raboud <[email protected]>
Date: Fri, 2 Mar 2012 17:50:10 +0100
Subject: [PATCH] Remove /lib/ld-lsb-x86-64.so.* only on upgrade.

This is a safe-side fix useful only for amd64.

Closes: #642079
Reported-by: Colin Watson <[email protected]>
Signed-off-by: Didier Raboud <[email protected]>
---
 debian/lsb-core.postinst |    6 ++++--
 debian/lsb-core.prerm    |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/debian/lsb-core.postinst b/debian/lsb-core.postinst
index 0321747..435d1e0 100755
--- a/debian/lsb-core.postinst
+++ b/debian/lsb-core.postinst
@@ -29,8 +29,6 @@ setup_ldso_symlink () {
             ln -sf ld-linux.so.2 /lib/ld-lsb.so.3
             ln -sf ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.2
             ln -sf ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
-            [ -L /lib/ld-lsb-x86-64.so.2 ] && rm /lib/ld-lsb-x86-64.so.2 || true
-            [ -L /lib/ld-lsb-x86-64.so.3 ] && rm /lib/ld-lsb-x86-64.so.3 || true
             ;;
         ia64)
             ln -sf ld-linux-ia64.so.2 /lib/ld-lsb-ia64.so.1
@@ -56,6 +54,10 @@ case "$1" in
                 shadowconfig on >&2 || true
             fi
         fi
+        if dpkg --compare-versions "$2" lt "3.2+Debian30" ; then
+          [ -L /lib/ld-lsb-x86-64.so.2 ] && rm /lib/ld-lsb-x86-64.so.2 || true
+          [ -L /lib/ld-lsb-x86-64.so.3 ] && rm /lib/ld-lsb-x86-64.so.3 || true
+        fi
         setup_ldso_symlink
         ;;
     abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/lsb-core.prerm b/debian/lsb-core.prerm
index e6b26b6..8b1f535 100644
--- a/debian/lsb-core.prerm
+++ b/debian/lsb-core.prerm
@@ -18,7 +18,7 @@ remove_ldso_symlink () {
             rm -f /lib/ld-lsb.so.[123]
             ;;
         amd64)
-            rm -f /lib/ld-lsb.so.[123] /lib64/ld-lsb-x86-64.so.[23] /lib/ld-lsb-x86-64.so.[23]
+            rm -f /lib/ld-lsb.so.[123] /lib64/ld-lsb-x86-64.so.[23]
             ;;
         *)
             echo "ld-lsb-*.so.1 symlink for $ARCH is unknown; not removed."
-- 
1.7.2.5
signature.asc (application/pgp-signature, 663 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQGcBAEBAgAGBQJPUPsaAAoJEIvPpx7KFjRVTcIL/RptnTTpd1k5rReI/j4FtEll
pkwqefdXGDC8GbQFv07IVCoFmL6TMnPoOaVGKiBdJaGwm4FcB52W9rFf2T/xaw+5
8nccRaD1E2Mx7Hn0Dy9dcZtmaFZbORIUS39kv8J2ErSkQq9ASTcS38fDyD8q90U6
WhwcNno+f8eQ2XnHH+VdHjQOi1hWTP/ihQnStXoAdkbJp8D06GPgNrwwwFTrSD5a
y/D7ZWxIIbKlGgBsOzTpYNJR5W5hkCN9eQHCM38sKkR6ywWc23w0atQzmL1JVxFm
g3NKc/PplGd+I48bsisOz4ssIQqwJvrvxfs8lGqI+zoMB0nbj7YQHKlEc8Pqvxe0
/xMI0shKhQ8RJJ/eW9qDG++VdAWZSpYBmWomjASs3WxhUP5XvT0KALOWNuwLzb21
tHgytFcLEVwRBaAaXP9g3LQeV5lHqJMpu5DSmG5hqFmV1JN8kCC45DOoiF5/Ukur
cBKh1QbrQQ3uFerf7tQo1SugCzEFHLKlTsxpWhL9LQ==
=VyLK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.