FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-24-2010, 02:45 PM
Malte Forkel
 
Default Retrieving latest version of a file for a specified distribution

Hi,

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.

If the local machine is running the distribution in question, the start
is probably relatively simple. I can find out which package the file
belongs to (e.g. "dhcp-client") using dpkg -S. I could then download the
file with apt-get -d install (But there probably is a more suitable
utility, as I would like to download it to a temporary directory.) And
finally, I can extract the file I need by using dpkg-deb --fsys-tarfile.

But what if the the local machine is running a different distribution
(e.g. "lenny")? And how do I make sure I get the "latest" version
distributed, including security updates?

Hoping for your help,
Malte





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-24-2010, 06:18 PM
"Boyd Stephen Smith Jr."
 
Default 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/ \_/
 

Thread Tools




All times are GMT. The time now is 04:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org