Re: Merging three direcories in postinst
Joachim Breitner writes ("Re: Merging three direcories in postinst"):
> If ghc-doc is removed before libghc-xhtml-doc, /usr/lib/ghc-doc/haddock/
> is left over as an empty directory. Because ghc-doc cannot remove it, as
> the .haddock file from libghc-xhtml-doc resides in it. And when
> libghc-xhtml-doc is removed, dpkg only removes the .haddock file and
> symlink that used to be the directory it was in.
does it work ?
One option might be to make the ghc-doc postrm purge check that the
directory is empty and bomb out if it isn't. But I'm not sure whether
this cure (blocking purge of a package with no configuration etc.)
isn't worse than the disease (a leftover cruft empty directory).
> Theoretically, the correct solution is to undo the symlinking and moving
> the files back when ghc-doc is removed. But this would require
> remembering where the files came from and does not seem to be worth the
> trouble and risk of breakage. If later ghc-doc is re-installed, things
> are fine again. Also, once all libghc-*-doc packages move their -doc
> files to the proper location, the problem will disappear automatically.
No, I think that is definitely not the right thing to do. It will be
very fragile, as you say.
> Current code at
That looks plausible.