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

Re: Parsing of dpkg status file considered harmful

Am Mittwoch, den 30.05.2007, 07:53 +0300 schrieb Guillem Jover:

> I've been meaning to send this for some time, but latest docbook-xml
> upload finally triggered it.

Well, why didn't you send me a CC of this mail? I just stumbled over
this by fluke.

> 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.
> 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

Should solve the issue.

> 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.
> I'll be filing bug reports on lintian and linda so that they give
> errors on maintainer scripts poking at the file...

Regards, Daniel

Reply to: