aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
Diffstat (limited to 'gbp')
-rw-r--r--gbp/config.py15
-rwxr-xr-xgbp/scripts/buildpackage.py4
-rw-r--r--gbp/scripts/create_remote_repo.py6
-rw-r--r--gbp/scripts/dch.py6
-rw-r--r--gbp/scripts/import_dsc.py6
-rw-r--r--gbp/scripts/import_orig.py6
-rwxr-xr-x[-rw-r--r--]gbp/scripts/pq.py6
7 files changed, 29 insertions, 20 deletions
diff --git a/gbp/config.py b/gbp/config.py
index e857b3e4..090c4f7b 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -68,9 +68,7 @@ class GbpOptionParser(OptionParser):
@cvar config_files: list of config files we parse
@type config_files: list
"""
- defaults = { 'builder' : 'debuild -i -I',
- 'cleaner' : 'debuild -d clean',
- 'debian-branch' : 'master',
+ defaults = { 'debian-branch' : 'master',
'upstream-branch' : 'upstream',
'upstream-tree' : 'TAG',
'pristine-tar' : 'False',
@@ -327,4 +325,15 @@ class GbpOptionGroup(OptionGroup):
neg_help = "negates '--%s%s'" % (self.parser.prefix, option_name)
self.add_config_file_option(option_name="no-%s" % option_name, dest=dest, help=neg_help, action="store_false")
+
+class GbpOptionParserDebian(GbpOptionParser):
+ """
+ Handles commandline options and parsing of config files for Debian tools
+ """
+ defaults = dict(GbpOptionParser.defaults)
+ defaults.update( {
+ 'builder' : 'debuild -i -I',
+ 'cleaner' : 'debuild -d clean',
+ } )
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 327c398a..3fd6917d 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -29,7 +29,7 @@ import gbp.deb as du
from gbp.command_wrappers import (Command,
RunAtCommand, CommandExecFailed,
RemoveTree, CatenateTarArchive)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
from gbp.deb.changelog import ChangeLog, NoChangeLogError, ParseChangeLogError
from gbp.errors import GbpError
@@ -465,7 +465,7 @@ def parse_args(argv, prefix):
args.append(arg)
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix=prefix)
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix=prefix)
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None, None
diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py
index d00963c8..d6174e36 100644
--- a/gbp/scripts/create_remote_repo.py
+++ b/gbp/scripts/create_remote_repo.py
@@ -28,7 +28,7 @@ import tty, termios
import re
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.command_wrappers import (CommandExecFailed, GitCommand)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import (GitRepositoryError, GitRepository)
import gbp.log
@@ -146,8 +146,8 @@ def main(argv):
retval = 0
changelog = 'debian/changelog'
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] - create a remote repository')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] - create a remote repository')
branch_group = GbpOptionGroup(parser, "branch options", "branch layout and tracking options")
branch_group.add_config_file_option(option_name="remote-url-pattern", dest="remote_url")
parser.add_option_group(branch_group)
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py
index 2ee988d8..3a4a02ad 100644
--- a/gbp/scripts/dch.py
+++ b/gbp/scripts/dch.py
@@ -26,7 +26,7 @@ import subprocess
import gbp.command_wrappers as gbpc
import gbp.dch as dch
import gbp.log
-from gbp.config import GbpOptionParser, GbpOptionGroup
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup
from gbp.errors import GbpError
from gbp.deb import compare_versions
from gbp.deb.git import GitRepositoryError, DebianGitRepository
@@ -332,8 +332,8 @@ def main(argv):
version_change = {}
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] paths')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] paths')
except ConfigParser.ParsingError, err:
gbp.log.errror(err)
return 1
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index 6aed3c2e..c5093fc3 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -32,7 +32,7 @@ from gbp.deb import (debian_version_chars,
from gbp.deb.git import (DebianGitRepository, GitRepositoryError)
from gbp.deb.changelog import ChangeLog
from gbp.git import rfc822_date_to_git
-from gbp.config import GbpOptionParser, GbpOptionGroup, no_upstream_branch_msg
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import GbpError
import gbp.log
@@ -160,8 +160,8 @@ def set_bare_repo_options(options):
def parse_args(argv):
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] /path/to/package.dsc')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] /path/to/package.dsc')
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 0446fda1..6693acde 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -32,7 +32,7 @@ from gbp.deb import (UpstreamSource,
upstreamversion_msg)
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
-from gbp.config import GbpOptionParser, GbpOptionGroup, no_upstream_branch_msg
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import (GbpError, GbpNothingImported)
import gbp.log
@@ -269,8 +269,8 @@ def set_bare_repo_options(options):
def parse_args(argv):
try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
except ConfigParser.ParsingError, err:
gbp.log.err(err)
return None, None
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py
index 7fa57cf9..ec9ae6d2 100644..100755
--- a/gbp/scripts/pq.py
+++ b/gbp/scripts/pq.py
@@ -24,7 +24,7 @@ import shutil
import subprocess
import sys
import tempfile
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.git import (GitRepositoryError, GitRepository)
from gbp.command_wrappers import (Command, GitCommand, RunAtCommand,
CommandExecFailed)
@@ -337,8 +337,8 @@ def switch_pq(repo, current):
def main(argv):
retval = 0
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage="%prog [options] action - maintain patches on a patch queue branch\n"
+ parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
+ usage="%prog [options] action - maintain patches on a patch queue branch\n"
"Actions:\n"
" export export the patch queue associated to the current branch\n"
" into a quilt patch series in debian/patches/ and update the\n"