Package: ksh
Version: 93u+20120801-2
Severity: normal
Tags: patch
User: m...@linux.it
Usertags: usrmerge

The current usrmerge package must conflict with ksh because it would 
otherwise fail in postinst while trying to create again /usr/bin/ksh.
See #768079 for details.
Patch attached.

-- 
ciao,
Marco
diff --git a/debian/changelog b/debian/changelog
index cc7d18f..9ef7135 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+ksh (93u+20120801-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Create the /usr/bin/ksh compatibility link in postinst instead that as
+    an update-alternatives slave link, to support merged /usr systems.
+    (Closes: FIXME)
+
+ -- Marco d'Itri <m...@linux.it>  Wed, 06 Jan 2016 04:56:37 +0100
+
 ksh (93u+20120801-2) unstable; urgency=medium
 
   * Adopted package (Closes: #691199)
diff --git a/debian/postinst b/debian/postinst
index 822ec9e..477a5c5 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -22,10 +22,13 @@ esac
 # The alternative is the mksh package.
 # For a discussion on interactions between ksh and mksh, see #764401.
 update-alternatives --install /bin/ksh ksh /bin/ksh93 20 \
-                    --slave /usr/bin/ksh usr.bin.ksh /bin/ksh93 \
                     --slave /usr/share/man/man1/ksh.1.gz ksh.1.gz \
                             /usr/share/man/man1/ksh93.1.gz
 
+if [ ! -e /usr/bin/ksh -a ! -L /usr/bin/ksh ]; then
+  ln -s /bin/ksh /usr/bin/ksh
+fi
+
 # For a discussion of what we put in /etc/shells see #790118.
 add-shell /bin/ksh93
 add-shell /bin/rksh93
diff --git a/debian/prerm b/debian/prerm
index 1626b99..4626036 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -6,6 +6,10 @@ case "$1" in
     remove|deconfigure)
         update-alternatives --remove ksh /bin/ksh93
 	update-binfmts --package ksh --remove ksh /bin/ksh93
+	# remove the compatibility link if it is broken
+	if [ -L /usr/bin/ksh -a ! -e /usr/bin/ksh ]; then
+	  rm /usr/bin/ksh
+	fi
     ;;
 
     upgrade|failed-upgrade)

Attachment: signature.asc
Description: PGP signature

Reply via email to