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

Re: Source code for unpacking Debian archives

On Thu, Sep 01, 2005 at 01:29:27PM +0200, Tommy Nordgren wrote:
> Where can I find the source code for unpacking .deb files, when
> downloading them via http or ftp?
> Please email a copy of any replies. I'm not subsribed.
> I wan't to do this because my own OS don't contain any built in support
> tools for Debian Archives

$ cat /usr/share/doc/debian/source-unpack.txt

There are two kinds of Debian source packages: old ones and new ones.

A. Old ones look like this:
 You unpack them by untarring the .tar.gz.  There is NO need to apply
 the diff.

B. New ones look like this:
      hello_1.3-11.orig.tar.gz - note the `.orig' part
 Here you MUST use dpkg-source or apply the diff manually - see below.

 If you have `dpkg-source' you should put the files in the same
 directory and type `dpkg-source -x <whatever>.dsc'.

 If you do not you can extract the Debian source as follows:
   1. untar P_V.orig.tar.gz.
   2. rename the resulting P-V.orig directory to P-V.  If some other
      directory results, rename *it* to P-V.
   3. mkdir P-V/debian.
   4. apply the diff with patch -p0.
   5. do `chmod +x P-V/debian/rules'
 (where P is the package name and V the version.)

C. There are some packages where the Debian source is the upstream
 source.  In this case there will be no .diff.gz and you can just use
 the .tar.gz.  If a .dsc is provided you can use `dpkg-source -x'.

 -- Ian Jackson <ijackson@gnu.ai.mit.edu>  Sat, 31 Aug 1996

Colin Watson                                       [cjwatson@debian.org]

Reply to: