I'm trying to find a way to run dch in non-interactive mode, in order to incorporate the debian/changelog file creation and manipulation within a shell script.

It seems that only when running it with the argument -r "" it works (as specified here). However, I need to use different arguments.


Found the problem,

It appears that dch will open an editor if it doesn't get all the information that it considers mandatory. So in order to create a debian/changelog without opening an editor I've found that the following combination of options is sufficient:

dch --create --distribution unstable --package "pkgpkg" --newversion "some nice message"
  • dch -n "some nice message" is enough. – uav Aug 2 '17 at 16:39

That depends on what you intend to do with it. dch picks up on the VISUAL/EDITOR variables to determine the editor, and the only condition is that it understand/ignore an initial option of the form +n. So I can do:

$ cat edit.sh 
#! /bin/bash

sed -i 's/UNRELEASED/trusty/' "$@"
$ VISUAL='bash edit.sh' dch -i
$ head -3 debian/changelog
mypackage (1.24ubuntu1) trusty; urgency=medium


And get reasonably automated operation.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.