On Thu, 17 Aug 2023, 20:57 Nicholas D Steeves, <s...@debian.org> wrote:
> Richard Lewis wrote: > > David Bremner wrote: > > > Richard Lewis writes: > > > > David Bremner wrote: > > > > What happens in the 'apt upgrade' is: > > > > the old emacsen-common prerm is called ('<old prerm> upgrade > > <new-version>'): > > and at the end it _unlinks_: > > /var/lib/emacsen-common/state/package/installed/emacsen-common > > @1 > > > Then, apt prepares to unpack elpa-dash: > > > > The elpa-dash prerm (from bullseye) is called as: > > /var/lib/dpkg/info/elpa-dash.prerm upgrade > > 2.19.1+git20220608.1.0ac1ecf+dfsg-1) > > > > but this starts with: > > > > if [ -e /var/lib/emacsen-common/state/package/installed/emacsen-common -a > > -x > > /usr/lib/emacsen-common/emacs-package-remove ] ; then > > /usr/lib/emacsen-common/emacs-package-remove --prerm elpa-dash > > > > fi > > > > ... and so does nothing, > > because /var/lib/emacsen-common/state/package/installed/emacsen-common is > > gone. > > Oh! It's a state-related bug! I wonder if emacsen-common (old version) > has been deinstalled at @1 (see above), or if the state is > emacsen-common (new version) is unpacked, but unconfigured, and thus > missing /var/lib/emacsen-common/state/package/installed/emacsen-common, > which is presumably created as a last step during package configuration > post-unpack? > the latter - new emacsen-common is present but in state 'unpacked' before new dh-* is unpackaged > In other words, elpa-dash (and other...most?..all? dh-elpa-using > packages) upgrades depends on having emacsen-common fully installed and > configured at @1. > this is my understanding yes: this is a feature/assumption made by the current design but not enforced through package dependencies or code in apt > I wonder if this can be solved in emacsen-common, or if it needs to be > solved in dh-elpa and then all the dh-elpa-using packages rebuilt to > generate new prerm scripts? Which do you think would be the better > approach? > I would guess the former is possible. but I think what is missing is clear documentation of what features all the machinery with emacsen-common and 'flavors' and dh-elpa is trying to provide ( i suspect dpkg triggers should be the answer- should the question be understood better --- eg it looks like jed does something similar with .sl files, at least i think it does -- i didnt find any documentation on that either)