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

Re: Retrieving latest version of a file for a specified distribution



On Sunday 24 January 2010 09:45:08 Malte Forkel wrote:
> Given a file name (e.g. "/etc/dhclient.conf") and a distribution name
> (e.g. "etch"), I would like to programmatically retrieve the file's
> latest version for that distribution.

Not possible in general because of the alternatives system and diversions.  
Plus, there's also the Replaces dependency in dpkg/apt.  A single file may be 
provided by multiple packages within even a single release.  In addition a 
file may be present on your system, and "installed" by a package, but not be 
listed in either the contents of conffiles of the package.

That said, getting 90% there is probably better than nothing and normally good 
enough.

> dpkg -S

You might use apt-file instead.  It uses the Contents file in the repositories 
to search for files you don't have installed.  I'm not sure, but I think you 
can point it at an alternative source.list file -- for example for release you 
are not yet running.

> including security updates?

security.debian.org doesn't build/host Contents files, so apt-file won't 
return any hits for those packages, but they should have the same content as 
their version in the matching non-security repository.
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: