# phpman > man > DEBDIFF-APPLY(1)

[DEBDIFF-APPLY(1)](https://www.chedong.com/phpMan.php/man/DEBDIFF-APPLY/1/markdown)                       General Commands Manual                      [DEBDIFF-APPLY(1)](https://www.chedong.com/phpMan.php/man/DEBDIFF-APPLY/1/markdown)



## NAME
       debdiff-apply - apply a debdiff to a Debian source package


## SYNOPSIS
       **debdiff-apply** [options] [orig_dsc_or_dir] [patch_file]
       **debdiff-apply** [options] < [patch_file]


## DESCRIPTION
       **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)](https://www.chedong.com/phpMan.php/man/debdiff/1/markdown) 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)](https://www.chedong.com/phpMan.php/man/debdiff-apply/1/markdown) will exit with a non-zero error code.


## ARGUMENTS
       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)](https://www.chedong.com/phpMan.php/man/debdiff/1/markdown).  Default: _/dev/stdin_


## OPTIONS
### -h --help
              show this help message and exit

### -v --verbose
              Output more information

### -c --changelog
              Path to debian/changelog; default: debian/changelog

### -D --distribution
              Distribution to use, if the patch doesn't already contain a changelog; default: exper‐
              imental

       **--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 sup‐
              posed 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-ap**‐‐
              [**ply**(1)](https://www.chedong.com/phpMan.php/man/ply/1/markdown)  would  generate, when the patch is applied to the the given target package, as
              specified by the other arguments.

### For .dsc patch targets:
### --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)](https://www.chedong.com/phpMan.php/man/quilt/1/markdown)
              then try building it again.

### -d --directory
              Extract the .dsc into this directory, which won't be cleaned up after [**debdiff-apply**(1)](https://www.chedong.com/phpMan.php/man/debdiff-apply/1/markdown)
              exits. If not given, then it will be extracted to a temporary directory.


## AUTHORS
       **debdiff-apply** and this manual page were written by Ximin Luo <<infinity0@debian.org>>

       Both are released under the GNU General Public License, version 3 or later.


## SEE ALSO
       [**debdiff**(1)](https://www.chedong.com/phpMan.php/man/debdiff/1/markdown)



DEBIAN                                    Debian Utilities                          [DEBDIFF-APPLY(1)](https://www.chedong.com/phpMan.php/man/DEBDIFF-APPLY/1/markdown)
