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

Re: mucking with dpkg control files in maintainer scripts?

Tollef Fog Heen <tfheen@err.no> writes:

> * sean finney 
> | is this even remotely acceptable?  i had the impressions that packages
> | must not assume the inner workings of dpkg.  but, i can't back this up
> | with anything in policy from what i can tell, hence the posting of
> | this question.
> Before responding, please read the bug report (390823) mentioned in
> the changelog.  Oh, and if we deem this unacceptable, please do
> suggest a different way and file bugs on a lot of the archive,
> including all doing stuff like:
> [...]
>         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
> [...]

I think this is different from messing with the maintainer
scripts. But none the less I think a better way for this would be to
call 'dpkg -s package'.

> in their postinst.  Other notable offenders are base-files, man-db,
> dpkg, most of the X packages.  Not-so-well-known offenders include
> watchdog and mordor.
> In summary: It's the least harmful way to fix the problem, and other
> maintainers have come to the same conclusion before.  If anybody has
> less bad suggestions, please do chime in.

Talking in general, not this specific bug, I think it is very
unacceptable for one simple reason:

With multiarch there are multiple maintainer scripts for a package,
one for each architecture. With the given naming scheme this can't
work so in the dpkg patch I had to rename the files. Assumptions
about the dpkg internal names for maintainer scipts will fail.

Also when using --root or --admindir this horribly fails.

If mangling of maintainer scripts is needed to fix some bugs (as the
above case seems to be) we should probably add a way to ask dpkg for
the filename or have dpkg export a variable with it.


Reply to: