[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: emacsen: need plan to fix leftover cruft in share/emacs/XX.Y...



Rob Browning wrote:

> Peter S Galbraith <GalbraithP@dfo-mpo.gc.ca> writes:
> 
> > Look, you'll the emacs maintainer, so you should know, which means
> > I'm probably wrong and should test it before I go on.  But even
> > going from, say, 20.2 to 20.7, when emacs-20.2 is removed the
> > emacsen-remove scripts get called and cruft gets deleted.  Then
> > emacs-20.7 is installed and cruft (compilation logs) are recreated
> > in a different place.  The only problem is that the add-on
> > package-supplied emacsen-remove scripts didn't clean up the
> > compilation logs correctly.
> 
> OK, you and I were miscommunicating on this point.  When you said
> emacsen-remove scripts the first time, I thought you'd meant I should
> add code to the scripts *in* emacsen-common, when it looks like what
> you really meant was the removal scripts in the add-on packages.

Right.

> Given that, I think you're right on this point.

Good stuff.
 
> So the only point we haven't resolved is whether or not add-on
> packages should clean up old-cruft, or just be expected not to
> generate future cruft.

I'm not sure.

I'd do something like you said:

> Which is why I'd recommend this instead:
> 
>   rm -f /usr/share/emacs/20.5/site-lisp/gri-mode.CompilationLog.gz
>   rm -f /usr/share/emacs/20.6/site-lisp/gri-mode.CompilationLog.gz
> 
> Since that actually cleans up the cruft we know about, and more lines
> can be added later if other people discover more in the future.
> 
> What would be wrong with that?

We could/should only specify known versions of (x)emacs prior to
now.

e.g. my remove script could be:

 #!/bin/sh
 set -e 
 flavour=$1
 package=gri
 source=/usr/share/emacs/site-lisp/
 destination=/usr/share/${flavour}/site-lisp/
 if [ ${flavour} != emacs ]
 then
     echo remove/${package}: Purging byte-compiled files for flavour ${flavour}
     rm -f ${destination}/gri-mode.elc
     rm -f ${destination}/gri-mode.CompilationLog.gz
     rm -f /usr/share/emacs/20.3/site-lisp/gri-mode.CompilationLog.gz
     rm -f /usr/share/emacs/20.4/site-lisp/gri-mode.CompilationLog.gz
     rm -f /usr/share/emacs/20.5/site-lisp/gri-mode.CompilationLog.gz
     rm -f /usr/share/emacs/20.6/site-lisp/gri-mode.CompilationLog.gz
 else
     echo remove/${package}: Ignoring emacsen flavour ${flavour}
 fi
 exit 0;
 

with other `rm -f' lines for other flavours.  The only glitch is
that we can't really be sure that the package associated with the
file we're deleting has actually been removed.

e.g. should I include
  rm -f /usr/share/emacs/19.34/site-lisp/gri-mode.CompilationLog.gz
?

Or should the script first check that the package isn't
installed:

$ dpkg --get-selections | egrep  "^emacs19.+[^e]install"
emacs19                                         install

In my case, deleting any gri-mode.CompilationLog.gz file can't be
that bad anyway.  I doubt many users would care.

Peter



Reply to: