DEBCHANGE(1)
๐ NAME ๐
okay so first things first, welcome to the DEBCHANGE(1) era bestie ๐ธ โ debchange is literally the tool for maintenance of the debian/changelog file in a source package. that's it, that's the vibe. ๐
โจ SYNOPSIS โจ
debchange [options] [text ...]
dch [options] [text ...]
๐ฆ DESCRIPTION ๐ฆ
so debchange, or its little alias dch (iconic, shorter, we stan), will add a new comment line to the Debian changelog in the current source tree. you must run this command from within that tree, no cap, it will not go hunting for you. ๐
if you give the text of the change on the command line, debchange runs in batch mode and just adds the text, with line breaks as necessary, at the appropriate place in debian/changelog (or the changelog specified by options, as described below, iykyk). if the text you give on the command line is a null string, debchange runs in batch mode without adding any text. if the text you give on the command line is a space string, it runs in batch mode and adds a blank changelog entry. wild, but okay.
if no text is specified, then debchange will run the editor as determined by sensible-editor so you can edit the file yourself. (the environment variables VISUAL and EDITOR are used in this order to figure out which editor to use. ๐) editors that understand the +n option for starting the editing on a specified line will use this to move to the correct line of the file for editing. if the editor is quit without modifying the temporary file, debchange will exit without touching the existing changelog โ no harm done, we love a clean getaway. ๐ง
heads up bestie: the changelog is assumed to be encoded with the UTF-8 encoding. if it is not, problems may occur. ๐ญ please see the iconv(1) manpage to find out how to convert changelogs from legacy encodings.
finally, a changelog or NEWS file can be created from scratch using the --create option described below. โจ
debchange also supports automatically producing bug-closing changelog entries, using the --closes option. this will usually query the BTS, the Debian Bug Tracking System (see https://bugs.debian.org/) to determine the title of the bug and the package in which it occurs. ๐ this behaviour can be stopped by giving a --noquery option or by setting the configuration variable DEBCHANGE_QUERY_BTS to no, as described below.
in either case, the editor (as described above) will always be invoked to give an opportunity to modify the entries, and the changelog will be accepted whether or not modifications are made. an extra changelog entry can be given on the command line in addition to the closes entries. slay. ๐
at most one of --append, --increment, --edit, --release, and --newversion may be specified as listed below. if no options are specified, debchange will use heuristics to guess whether or not the package has been successfully released, and behave as if --increment had been specified if the package has been released, or otherwise as if --append had been specified. the guessing game is real bestie. ๐ฎ
two different sets of heuristics can be used, as controlled by the --release-heuristic option or the DEBCHANGE_RELEASE_HEURISTIC configuration variable. the default changelog heuristic assumes the package has been released unless its changelog contains UNRELEASED in the distribution field. if this heuristic is enabled then the distribution will default to UNRELEASED in new changelog entries, and the --mainttrailer option described below will be automatically enabled. this can be useful if a package can be released by different maintainers, or if you do not keep the upload logs. the alternate log heuristic determines if a package has been released by looking for an appropriate dupload(1) or dput(1) log file in the parent directory. a warning will be issued if the log file is found but a successful upload is not recorded. this may be because the previous upload was performed with a version of dupload prior to 2.1 or because the upload failed. ๐
if either --increment or --newversion is used, the name and email for the new version will be determined as follows. if the environment variable DEBFULLNAME is set, this will be used for the maintainer full name; if not, then NAME will be checked. if the environment variable DEBEMAIL is set, this will be used for the email address. if this variable has the form name <email>, then the maintainer name will also be taken from here if neither DEBFULLNAME nor NAME is set. if this variable is not set, the same test is performed on the environment variable EMAIL.
next, if the full name has still not been determined, then use getpwuid(3) to determine the name from the password file. if this fails, use the previous changelog entry. for the email address, if it has not been set from DEBEMAIL or EMAIL, then look in /etc/mailname, then attempt to build it from the username and FQDN, otherwise use the email address in the previous changelog entry.
in other words, it's a good idea to setDEBEMAILandDEBFULLNAMEwhen using this script. fr fr. ๐
support is included for changelogs that record changes by multiple co-maintainers of a package. if an entry is appended to the current version's entries, and the maintainer is different from the maintainer who is listed as having done the previous entries, then lines will be added to the changelog to tell which maintainers made which changes. ๐ซถ
currently only one of the several such styles of recording this information is supported, in which the name of the maintainer who made a set of changes appears on a line before the changes, inside square brackets. this can be switched on and off using the --[no]multimaint option or the DEBCHANGE_MULTIMAINT configuration file option; the default is to enable it. note that if an entry has already been marked in this way, then this option will be silently ignored. ๐
if the directory name of the source tree has the form package-version, then debchange will also attempt to rename it if the (upstream) version number changes. this can be prevented by using the --preserve command line or configuration file option as described below. ๐
if --force-bad-version or --allow-lower-version is used, debchange will not stop if the new version is less than the current one. this is especially useful while doing backports. ๐ฅ
๐ Directory name checking ๐
in common with several other scripts in the devscripts package, debchange will climb the directory tree until it finds a debian/changelog file. as a safeguard against stray files causing potential problems, it will examine the name of the parent directory once it finds the debian/changelog file, and check that the directory name corresponds to the package name. ๐ต๏ธโโ๏ธ
precisely how it does this is controlled by two configuration file variables DEVSCRIPTS_CHECK_DIRNAME_LEVEL and DEVSCRIPTS_CHECK_DIRNAME_REGEX, and their corresponding command-line options --check-dirname-level and --check-dirname-regex.
DEVSCRIPTS_CHECK_DIRNAME_LEVEL can take the following values:
0โ Never check the directory name.1โ Only check the directory name if we have had to change directory in our search fordebian/changelog. This is the default behaviour.2โ Always check the directory name.
the directory name is checked by testing whether the current directory name (as determined by pwd(1)) matches the regex given by the configuration file option DEVSCRIPTS_CHECK_DIRNAME_REGEX or by the command line option --check-dirname-regex regex. here regex is a Perl regex (see perlre(3perl)), which will be anchored at the beginning and the end. if regex contains a /, then it must match the full directory path. if not, then it must match the full directory name. if regex contains the string 'PACKAGE', this will be replaced by the source package name, as determined from the changelog. the default value for the regex is: 'PACKAGE(-.+)?', thus matching directory names such as PACKAGE and PACKAGE-version. โจ
the default changelog to be edited is debian/changelog; however, this can be changed using the --changelog or --news options or the CHANGELOG environment variable, as described below. ๐
๐ OPTIONS ๐
--append,-aโ add a new changelog entry at the end of the current version's entries. ๐--increment,-iโ increment either the final component of the Debian release number or, if this is a native Debian package, the version number. on Ubuntu or Tanglu, this will also change the suffix frombuildXtoubuntu1/tanglu1. use-R,--rebuildfor a no change rebuild increment. this creates a new section at the beginning of the changelog with appropriate headers and footers. also, if this is a new version of a native Debian package, the directory name is changed to reflect this. ifDEBCHANGE_RELEASE_HEURISTICischangelog(default) and the current release isUNRELEASED, this will only change the version of the current changelog stanza. otherwise, this will create a new changelog stanza with the new version. ๐ฅ--newversion version,-v versionโ this specifies the version number (including the Debian release part) explicitly and behaves as the--incrementoption in other respects. it will also change the directory name if the upstream version number has changed. ifDEBCHANGE_RELEASE_HEURISTICischangelog(default) and the current release isUNRELEASED, this will only change the version of the current changelog stanza. otherwise, this will create a new changelog stanza with the new version. ๐--edit,-eโ edit the changelog in an editor. ๐--release,-rโ finalize the changelog for a release. update the changelog timestamp. if the distribution is set toUNRELEASED, change it to the distribution from the previous changelog entry (or another distribution as specified by--distribution). if there are no previous changelog entries and an explicit distribution has not been specified,unstablewill be used (or the name of the current development release when run under Ubuntu). ๐--force-save-on-releaseโ when--releaseis used, an editor is opened to allow inspection of the changelog. the user is required to save the file to accept the modified changelog, otherwise the original will be kept (default). ๐--no-force-save-on-releaseโ do not do so. note that a dummy changelog entry may be supplied in order to achieve the same effect โ e.g.debchange --release "". the entry will not be added to the changelog but its presence will suppress the editor. ๐ง--createโ bestie this one makes a whole newdebian/changelogfrom nothing (or aNEWSfile if you passed--newsโจ). You must be sitting in the top-level directory for this โ zero directory name checking happens, none, we're skipping that whole vibe. The package name and version come from one of three places: you hand them over with--packageand--newversion, or they get sniffed out of the directory name via--fromdirname, or you just type them into the generated changelog yourself. The maintainer name gets pulled from the environment if that's even possible, and the distribution is set either with--distributionor straight in the generated changelog file. ๐--emptyโ only works when you're tagging it along with--create, and what it does is suppress the automatic "initial release" changelog entry (so the next time you run debchange, that's when the first entry shows up). Heads up though ๐ซถ: this makesdpkg-parsechangelogthrow a warning on that next invocation, because there's literally no changes. Not a bug, just the consequence, iykyk.--packagepackage โ this sets the package name for the new changelog. And it may only be used together with the--create,--incrementand--newversionoptions. No solo runs, she needs her friends. ๐--nmu,-nโ bumps the Debian release number for a non-maintainer upload: it either appends a.1to a non-NMU version number (unless the package is Debian native, in which case+nmu1gets appended instead) or increments an existing NMU version number, and it drops in an NMU changelog comment. This whole thing happens automatically when the packager isn't in theMaintainerorUploadersfield ofdebian/controlโ unlessDEBCHANGE_AUTO_NMUis set tono, or you used--no-auto-nmu. โจ--bin-nmuโ increments the Debian release number for a binary non-maintainer upload. Either appends+b1to a non-binNMU version number or increments an existing binNMU version number, and adds a binNMU changelog comment. ๐--qa,-qโ increments the Debian release number for a Debian QA Team upload and adds a QA upload changelog comment. Slay, team effort.--rebuild,-Rโ increments the Debian release number for a no-change rebuild, by appendingbuild1or by incrementing an existing rebuild version number. Sometimes you just press the button again, fr fr. ๐--security,-sโ increments the Debian release number for a Debian Security Team non-maintainer upload and adds a Security Team upload changelog comment. Very serious, very iconic. ๐ฅ--ltsโ increments the Debian release number for a LTS Team non-maintainer upload and adds a LTS Team upload changelog comment. Long term support girlies rise up ๐ธ--teamโ increments the Debian release number for a team upload and adds a Team upload changelog comment. Group project but it actually works ๐--upstream,-Uโ does not appenddistro-name1to the version on a derived distribution. Increments the Debian version instead.--bpoโ increments the Debian release number for an upload tobullseye-backportsand adds a backport upload changelog comment. ๐ฆ--stableโ increments the Debian release number for an upload to the current stable release. Comfy. Cozy. Stable. ๐- *
--local,-lsuffix* โ adds a suffix to the Debian version number for a local build. Your own little garnish ๐ --force-bad-version,-bโ forces a version number to be less than the current one (e.g. when you're backporting). It's giving chaos but make it intentional ๐- *
--allow-lower-version*pattern โ allows a version number to be less than the current one if the new version matches the specified pattern. Rules with a loophole, love that for you. --force-distributionโ forces the distribution you provided to actually be used, even if it doesn't match the list of known distributions (perfect for unofficial distributions). Not on the list? Doesn't matter, she's going anyway. ๐--auto-nmuโ attempts to automatically figure out whether a change to the changelog represents a Non Maintainer Upload. And guess what, babe โ this is the default. It's already doing this. ๐ญ--no-auto-nmuโ disables automatic NMU detection. Equivalent to settingDEBCHANGE_AUTO_NMUtono. Same energy, different spelling.--fromdirname,-dโ takes the upstream version number from the directory name, which should be shaped likepackage-version. If the upstream version number went up from the most recent changelog entry, a new entry gets made with version numberversion-1(orversionif the package is Debian native), keeping the same epoch as the previous package version. If the upstream version number is the same, this option behaves exactly like-i. ๐--closesnnnnn[,nnnnn ...] โ adds changelog entries that close the bug numbers you list. It also invokes the editor after adding these entries. And it will generate warnings if the BTS can't be contacted (and--noqueryhasn't been specified), or if there are problems with the bug report it located. โ ๏ธ--[no]queryโ should we or should we not attempt to query the BTS when generating closes entries? That's the whole question, bestie. โ--preserve,-pโ preserves the source tree directory name if the upstream version number (or the version number of a Debian native package) changes. See also the configuration variables section below. ๐ซถ--no-preserve,--nopreserveโ does not preserve the source tree directory name. This is the default, fyi.- *
--vendor*vendor โ overrides the distributor ID thatdpkg-vendorreturns by default. This name gets used for the heuristics applied to new package versions and for sanity checking the target distribution. ๐ - *
--distribution*dist,-Ddist โ uses the specified dist in the changelog entry being edited, instead of using the previous changelog entry's distribution for new entries, or the existing value for existing entries. Say it with your chest and it gets written down. โจ - *
--urgency*urgency,-uurgency โ uses the specified urgency in the changelog entry being edited, instead of using the default"medium"for new entries or the existing value for existing entries. No cap,mediumwas just the placeholder. - *
--changelog*file,-cfile โ this edits file instead of the standarddebian/changelog. This option overrides anyCHANGELOGenvironment variable setting. Also, no directory traversing or checking is performed when this option is used โ we're going straight to the file, no detours. ๐ฏ - *
--news[newsfile*] โ this edits newsfile (by default,debian/NEWS) instead of the regular changelog. Directory searching will be performed. The changelog gets examined in order to determine the current package version. ๐ฐ --[no]multimaintโ should we indicate that parts of a changelog entry were made by different maintainers? Default is yes; see the discussion above and also theDEBCHANGE_MULTIMAINTconfiguration file option below. ๐ซ--[no]multimaint-mergeโ should all changes made by the same author be merged into the same changelog section? Default is yes; see the discussion above and also theDEBCHANGE_MULTIMAINT_MERGEconfiguration file option below. ๐ง--maintmaint,-mโ do not modify the maintainer details already listed in the changelog. This is especially useful for sponsors who want to automatically add a sponsorship message without disrupting the other changelog details. Note though: there may be some interesting interactions if multi-maintainer mode is in use, and in those cases you'll probably want to check the changelog manually before uploading it. ๐--controlmaint,-Mโ use the maintainer details from thedebian/controlMaintainerfield rather than the relevant environment variables (DEBFULLNAME,DEBEMAIL, etc.). This might be handy to restore the main maintainer's details in the changelog trailer after a bogus edit (e.g. when-mwas intended but you forgot it), or when releasing a package in the name of the main maintainer (e.g. the team). Reparative queen ๐--[no]mainttrailer,-tโ if mainttrailer is set, it avoids modifying the existing changelog trailer line (i.e. the maintainer and date-stamp details), unless it's used with options that require the trailer to be modified (e.g.--create,--release,-i,--qa, etc.). This option differs from--maintmaintbecause it will use multi-maintainer mode if appropriate โ with the single exception of editing the trailer. See also theDEBCHANGE_MAINTTRAILERconfiguration file option below. ๐- *
--check-dirname-level*N โ see the above section "Directory name checking" for an explanation of this option. (Yes, we covered that already, go peek ๐) - *
--check-dirname-regex*regex โ see the above section "Directory name checking" for an explanation of this option. Same deal, bestie, it's all up there. --no-conf,--noconfโ do not read any configuration files. And plot twist: this can only be used as the first option given on the command-line. First in line or it doesn't count. ๐ซ- *
--release-heuristic*log|changelog โ controls how debchange determines if a package has been released, when it's deciding whether to create a new changelog entry or append to an existing changelog entry. Detective work ๐โจ --datedate โ uses the specified date in the changelog entry being edited. The date **must be in RFC 5322 format, i.e. as produced bydate -R. Format matters, don't freestyle it. ๐--help,-hโ displays a help message and exits successfully. Your lil safety net ๐ซถ--versionโ displays version and copyright information and exits successfully. Iconic of her. ๐
๐ CONFIGURATION VARIABLES ๐
okay bestie so there are two config files and they get sourced in this exact order:
/etc/devscripts.conf~/.devscripts
sourced one after the other, slay, and they set your configuration variables. ๐
Command line options can override whatever the config files said. Environment variable settings are ignored for this purpose โ like, they don't get a vote here, sorry not sorry.
Here's the currently recognised lineup, and yes we're going through all of them:
DEBCHANGE_PRESERVEโ set it toyesand it's literally the same as passing--preserveon the command line. same energy, different address. โจDEBCHANGE_QUERY_BTSโ set it tonoand it's the same as using--noqueryon the command line. bye BTS queries, you're on your own. ๐DEVSCRIPTS_CHECK_DIRNAME_LEVEL,DEVSCRIPTS_CHECK_DIRNAME_REGEXโ go peek at the Directory name checking section up above for the whole explanation of these two. โ ๏ธ heads up though: these are package-wide configuration variables, so they affect all the devscripts scripts that check their value, exactly as described in their own manpages and indevscripts.conf(5). so like, they're not just yours, they're everyone's. ๐ซถDEBCHANGE_RELEASE_HEURISTICโ this one controls howdebchangefigures out whether a package has been released, which matters when it's deciding between creating a whole new changelog entry versus appending to one that already exists. it can be eitherlogorchangelog. pick your fighter. ๐ฅDEBCHANGE_MULTIMAINTโ if you set this tono,debchangewill not introduce those multiple-maintainer distinctions when a different maintainer appends an entry to an existing changelog. the discussion of that is above, go read it. the default isyes. ๐DEBCHANGE_MULTIMAINT_MERGEโ set this toyesand, when it's adding changes in multiple-maintainer mode,debchangechecks whether previous changes by the current maintainer already exist, and if they do it adds the new changes to that existing block instead of making a brand new block. tidy. the default isyes. ๐งDEBCHANGE_MAINTTRAILERโ set it tonoand it's the same as the--nomainttrailercommand line parameter. iconic.DEBCHANGE_TZโ use this timezone for your changelog entries. the default is the user/system timezone, as shown bydate -Rand affected by the environment variableTZ. โจDEBCHANGE_LOWER_VERSION_PATTERNโ if this is set, then it's the same as the--allow-lower-versioncommand line parameter being used. yes queen, let the lower versions in. ๐ฆDEBCHANGE_AUTO_NMUโ if this is set tonothendebchangewon't attempt to automatically determine whether the current changelog stanza represents an NMU. the default isyes. there's a whole discussion of the--nmuoption up above if you need the lore. ๐DEBCHANGE_FORCE_SAVE_ON_RELEASEโ if this is set tono, then it's the same as the--no-force-save-on-releasecommand line parameter being used. periodt.DEBCHANGE_VENDORโ use this vendor instead of the default (which is thedpkg-vendoroutput). check--vendorfor the details. ๐
๐ ENVIRONMENT ๐
the environment gets a say too, and here's who's talking:
DEBEMAIL,EMAIL,DEBFULLNAME,NAMEโ see the description above for how these get used. they've already had their moment. โจCHANGELOGโ this variable names the changelog to edit in place ofdebian/changelog. โ ๏ธ important: when this variable is set, no directory traversal or checking is performed. none. zero. it just goes. and heads up, this variable gets overridden by the--changelogcommand-line setting, so the flag wins the argument. ๐VISUAL,EDITORโ these two environment variables, in this order, determine which editorsensible-editoruses. soVISUALgets first dibs, andEDITORis the backup bestie. ๐ซถ
๐ฅ SEE ALSO ๐ฅ
go read these next, they're all part of the family:
๐ AUTHOR ๐
the original author was Christoph Lameter <clameter@debian.org>. ๐
many substantial changes and improvements were made by Julian Gilbey <jdg@debian.org>. ๐
and that's the whole page bestie, we made it to the end ๐ this one is from the Debian Utilities set and its manual page is DEBCHANGE(1) โ shoutout to the legends who wrote it, and shoutout to you for reading all three parts, that's main character energy fr fr. now go update a changelog and slay ๐
โจ๐ฆ
๐ฆ where this page comes from
- ubuntu stonking: devscripts 2.26.11ubuntu1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms