{
    "content": [
        {
            "type": "text",
            "text": "# origtargz (man)\n\n## NAME\n\norigtargz - fetch the orig tarball of a Debian package from various sources, and unpack it\n\n## SYNOPSIS\n\norigtargz [OPTIONS] [--unpack[=no|once|yes]]\n\n## DESCRIPTION\n\norigtargz downloads the orig tarball of a Debian package, and also unpacks it into the\ncurrent directory, if it just contains a debian directory. The main use for origtargz is with\ndebian-dir-only repository checkouts, but it is useful as a general tarball download wrapper.\nThe version number for the tarball to be downloaded is determined from debian/changelog. It\nshould be invoked from the top level directory of an unpacked Debian source package.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION**\n- **NOTES**\n- **OPTIONS** (5 subsections)\n- **SEE ALSO**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "origtargz",
        "section": "",
        "mode": "man",
        "summary": "origtargz - fetch the orig tarball of a Debian package from various sources, and unpack it",
        "synopsis": "origtargz [OPTIONS] [--unpack[=no|once|yes]]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-p",
                "long": "--path",
                "arg": null,
                "description": "Add directory to the list of locations to search for an existing tarball. When found, a hardlink is created if possible, otherwise a symlink."
            },
            {
                "flag": "-u",
                "long": "--unpack",
                "arg": null,
                "description": "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. no Do not unpack the orig tarball. once (default when --unpack is not used) If the current directory contains only a debian directory (and possibly some dotfiles), unpack the orig tarball. This is the default behavior. yes (default for --unpack without argument) Always unpack the orig tarball."
            },
            {
                "flag": "-d",
                "long": "--download-only",
                "arg": null,
                "description": "Alias for --unpack=no."
            },
            {
                "flag": "-t",
                "long": "--tar-only",
                "arg": null,
                "description": "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."
            },
            {
                "flag": "",
                "long": "--clean",
                "arg": null,
                "description": "Remove existing files as with --unpack. Note that like --unpack, this will remove upstream files even if they are stored in VCS."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "debcheckout",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/debcheckout/1/json"
            },
            {
                "name": "gbp-import-orig",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gbp-import-orig/1/json"
            },
            {
                "name": "pristine-tar",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pristine-tar/1/json"
            },
            {
                "name": "svn-upgrade",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/svn-upgrade/1/json"
            },
            {
                "name": "uupdate",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/uupdate/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "origtargz --help",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-p --path",
                        "lines": 3,
                        "flag": "-p",
                        "long": "--path"
                    },
                    {
                        "name": "-u --unpack",
                        "lines": 14,
                        "flag": "-u",
                        "long": "--unpack"
                    },
                    {
                        "name": "-d --download-only",
                        "lines": 2,
                        "flag": "-d",
                        "long": "--download-only"
                    },
                    {
                        "name": "-t --tar-only",
                        "lines": 5,
                        "flag": "-t",
                        "long": "--tar-only"
                    },
                    {
                        "name": "--clean",
                        "lines": 3,
                        "long": "--clean"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "origtargz - fetch the orig tarball of a Debian package from various sources, and unpack it\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "origtargz [OPTIONS] [--unpack[=no|once|yes]]",
                "subsections": [
                    {
                        "name": "origtargz --help",
                        "content": ""
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "origtargz downloads the orig tarball of a Debian package, and also unpacks it into the\ncurrent directory, if it just contains a debian directory. The main use for origtargz is with\ndebian-dir-only repository checkouts, but it is useful as a general tarball download wrapper.\nThe version number for the tarball to be downloaded is determined from debian/changelog. It\nshould be invoked from the top level directory of an unpacked Debian source package.\n\nVarious download locations are tried:\n\n•   First, an existing file is looked for.\n\n•   Directories given with --path are searched.\n\n•   pristine-tar is tried.\n\n•   pristine-lfs is tried.\n\n•   apt-get source is tried when apt-cache showsrc reports a matching version.\n\n•   Finally, uscan --download --download-current-version is tried.\n\nWhen asked to unpack the orig tarball, origtargz will remove all files and directories from\nthe current directory, except the debian directory, and the VCS repository directories. Note\nthat this will drop all non-committed changes for the patch system in use (e.g. source format\n\"3.0 (quilt)\"), and will even remove all patches from the package when no patch system is in\nuse (the original \"1.0\" source format). Some VCS control files outside debian/ preserved\n(.bzr-builddeb, .bzr-ignore, .gitignore, .hgignore), if stored in VCS.\n\nThe default behavior is to unpack the orig tarball if the current directory is empty except\nfor a debian directory and the VCS files mentioned above.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "Despite origtargz being called \"targz\", it will work with any compression scheme used for the\ntarball.\n\nA similar tool to unpack orig tarballs is uupdate(1). uupdate creates a new working\ndirectory, unpacks the tarball, and applies the Debian .diff.gz changes. In contrast,\norigtargz uses the current directory, keeping VCS metadata.\n\nFor Debian package repositories that keep the full upstream source, other tools should be\nused to upgrade the repository from the new tarball. See gbp-import-orig(1) and svn-\nupgrade(1) for examples. origtargz is still useful for downloading the current tarball.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-p --path",
                        "content": "Add directory to the list of locations to search for an existing tarball.  When found, a\nhardlink is created if possible, otherwise a symlink.\n",
                        "flag": "-p",
                        "long": "--path"
                    },
                    {
                        "name": "-u --unpack",
                        "content": "Unpack the downloaded orig tarball to the current directory, replacing everything except\nthe debian directory. Existing files are removed, except for debian/ and VCS files.\nPreserved are: .bzr, .bzrignore, .bzr-builddeb, .git, .gitignore, .hg, .hgignore, darcs\nand .svn.\n\nno  Do not unpack the orig tarball.\n\nonce (default when --unpack is not used)\nIf the current directory contains only a debian directory (and possibly some\ndotfiles), unpack the orig tarball. This is the default behavior.\n\nyes (default for --unpack without argument)\nAlways unpack the orig tarball.\n",
                        "flag": "-u",
                        "long": "--unpack"
                    },
                    {
                        "name": "-d --download-only",
                        "content": "Alias for --unpack=no.\n",
                        "flag": "-d",
                        "long": "--download-only"
                    },
                    {
                        "name": "-t --tar-only",
                        "content": "When using apt-get source, pass --tar-only to it. The default is to download the full\nsource package including .dsc and .diff.gz or .debian.tar.gz components so debdiff can be\nused to diff the last upload to the next one. With --tar-only, only download the\n.orig.tar.* file.\n",
                        "flag": "-t",
                        "long": "--tar-only"
                    },
                    {
                        "name": "--clean",
                        "content": "Remove existing files as with --unpack. Note that like --unpack, this will remove\nupstream files even if they are stored in VCS.\n",
                        "long": "--clean"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "debcheckout(1), gbp-import-orig(1), pristine-tar(1), svn-upgrade(1), uupdate(1)\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "origtargz and this manpage have been written by Christoph Berg <myon@debian.org>.\n\n\n\nDebian Utilities                             2026-03-04                                 ORIGTARGZ(1)",
                "subsections": []
            }
        }
    }
}