{
    "mode": "man",
    "parameter": "debdiff-apply",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/debdiff-apply/1/json",
    "generated": "2026-06-10T18:54:33Z",
    "synopsis": "debdiff-apply [options] [origdscordir] [patchfile]\ndebdiff-apply [options] < [patchfile]",
    "sections": {
        "NAME": {
            "content": "debdiff-apply - apply a debdiff to a Debian source package\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "debdiff-apply [options] [origdscordir] [patchfile]\ndebdiff-apply [options] < [patchfile]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "debdiff-apply  takes  a  patchfile  that  describes the differences between two Debian source\npackages old and new, and applies it to a target Debian source package orig.\n\norig could either be the same as old or it could be different.  patchfile is expected to be a\nunified diff between two Debian source trees, as what debdiff(1) normally generates.\n\nAny  changes  to  debian/changelog  are  dealt  with  specially,  to avoid the conflicts that\nchangelog diffs typically produce when applied naively. The exact behaviour may be tweaked in\nthe future, so one should not rely on it.\n\nIf  patchfile  does  not apply to orig, even after the special-casing of debian/changelog, no\nchanges are made and debdiff-apply(1) will exit with a non-zero error code.\n\n",
            "subsections": []
        },
        "ARGUMENTS": {
            "content": "origdscordir\nTarget to apply the patch to. This can either be an unpacked source tree,  or  a  .dsc\nfile.  In  the  former case, the directory is modified in-place; in the latter case, a\nsecond .dsc is created. Default: .\n\npatchfile\nPatch file to apply, in the format output by debdiff(1).  Default: /dev/stdin\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "show this help message and exit\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-v --verbose",
                    "content": "Output more information\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-c --changelog",
                    "content": "Path to debian/changelog; default: debian/changelog\n",
                    "flag": "-c",
                    "long": "--changelog"
                },
                {
                    "name": "-D --distribution",
                    "content": "Distribution to use, if the patch doesn't already contain a changelog; default: exper‐\nimental\n\n--repl Run the python REPL after processing.\n",
                    "flag": "-D",
                    "long": "--distribution"
                },
                {
                    "name": "--source-version",
                    "content": "Don't  apply  the  patch; instead print out the version of the package that it is sup‐\nposed to be applied to, or nothing if the patch does not specify a source version.\n",
                    "long": "--source-version"
                },
                {
                    "name": "--target-version",
                    "content": "Don't apply the patch; instead print out the new version of  the  package  debdiff-ap‐‐\nply(1)  would  generate, when the patch is applied to the the given target package, as\nspecified by the other arguments.\n",
                    "long": "--target-version"
                },
                {
                    "name": "For .dsc patch targets:",
                    "content": ""
                },
                {
                    "name": "--no-clean",
                    "content": "Don't clean temporary directories after a failure, so you can examine what failed.\n",
                    "long": "--no-clean"
                },
                {
                    "name": "--quilt-refresh",
                    "content": "If the building of the new source package fails, try to refresh patches using quilt(1)\nthen try building it again.\n",
                    "long": "--quilt-refresh"
                },
                {
                    "name": "-d --directory",
                    "content": "Extract the .dsc into this directory, which won't be cleaned up after debdiff-apply(1)\nexits. If not given, then it will be extracted to a temporary directory.\n\n",
                    "flag": "-d",
                    "long": "--directory"
                }
            ]
        },
        "AUTHORS": {
            "content": "debdiff-apply and this manual page were written by Ximin Luo <infinity0@debian.org>\n\nBoth are released under the GNU General Public License, version 3 or later.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "debdiff(1)\n\n\n\nDEBIAN                                    Debian Utilities                          DEBDIFF-APPLY(1)",
            "subsections": []
        }
    },
    "summary": "debdiff-apply - apply a debdiff to a Debian source package",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "show this help message and exit"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Output more information"
        },
        {
            "flag": "-c",
            "long": "--changelog",
            "arg": null,
            "description": "Path to debian/changelog; default: debian/changelog"
        },
        {
            "flag": "-D",
            "long": "--distribution",
            "arg": null,
            "description": "Distribution to use, if the patch doesn't already contain a changelog; default: exper‐ imental --repl Run the python REPL after processing."
        },
        {
            "flag": "",
            "long": "--source-version",
            "arg": null,
            "description": "Don't apply the patch; instead print out the version of the package that it is sup‐ posed to be applied to, or nothing if the patch does not specify a source version."
        },
        {
            "flag": "",
            "long": "--target-version",
            "arg": null,
            "description": "Don't apply the patch; instead print out the new version of the package debdiff-ap‐‐ ply(1) would generate, when the patch is applied to the the given target package, as specified by the other arguments."
        },
        {
            "flag": "",
            "long": "--no-clean",
            "arg": null,
            "description": "Don't clean temporary directories after a failure, so you can examine what failed."
        },
        {
            "flag": "",
            "long": "--quilt-refresh",
            "arg": null,
            "description": "If the building of the new source package fails, try to refresh patches using quilt(1) then try building it again."
        },
        {
            "flag": "-d",
            "long": "--directory",
            "arg": null,
            "description": "Extract the .dsc into this directory, which won't be cleaned up after debdiff-apply(1) exits. If not given, then it will be extracted to a temporary directory."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "debdiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/debdiff/1/json"
        },
        {
            "name": "DEBDIFF-APPLY",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/DEBDIFF-APPLY/1/json"
        }
    ]
}