tags 391778 + patch
thanks

On October 11, 2006 at 3:24AM +0900,
tats (at debian.org) wrote:

> reassign 391778 xemacs21-mule
> retitle 391778 xemacs21-mule: postinst fails if xemacs21-support is not yet 
> configured
> severity 391778 serious
> thanks
>
> I'm reassigning Bug#391778 from apel to xemacs21-mule.
>
> On October 9, 2006 at 1:07PM +0200,
> allomber (at math.u-bordeaux.fr) wrote:
>
> > You can reproduce it with
> > debootstrap, chroot, and
> > apt-get update && apt-get install xemacs21 mell
[...]
> ----
> # apt-get install xemacs21 mell
> [...]
> Setting up xemacs21-mulesupport (2006.05.10-1) ...
> Setting up perl-modules (5.8.8-6.1) ...
> Setting up perl (5.8.8-6.1) ...
>
> Setting up xemacs21-basesupport (2006.05.10-1) ...
> Setting up xemacs21-mule (21.4.19-1) ...
> emacs-install xemacs21
> apel: Skipped: xemacs21 is not yet configured
> emacsen-common: Handling install of emacsen flavor xemacs21
> emacsen-common: byte-compiling for xemacs21
>
> WARNING:
> Couldn't find obvious defaults for:
> data-directory
> mule-lisp-directory
> lisp-directory
> Perhaps some directories don't exist, or the XEmacs executable,
> /usr/bin/xemacs21
> is in a strange place?Loading /usr/share/emacs/site-lisp/debian-startup...
> Loading 00debian-vars...
> No /etc/mailname. Reverting to default...
> ^GSymbol's function definition is void: batch-byte-compile
> xemacs exiting
> .
> [...]
> ----
>
> It seems that the error is occured in xemacs21-mule's postinst, and
> byte-compilation fails even emacsen-common.
>
> I've noticed that xemacs21, xemacs21-bin and xemacs21-support are
> not configured before xemacs21-mule's postinst, and found required
> code in `/var/lib/dpkg/info/xemacs21-support.postinst'.
>
> xemacs21 maintainer, please contain the code of
> xemacs21-support.postinst (making symlinks for /usr/lib/xemacs-*)
> in xemacs21-mule.postinst, xemacs21-nomule.postinst, etc.

I've also found a related problem that the symlinks are not removed
when xemacs21-support is removed, as follows:

----
# apt-get remove xemacs21-support
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  xemacs21 xemacs21-bin xemacs21-mule xemacs21-nomule xemacs21-support
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 24.9MB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 210798 files and directories currently installed.)
Removing xemacs21-nomule ...
Removing xemacs21-mule ...
[...]
Removing xemacs21-bin ...
dpkg - warning: while removing xemacs21-bin, directory 
`/usr/lib/xemacs-21.4.19' not empty so not removed.
Removing xemacs21-support ...
Removing xemacs21 ...
# ls -l /usr/lib/xemacs-21.4.19
total 0
lrwxrwxrwx 1 root root 29 Oct  9 13:25 etc -> /usr/share/xemacs-21.4.19/etc
lrwxrwxrwx 1 root root 30 Oct  9 13:25 lisp -> /usr/share/xemacs-21.4.19/lisp
----

I've prepared the attached patch to fix this RC bug.

Thanks,
--
Tatsuya Kinoshita
--- xemacs21-21.4.19-1/debian/postinst-base
+++ xemacs21-21.4.19/debian/postinst-base
@@ -1,6 +1,12 @@
 #!/bin/sh -e
 set -e
 
+# Make symlinks due to an emacs-install failure
+OLDDATADIR=/usr/lib/[EMAIL PROTECTED]@
+NEWDATADIR=/usr/share/[EMAIL PROTECTED]@
+test -e ${OLDDATADIR}/etc || ln -s ${NEWDATADIR}/etc ${OLDDATADIR}/etc
+test -e ${OLDDATADIR}/lisp || ln -s ${NEWDATADIR}/lisp ${OLDDATADIR}/lisp
+
 # oops.  Needed to check version on upgrade.  Now just need to remove old ones.
 for i in 1 2 3 4 5 6 ; do
     update-alternatives --remove xemacs21 /usr/bin/xemacs-21.4.$i-REPLACE_ME
--- xemacs21-21.4.19-1/debian/prerm-base
+++ xemacs21-21.4.19/debian/prerm-base
@@ -22,6 +22,11 @@
 if [ -L /usr/doc/[EMAIL PROTECTED]@-REPLACE_ME ]; then
        rm -f /usr/doc/[EMAIL PROTECTED]@-REPLACE_ME
 fi
-
+if [ -L /usr/lib/[EMAIL PROTECTED]@/etc ]; then
+       rm -f /usr/lib/[EMAIL PROTECTED]@/etc
+fi
+if [ -L /usr/lib/[EMAIL PROTECTED]@/lisp ]; then
+       rm -f /usr/lib/[EMAIL PROTECTED]@/lisp
+fi
 
 ##DEBHELPER##
--- xemacs21-21.4.19-1/debian/[EMAIL PROTECTED]@@[EMAIL PROTECTED]
+++ xemacs21-21.4.19/debian/[EMAIL PROTECTED]@@[EMAIL PROTECTED]
@@ -7,4 +7,11 @@
    rmdir /usr/local/lib/xemacs > /dev/null 2>&1 || \
    true 
 
+if [ -L /usr/lib/[EMAIL PROTECTED]@/etc ]; then
+       rm -f /usr/lib/[EMAIL PROTECTED]@/etc
+fi
+if [ -L /usr/lib/[EMAIL PROTECTED]@/lisp ]; then
+       rm -f /usr/lib/[EMAIL PROTECTED]@/lisp
+fi
+
 ##DEBHELPER##

Attachment: pgpf1BmbmPR02.pgp
Description: PGP signature

Reply via email to