diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-01-08 14:27:33 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-01-08 19:08:23 +0100 |
commit | b770493016f4483baa1f20f66488bfe3d4d09c01 (patch) | |
tree | ea45bf8fba9767016cf435e5dae6dc454c662172 /git-buildpackage | |
parent | 79ed2e0f088d0b374f5dbed12051770236268238 (diff) |
git-buildpackage: Add support for sending notifications via libnotify
after the build finished.
Diffstat (limited to 'git-buildpackage')
-rwxr-xr-x | git-buildpackage | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/git-buildpackage b/git-buildpackage index a7a0cec..78212bf 100755 --- a/git-buildpackage +++ b/git-buildpackage @@ -32,6 +32,7 @@ from gbp.config import (GbpOptionParser, GbpOptionGroup) from gbp.errors import GbpError from glob import glob import gbp.log +import gbp.notifications # when we want to reference the index in a treeish context we call it: index_name = "INDEX" @@ -218,6 +219,7 @@ def main(argv): changelog = 'debian/changelog' retval = 0 prefix = "git-" + cp = None args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0 ] dpkg_args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1 ] @@ -248,6 +250,7 @@ def main(argv): parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="notify", dest="notify", type='tristate') tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False, help="create a tag after a successful build") tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False, @@ -443,6 +446,10 @@ def main(argv): if options.export_dir and options.purge and not retval: RemoveTree(export_dir)() + if cp and not gbp.notifications.notify(cp, not retval, options.notify): + gbp.log.err("Failed to send notification") + retval = 1 + return retval if __name__ == '__main__': |