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

Re: Parsing of dpkg status file considered harmful



Le mercredi 30 mai 2007 à 07:53 +0300, Guillem Jover a écrit :
> I've been meaning to send this for some time, but latest docbook-xml
> upload finally triggered it.
> 
> Please stop parsing dpkg status file from maintainer scripts. No
> package should assume its location or format (except for now for
> package managment frontends and the like, until there's a proper
> library they can use). This might make it really difficult in case
> we have to change the db layout or whatever in the future.

It's good that you send this email, because I thought this was the
recommended way to retrieve conffiles' MD5 sums, as explained in the
wiki [1].

> If you need to retrieve the conffile info, which is why most of those
> packages are poking at the status file, please use something like:
> 
>   $ dpkg-query -W -f='${Conffiles}' docbook-xml
> 
> which is also cleaner. If there happens to be any reentrancy problem
> in dpkg-query, that will be considered a bug and fixed, so this should
> be considered the standard api for maintainer scripts.

Could you please fix the wiki page with proper functions you recommend?

> I'll be filing bug reports on lintian and linda so that they give
> errors on maintainer scripts poking at the file...

Good. This could also be made a release goal so that you can safely
consider to change this database layout (or not) in lenny+1.

[1] http://wiki.debian.org/DpkgConffileHandling

-- 
 .''`.
: :' :      We are debian.org. Lower your prices, surrender your code.
`. `'       We will add your hardware and software distinctiveness to
  `-        our own. Resistance is futile.



Reply to: