debian: make git*.el packaging more robust
git's postinst contains the following snippet:
if test -x /usr/lib/emacsen-common/emacs-package-install; then
/usr/lib/emacsen-common/emacs-package-install git
fi
which makes git's elisp files usable and compiles them to bytecode
on installation, provided emacsen-support is unpacked. Likewise,
prerm has similar code to clean up if emacsen-support is unpacked.
The "text -x" is not a strong enough check --- elisp packaging policy
indicates that emacs-package-install should not be run unless
emacsen-common is configured. So at least we would need to change the
check to something like
if [ -x /usr/lib/emacsen-common/emacs-package-install ] &&
[ -e /var/lib/emacsen-common/installed-flavors ]; then
/usr/lib/emacsen-common/emacs-package-install git
fi
to avoid erroring out during installation.
Compiling the elisp also means that users uninterested in the emacs
support still had to endure waiting for them to be compiled and
reading the resulting warnings each time git is upgraded. So:
- Move the .el files to a separate git-el package.
- Make git depend on emacsen-support, so it can remove the old .elc
files in postinst on upgrade. Luckily the broken preinst was not
part of squeeze, so this transitional code (and the emacsen-support
dependency) can be dropped after a while.
Reported-by: Christoph Egger <christoph@debian.org>
Fixes: http://bugs.debian.org/614578
Analysis-by: Sven Joachim <svenjoac@gmx.de>
Explained-by: Agustin Martin <agmartin@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
diff --git a/debian/git-el.postinst b/debian/git-el.postinst
new file mode 100644
index 0000000..3037997
--- /dev/null
+++ b/debian/git-el.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+test "$1" = configure || exit 0
+/usr/lib/emacsen-common/emacs-package-install git