On Tue, Jul 18, 2006 at 11:50:22AM +0200, Amaya wrote: > Hi there, Stefan > > Stefan Huehner wrote: > > i think lintian has a check for this issue. Please look into [1] if > > this is what you need. > > http://lintian.debian.org/reports/Tpostinst-should-not-set-usr-doc-link.html > > Great pointer. > > I guess what I also really need is to find out what packages had this > "ln -s" in the postinst in the past, because if they are not handling > the link removal upon upgrade, then users will have that link there > forever, but it will go unnoticed, as no link is created, in new > instalations of the package. Agreed; It is my understanding that it is wrong to put such functionality in the {pre,post}rm scripts, because then the /usr/doc/ link will exist (minimally) until the package is removed or upgraded (all 4 scripts are called at some point during a successful upgrade).
postinst is a nice place to put it, since you don't need to check the arguments ($1) (same for prerm, but not for this problem). Lots of packages do this in the *rm scripts though; there are also some that do it in preinst (which is only bad since the argument checking is less simple). All the preinst ones I have installed on my machine looked fine, with the possible exception of "time". This is a problem for people who run "stable" only, and never run any intermediate "testing" version; they will end up running etch with /usr/doc nonempty, so etch+1 removal of /usr/doc will fail, since 1) the package may not actually be updated between etch and etch+1 (thus will never have its *rm run), and 2) updated packages maybe be available in the new distribution, but may not be upgraded earlier in the dpkg run than whatever package removes/rewrites /usr/doc (unless there are plans for another pre-dependency) (assuming I have my target distributions right for this goal). Justin grep -lr usr/doc /var/lib/dpkg/info/ | grep rm$ /var/lib/dpkg/info/bsdutils.prerm /var/lib/dpkg/info/biff.prerm /var/lib/dpkg/info/mount.prerm /var/lib/dpkg/info/sed.prerm /var/lib/dpkg/info/klogd.prerm /var/lib/dpkg/info/sysklogd.prerm /var/lib/dpkg/info/debian-policy.prerm /var/lib/dpkg/info/libbz2-1.0.prerm /var/lib/dpkg/info/bzip2.prerm /var/lib/dpkg/info/libaudio2.prerm /var/lib/dpkg/info/flex.prerm /var/lib/dpkg/info/less.prerm /var/lib/dpkg/info/mime-support.prerm /var/lib/dpkg/info/util-linux-locales.prerm [...] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]