[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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
From 7b5b25df6a3f4bdd9ae8325ecb4c2beecc0d1140 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
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 <cjwatson@debian.org>
Signed-off-by: Didier Raboud <odyx@debian.org>
---
 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

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: