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

Re: mucking with dpkg control files in maintainer scripts?



Tollef Fog Heen writes ("Re: mucking with dpkg control files in maintainer scripts?"):
>         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"

This is completely and utterly wrong and gives _wrong answers_.

/var/lib/dpkg/status is not guaranteed to contain accurate
information.  While dpkg is running, or after dpkg has bombed out, it
will _definitely contain out of date information_.

And, going behind dpkg's back like this to interfere with the conffile
processing is extremely tricky, even if you deal with the
/var/lib/dpkg/updates (for example by using dpkg -s to get your
information).

It is highly unlikely that a package maintainer will be able to do
this kind of thing correctly - that is, in a way that's guaranteed to
give the right answers in every case and never to make things worse.
I would strongly recommend against this approach.

Messing with the /var/lib/dpkg/info/*.{pre,post}{inst,rm} is less
heinous though still needs quite a bit of care.

Ian.



Reply to: