On Fri, May 28, 2021 at 05:12:01PM +0100, Simon McVittie wrote: > On Thu, 27 May 2021 at 16:53:45 +0200, David Kalnischkies wrote: > > dpkg has the notion of "disappearing packages" (packages which have no > > files left on a system) which could solve this cleanup compulsion, but > > it is currently not supported (as in forbidden in practice) in Debian. > > Am I correct to think that the reason this is forbidden in practice is > the requirement that every package contains either its changelog and > copyright file in /usr/share/doc/${package}/{changelog.Debian.gz,copyright}, > or a symlink /usr/share/doc/${package} -> /usr/share/doc/${other}, either > of which will prevent the package from fully disappearing because the > replacement package isn't going to contain those files?
Well, the idea is that the newpkg provides+conflicts+replaces with the oldpkg. oldpkg contains just a softlink from /usr/share/doc/oldpkg to newpkg and Depends on newpkg. The newpkg replaces this symlink by containing it as well which leaves oldpkg with no remaining files which in turn leads dpkg to make oldpkg disappear. dpkg can only do this if no package on the system currently depends on oldpkg though. And that is where the tricky problems begin as dpkg could have made oldpkg disappear before another package is installed which happens to depend on oldpkg (I guess versioned provides come to our rescue here actually, now that I think about it). It also means that this can only be used for the most straightforward of transitions: a simple package rename – as as soon as you want the transition package to actually contain meaningful content (like a node → nodejs symlink for compat) its not applicable anymore, so its rather special interest. I seem to have forgotten what the big problem preventing "widespread" use was last time. I thought it would be forbidden by policy, but it isn't as you point out. At this point it might be just "nobody used it in production for a decade, there might be bugs". Guillem as the dpkg maintainer probably knows more about it than I do if there is interest in pursuing this further. Best regards David Kalnischkies
signature.asc
Description: PGP signature