aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2018-01-18 13:41:48 +0200
committerGuido Günther <agx@sigxcpu.org>2018-01-20 12:47:16 +0100
commit30114904ff7c06f1cc9e6a47fa4b329a243fa704 (patch)
treeadbf9f9add1ecdd43c3040db406bcba7df319a0f /gbp/scripts
parent690323271b642e9479fde942e2a362b3d43f6573 (diff)
dch: implement postedit hooks
Add new --postedit command line option for defining a custom hook that will be run after changes to the changelog file has been finalized. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts')
-rw-r--r--gbp/scripts/dch.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py
index a086464c..0087166a 100644
--- a/gbp/scripts/dch.py
+++ b/gbp/scripts/dch.py
@@ -31,6 +31,7 @@ from gbp.deb.source import DebianSource, DebianSourceError
from gbp.deb.git import GitRepositoryError, DebianGitRepository
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.scripts.common import ExitCodes, maybe_debug_raise
+from gbp.scripts.common.hook import Hook
user_customizations = {}
snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*")
@@ -423,6 +424,9 @@ def build_parser(name):
custom_group.add_config_file_option(option_name="customizations",
dest="customization_file",
help=help_msg)
+ custom_group.add_config_file_option(option_name="postedit", dest="postedit",
+ help="Hook to run after changes to the changelog file"
+ "have been finalized default is '%(postedit)s'")
return parser
@@ -572,6 +576,11 @@ def main(argv):
if editor_cmd:
gbpc.Command(editor_cmd, ["debian/changelog"])()
+ if options.postedit:
+ cp = ChangeLog(filename=changelog)
+ Hook('Postimport', options.postedit,
+ extra_env={'GBP_DEBIAN_VERSION': cp.version})()
+
if options.commit:
# Get the version from the changelog file (since dch might
# have incremented it, there's no way we can already know