debdiff-apply - apply a debdiff to a Debian source package
| Use Case | Command | Description |
|---|---|---|
| Apply patch to current directory | debdiff-apply < patch.diff | Patch from stdin onto the current unpacked source tree |
| Apply patch to a specific directory | debdiff-apply ./src-tree < patch.diff | Patch onto a named unpacked directory |
| Apply patch to a .dsc file | debdiff-apply package.dsc patch.diff | Create a new patched .dsc from the original |
| Show source version only | debdiff-apply --source-version < patch.diff | Print the version the patch applies to |
| Show target version | debdiff-apply --target-version pkg.dsc < patch.diff | Show what version would be generated |
| Verbose output | debdiff-apply -v pkg.dsc patch.diff | More information during operation |
| Extract to custom directory (no cleanup) | debdiff-apply -d /tmp/build pkg.dsc patch.diff | Persistent extraction for inspection |
debdiff-apply [options] [orig_dsc_or_dir] [patch_file]
debdiff-apply [options] < [patch_file]
debdiff-apply takes a patchfile that describes the differences between two Debian source packages old and new, and applies it to a target Debian source package orig.
orig could either be the same as old or it could be different. patchfile is expected to be a unified diff between two Debian source trees, as what debdiff(1) normally generates.
Any changes to debian/changelog are dealt with specially, to avoid the conflicts that changelog diffs typically produce when applied naively. The exact behaviour may be tweaked in the future, so one should not rely on it.
If patchfile does not apply to orig, even after the special-casing of debian/changelog, no changes are made and debdiff-apply(1) will exit with a non-zero error code.
orig_dsc_or_dir
π Target to apply the patch to. This can either be an unpacked source tree,
or a .dsc file. In the former case, the directory is modified inβplace; in the
latter case, a second .dsc is created. Default: .
patch_file
π Patch file to apply, in the format output by
debdiff(1). Default: /dev/stdin
-h, --helpπ show this help message and exit
-v, --verboseπ£οΈ Output more information
-c CHANGELOG, --changelog CHANGELOGπ Path to debian/changelog; default: debian/changelog
-D DISTRIBUTION, --distribution DISTRIBUTIONπΊοΈ Distribution to use, if the patch doesnβt already contain a changelog;
default: experimental
--replπ Run the python REPL after processing.
--source-versionπ Donβt apply the patch; instead print out the version of the package that it is supposed to be applied to, or nothing if the patch does not specify a source version.
--target-versionπ·οΈ Donβt apply the patch; instead print out the new version of the package debdiff-apply(1) would generate, when the patch is applied to the given target package, as specified by the other arguments.
--no-cleanπ§Ή Donβt clean temporary directories after a failure, so you can examine what failed.
--quilt-refreshπ If the building of the new source package fails, try to refresh patches using quilt(1) then try building it again.
-d DIRECTORY, --directory DIRECTORYπ 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.
debdiff-apply and this manual page were written by Ximin Luo <ity0 AT debian.org>.
Both are released under the GNU General Public License, version 3 or later.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-14 20:07 @2600:1f28:365:80b0:4d23:66fa:c2bb:7bae
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)