HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
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