dpatch-edit-patch
maintain dpatch patches for a Debian source package
- Provided by: dpatch (Version: 2.0.39)
- Report a bug
maintain dpatch patches for a Debian source package
dpatch-edit-patch [options] command dpatchname [basepatch]
This manual documents the dpatch-edit-patch command which maintains dpatch patches for a dpatch-using Debian source package.
dpatch-edit-patch will copy the full tree to a temporary directory for working.
dpatch is deprecated, please switch to the `3.0 (quilt)' Debian source package format instead. See http://wiki.debian.org/Projects/DebSrc3.0#FAQ for a short guide on how to do it.
dpatch-edit-patch takes two forms of arguments; options and commands. Currently, the only command that exists is “patch”, which allows you to create/edit dpatches. When no command is given, “patch” is assumed.
When dpatchname exists, dpatch-edit-patch will set up a working source tree, apply all dpatches listed in debian/patches/00list up to and including dpatchname, and spawn an interactive shell for the developer. The developer then edits files in this working tree. When the developer is done, they exit the shell. dpatch-edit-patch then updates dpatchname to reflect the changes made. Should the developer wish to abort the process from the interactive shell, they need only cause the shell to exit with an exit value of 230. Typically, this is done by exiting the shell with the command exit 230.
Would the developer wish to see the patch one's currently works on without exiting the subshell, two environment variables are exported into the subshell to help with this: DPEP_SHELL_REFDIR, which is set to the reference directory's full name, and DPEP_SHELL_WORKDIR, which is set to the subshell's working directory.
These two can be used to - for example - generate a diff between the reference version and the current tree:
When dpatchname does not exist, dpatch-edit-patch will assume that a new dpatch should be created. As with the above scenario, dpatch-edit-patch first creates a working source tree. If the optional argument basepatch is supplied, all dpatches in debian/patches/00list up to and including basepatch will be applied to the working tree. If basepatch is not supplied, no dpatches are applied to the working tree. When then developer exits the shell, dpatch-edit-patch will create dpatchname. If debian/patches/00template does not exist, a hardcoded dpatch header and shell snippet will be used. If it exists and is not executable, it will be copied verbatim as the header and shell snippet.
Its first parameter is the base filename of the to-be-updated or to-be-created dpatch (useful for adding titles to the dpatch header). Its second parameter will be the description of the new patch.
For the following options, command-line arguments take precedence over environment variables, which take precedence over configuration variables. Configuration variables are read from debian/patches/00dpatch.conf and ~/.dpatch.conf.
To create a new patch, to be applied after an existing patch 90_ctrlkeyfix:
$ dpatch-edit-patch patch 95_newupstreamfix 90_ctrlkeyfix
dpatch-edit-patch: * debian/patches/95_newupstreamfix.dpatch does not exist, it will be created as a new dpatch. dpatch-edit-patch: * Cleaning /home/david/temp/sopwith-1.6.0 ... dpatch-edit-patch: * Applying patches dpatch-edit-patch: ** Applying patch 90_ctrlkeyfix ... applied cleanly. dpatch-edit-patch: * Copying /home/david/temp/sopwith-1.6.0 to work directory. ...$ editor files
dpatch-edit-patch: * Creating new patch debian/patches/95_newupstreamfix.dpatch dpatch-edit-patch: Warning: debian/patches/00template does not exist, using hardcoded default. dpatch-edit-patch: debian/patches/95_newupstreamfix.dpatch created.
To create a new patch, intended to be applied before any other patches (or a new patch which doesn't require other patches to be applied first):
$ dpatch-edit-patch 10_debianstrings
dpatch-edit-patch: * debian/patches/10_debianstrings.dpatch does not exist, it will be created as a new dpatch. dpatch-edit-patch: * Cleaning /home/david/temp/sopwith-1.6.0 ... dpatch-edit-patch: Warning: * No base-patch supplied, not applying any patches. dpatch-edit-patch: * Copying /home/david/temp/sopwith-1.6.0 to work directory. ...$ editor files
... dpatch-edit-patch: * Creating new patch debian/patches/10_debianstrings.dpatch dpatch-edit-patch: Warning: debian/patches/00template does not exist, using hardcoded default. dpatch-edit-patch: debian/patches/10_debianstrings.dpatch created.
$ dpatch-edit-patch 10_debianstrings
dpatch-edit-patch: * debian/patches/10_debianstrings.dpatch exists, this patch will be updated. dpatch-edit-patch: * Cleaning /home/david/temp/sopwith-1.6.0 ... dpatch-edit-patch: * Applying patches dpatch-edit-patch: * Copying /home/david/temp/sopwith-1.6.0 to work directory. dpatch-edit-patch: * Applying current 10_debianstrings for editing. ...
$ editor files
$ exit 0
dpatch-edit-patch: Updating patch debian/patches/10_debianstrings.dpatch dpatch-edit-patch: @DPATCH@ tag found, preserving dpatch header. dpatch-edit-patch: debian/patches/10_debianstrings.dpatch updated.
dpatch-edit-patch uses the DEBFULLNAME environment variable as the author's name. If it is unset, the author name will be left blank.
dpatch-edit-patch determines the author's email address for
new patches using the following algorithm:
1) Should the DEBEMAIL environment variable exist, it is always used.
2) If the EMAIL environment variable exists, it will be used when
DEBEMAIL does not exist.
3) Should neither of the first two attempts succeed, the email will be
constructed using the login name of the user running
dpatch-edit-patch combined with the output of hostname -f.
When dpatch-edit-patch sets up a reference or a working directory, it dereferences all symlinks in the source. That allows relative links to continue working, and allows changes only to a single file and not to the linked file and the link target. If you use dpatch-edit-patch on source trees that have symbolic links, you might end up with a patch that is unapplyable to the original tree.
debian/patches/00dpatch.conf, ~/.dpatch.conf.
dpatch(1), dpatch(7), dpatch.make(7), dpatch-list-patch(1), dpatch-convert-diffgz(1)
Files in /usr/share/doc/dpatch/
This manual page was written by David B Harris <david@eelf.ddts.net> and modified in the course of development by Gergely Nagy <algernon@debian.org>, Marc Haber <mh+debian-packages@zugschlus.de>, Stefano Zacchiroli <zack@debian.org>, and Junichi Uekawa <dancer@debian.org>.