diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-09-17 19:52:32 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-09-17 20:08:33 +0200 |
commit | beaee6e09d654664614d85e924c14bc74314f2ca (patch) | |
tree | 9ccd9813344494b83383b027afa7de44ed3f91ab | |
parent | ee0e9ffe0a69d1ae1080f8087725015ae0ff8bc4 (diff) | |
download | git-buildpackage-beaee6e09d654664614d85e924c14bc74314f2ca.tar.gz git-buildpackage-beaee6e09d654664614d85e924c14bc74314f2ca.tar.bz2 git-buildpackage-beaee6e09d654664614d85e924c14bc74314f2ca.zip |
Add --[no]-interactive to avoid prompts
-rw-r--r-- | gbp/config.py | 3 | ||||
-rwxr-xr-x | git-import-orig | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gbp/config.py b/gbp/config.py index 9a6a3c53..9d443d13 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -67,6 +67,7 @@ class GbpOptionParser(OptionParser): 'pbuilder' : 'False', 'dist' : 'sid', 'arch' : '', + 'interactive' : 'True', } help = { 'debian-branch': @@ -111,6 +112,8 @@ class GbpOptionParser(OptionParser): "Build for this distribution when using git-pbuilder, default is '%(dist)s'", 'arch': "Build for this architecture when using git-pbuilder, default is '%(arch)s'", + 'interactive': + "Run command interactive, default is '%(interactive)s'", } config_files = [ '/etc/git-buildpackage/gbp.conf', os.path.expanduser('~/.gbp.conf'), diff --git a/git-import-orig b/git-import-orig index 32309ba7..b407370d 100755 --- a/git-import-orig +++ b/git-import-orig @@ -233,6 +233,8 @@ def main(argv): cmd_group.add_config_file_option(option_name="postimport", dest="postimport", help="hook run after a successful import, default is '%(postimport)s'") + parser.add_boolean_config_file_option(option_name="interactive", + dest='interactive') parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") @@ -319,13 +321,19 @@ on howto create it otherwise use --upstream-branch to specify it. cp = parse_changelog_repo(repo, options.debian_branch, 'debian/changelog') sourcepackage = cp['Source'] except NoChangelogError: - sourcepackage = ask_package_name(guessed_package) + if options.interactive: + sourcepackage = ask_package_name(guessed_package) + else: + sourcepackage = guessed_package # Try to find the version. if options.version: version = options.version else: - version = ask_package_version(guessed_version) + if options.interactive: + version = ask_package_version(guessed_version) + else: + version = guessed_version (clean, out) = repo.is_clean() if not clean and not is_empty: |