On Dec 26, Felipe Sateler <[email protected]> wrote:

> So, I dug up a bit, and the /usr/bin/zsh slave's purpose was to
> preserve the /usr/bin path when zsh was moved from /usr to /. Since
> this is a slave link that will be updated whenever the master link is
> updated (so /bin/zsh and /usr/bin/zsh should always point to the same
> place) and nobody else is using this name[1], I propose that the
> alternative is simply dropped, and have a symlink from /usr/bin/zsh
> point to /bin/zsh. Then that link can be omitted when /bin is a
> symlink to /usr/bin.
> 
> Please find attached an (untested) patch that does that.
Your patch does not work because it would unconditionally remove 
/usr/bin/zsh even if it were still needed because another package 
providing /bin/zsh is still installed.
It also checks in preinst that /usr/bin/ksh is not a broken link, 
because I suppose that this could happen and then without this check 
the script would fail.

Please let me know if this patch is acceptable, I have similar ones for 
mksh and ksh.

-- 
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 <[email protected]>  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