Use $DPKG_MAINTSCRIPT_ARCH in maintainer scripts
authorSteve Langasek <steve.langasek@ubuntu.com>
Tue, 16 Aug 2011 01:43:56 +0000 (18:43 -0700)
committerDidier Raboud <odyx@debian.org>
Mon, 27 Feb 2012 12:36:37 +0000 (13:36 +0100)
... to decide the correct symlinks to set up, instead of going by the dpkg
built-in architecture.

Signed-off-by: Didier Raboud <odyx@debian.org>
debian/lsb-core.postinst
debian/lsb-core.prerm

index 34e549c70f1d0692311d7a3c78bbf28b3484a373..0321747749e0b08acc7f2597fe40be6931952305 100755 (executable)
@@ -3,7 +3,10 @@
 set -e
 
 setup_ldso_symlink () {
-    ARCH=`dpkg --print-architecture`
+    ARCH=$DPKG_MAINTSCRIPT_ARCH
+    if [ -z "$ARCH" ]; then
+        ARCH=$(dpkg --print-architecture)
+    fi
     case "$ARCH" in
         s390|ppc64|sparc|sparc64|alpha|hppa|m68k|mipsel)
             ln -sf ld.so.1 /lib/ld-lsb-$ARCH.so.1
index 2774f1918e39d302ab6d947d38eb611e58343d34..e6b26b6051e993c6cba3d3a14271c024a5e3fe87 100644 (file)
@@ -3,7 +3,10 @@
 set -e
 
 remove_ldso_symlink () {
-    ARCH=`dpkg --print-architecture`
+    ARCH=$DPKG_MAINTSCRIPT_ARCH
+    if [ -z "$ARCH" ]; then
+        ARCH=$(dpkg --print-architecture)
+    fi
     case "$ARCH" in
         s390|ia64|ppc64|sparc|sparc64|alpha|hppa|m68k|mipsel)
             rm -f /lib/ld-lsb-$ARCH.so.[123]