* Non-maintainer upload.
+ * Really handle the emacs-{gtk,lucid,nox} doc dir transition manually.
+ This cannot be handled by 'dpkg-maintscript-helper dir_to_symlink' because
+ of the arch:all to arch:any switch at the same time (bug #813455).
+ Do not forcibly remove the old docdir in the preinst to avoid bad effects
+ on other packages. Instead, in the postinst, replace the now empty
+ directory with the intended symlink. (Closes: #911616)
+
-- Andreas Beckmann <anbe@debian.org> Sun, 27 Jan 2019 16:56:15 +0100
emacs (1:26.1+1-3) unstable; urgency=medium
* Handle the emacs-{gtk,lucid,nox} doc dir transition manually.
Before the unversioning, these packages were in a different source
package (emacs-defaults) and were arch all. Since
- dpkg-mainscript-helper can't hande "all to any" transitions
+ dpkg-maintscript-helper can't hande "all to any" transitions
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813455), clean
up manually in the preinsts. Thanks to Sven Joachim for reporting
the problem and indentifying the underlying cause.
set -e
+# Manual dir_to_symlink conversion since dpkg-maintscript-helper does not
+# handle this in combination with arch:all to arch:any switches (#813455).
+# Keep this code for buster and bullseye to ease backports.
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt-nl "1:26.1+1-3.1~"
+then
+ test -n '@PKG_NAME@'
+ if [ -d /usr/share/doc/@PKG_NAME@ ] && [ ! -h /usr/share/doc/@PKG_NAME@ ]
+ then
+ # This will intentionally fail if the directory is not empty.
+ rmdir /usr/share/doc/@PKG_NAME@
+ ln -sv emacs-common /usr/share/doc/@PKG_NAME@
+ fi
+fi
+
update-alternatives \
--install /usr/bin/emacs emacs \
/usr/bin/emacs-@X_SUPPORT@ @BIN_PRIORITY@ \
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-doc_dir=/usr/share/doc/@PKG_NAME@
-
-test '@PKG_NAME@'
-
-case "$1" in
- install|upgrade)
- # Before the unversioning, emacs-{gtk,lucid,nox} packages were
- # in a different source package (emacs-defaults) and were arch
- # all, and dpkg can't handle dir to symlink transitions.
- rm -rf "$doc_dir"
- ;;
- abort-upgrade)
- ;;
- *)
- echo "unexpected $(basename "$0") argument"
- ;;
-esac
-
-#DEBHELPER#
debian/emacs-common.postinst \
debian/emacs-common.prerm \
debian/emacs-nox.postinst \
- debian/emacs-nox.preinst \
debian/emacs-nox.prerm \
debian/emacs-lucid.postinst \
- debian/emacs-lucid.preinst \
debian/emacs-lucid.prerm \
- debian/emacs-gtk.preinst \
debian/emacs-gtk.postinst \
debian/emacs-gtk.prerm