Downloading Debian source packages easily
Posted by Steve on Tue 6 Mar 2007 at 09:30
To download the source of a package contained inside a Debian repository, whether official, or unofficial, is a straightforward operation using the apt-get support for "source lists". However downloading a package source which is stored upon a remote webserver can be a little fiddly - requiring multiple files to be fetched before the source can be unpacked. Using the dget tool this can be easily automated.
As we've discussed previously a Debian package consists of a collection of files, such as:
xen-shell_1.0-1.diff.gz xen-shell_1.0-1.dsc xen-shell_1.0.orig.tar.gz
Here we have, in turn, three files:
- The "diff" file, which contains differences between the original software release and the final Debian package.
- The "dsc" file, which contains checksum information and other details.
- The "orig" file, which is supposed to be the pristine release as downloaded from the project's homepage/site.
- Although in practise this might have been modified to remove non-redistributable files, etc.
If these files were not available to you in a repository from which apt-get could locate them then you would need to download each file in turn - then unpack them manually.
Instead of doing this you can make use of the dget tool which is included within the devscripts package.
The dget command can also unpack the downloaded files, automatically invoking the dpkg-source command.
If you're missing the devscripts package first install it:
apt-get install devscripts
Once installed you can download a source package via a command such as:
dget -x http://example.com/some/path/to/foo_1.0-1.dsc
This will first download the dsc file, then in turn any files referenced within it. Finally, because we specified the -x flag, the resultant package will be extracted, or unpacked.
The dget command is a real time-saver compared to copying and pasting links from a browser window and downloading each one in turn.
[ Send Message | View cparker's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
apt-build, etc, will allow you to rebuild packages in a reasonably automated fashion.
If you want more than that you'll need to organise it yourself. There was a project setup to start work on this, "debtoo", but it seems to only exist in the wayback machine now.
[ Parent | Reply to this comment ]
that announced it had no programming or management skills
to do anything else but the announcement.
One good thing that came out of it was my complete rewrite
of apt-build. Julien Danjou (original apt-build author and
maintainer) received it and replaced the old codebase in
favor of the rewrite. It was a few years ago, so don't worry
about package versions...
Davor Ocelic
[ Parent | Reply to this comment ]
instead of four (3 x`wget` + 1 x `dpkg-source -x`)
when I want to build my own Debian backport.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]