File: //var/lib/dpkg/info/emacs-gtk.postinst
#!/bin/sh
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 'emacs-gtk'
if [ -d /usr/share/doc/emacs-gtk ] && [ ! -h /usr/share/doc/emacs-gtk ]
then
# This will intentionally fail if the directory is not empty.
rmdir /usr/share/doc/emacs-gtk
ln -sv emacs-common /usr/share/doc/emacs-gtk
fi
fi
update-alternatives \
--install /usr/bin/emacs emacs \
/usr/bin/emacs-gtk 28 \
--slave /usr/share/man/man1/emacs.1.gz emacs.1.gz \
/usr/share/man/man1/emacs.emacs.1.gz \
update-alternatives \
--install /usr/bin/editor editor \
/usr/bin/emacs 0 \
--slave /usr/share/man/man1/editor.1.gz editor.1.gz \
/usr/share/man/man1/emacs.emacs.1.gz
# emacsen-common registration.
/usr/lib/emacsen-common/emacs-install emacs