origtargz - fetch the orig tarball of a Debian package from various sources, and unpack it
origtargz downloads the orig tarball of a Debian package, and also unpacks it into the current directory, if it just contains a debian directory. The main use for origtargz is with debian-dir-only repository checkouts, but it is useful as a general tarball download wrapper. The version number for the tarball to be downloaded is determined from debian/changelog. It should be invoked from the top level directory of an unpacked Debian source package.
Various download locations are tried:
- First, an existing file is looked for.
- Directories given with --path are searched.
- pristine-tar is tried.
- pristine-lfs is tried.
- apt-get source is tried when apt-cache showsrc reports a matching version.
- Finally, uscan --download --download-current-version is tried.
When asked to unpack the orig tarball, origtargz will remove all files and directories from the current directory, except the debian directory, and the VCS repository directories. Note that this will drop all non-committed changes for the patch system in use (e.g. source format "3.0 (quilt)"), and will even remove all patches from the package when no patch system is in use (the original "1.0" source format). Some VCS control files outside debian/ preserved (.bzr-builddeb, .bzr-ignore, .gitignore, .hgignore), if stored in VCS.
The default behavior is to unpack the orig tarball if the current directory is empty except for a debian directory and the VCS files mentioned above.
Despite origtargz being called "targz", it will work with any compression scheme used for the tarball.
A similar tool to unpack orig tarballs is uupdate(1). uupdate creates a new working directory, unpacks the tarball, and applies the Debian .diff.gz changes. In contrast, origtargz uses the current directory, keeping VCS metadata.
For Debian package repositories that keep the full upstream source, other tools should be used to upgrade the repository from the new tarball. See gbp-import-orig(1) and svn-upgrade(1) for examples. origtargz is still useful for downloading the current tarball.
- -p, --path directory
- Add directory to the list of locations to search for an existing tarball. When found, a hardlink is created if possible, otherwise a symlink.
- -u, --unpack[=no|once|yes]
- Unpack the downloaded orig tarball to the current directory, replacing everything except the debian directory. Existing files are removed, except for debian/ and VCS files. Preserved are: .bzr, .bzrignore, .bzr-builddeb, .git, .gitignore, .hg, .hgignore, _darcs and .svn.
- -d, --download-only
- Alias for --unpack=no.
- -t, --tar-only
- When using apt-get source, pass --tar-only to it. The default is to download the full source package including .dsc and .diff.gz or .debian.tar.gz components so debdiff can be used to diff the last upload to the next one. With --tar-only, only download the .orig.tar.* file.
- Remove existing files as with --unpack. Note that like --unpack, this will remove upstream files even if they are stored in VCS.
origtargz and this manpage have been written by Christoph Berg <email@example.com>.