aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-01-12 15:40:42 +0200
committerGuido Günther <agx@sigxcpu.org>2012-02-13 18:54:16 +0100
commitbca9f76135c5b4975b261018f0c9013243f38846 (patch)
tree9047069f7ac0c33ae3e920412d2c489f28fe3e01 /gbp/scripts
parent24e772577b071cb4297a5ed4b807aab334027144 (diff)
Refactor config.py as preparation for rpm support.
Split GbpOptionParser in to a common base class and a Debian specific subclass, as a preparation for upcoming RPM support. This allows having different default values (and help texts) for common options between different package types, and, clearer separation of package type specific options. Signed-off-by: Guido Günther <agx@sigxcpu.org>
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-xgbp/scripts/buildpackage.py4
-rwxr-xr-xgbp/scripts/clone.py6
-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
-rwxr-xr-xgbp/scripts/pull.py6
8 files changed, 23 insertions, 23 deletions
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/clone.py b/gbp/scripts/clone.py
index 5dffbd09..ab2fc976 100755
--- a/gbp/scripts/clone.py
+++ b/gbp/scripts/clone.py
@@ -21,7 +21,7 @@
import sys
import os, os.path
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserCommon, GbpOptionGroup)
from gbp.deb.git import DebianGitRepository
from gbp.git import (GitRepository, GitRepositoryError)
from gbp.command_wrappers import (Command, CommandExecFailed)
@@ -30,8 +30,8 @@ import gbp.log
def parse_args (argv):
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] repository - clone a remote repository')
+ parser = GbpOptionParserCommon(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] repository - clone a remote repository')
branch_group = GbpOptionGroup(parser, "branch options", "branch tracking and layout options")
parser.add_option_group(branch_group)
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 9193f2b6..dbb4618c 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"
diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py
index d50ffc23..9c6f2c5c 100755
--- a/gbp/scripts/pull.py
+++ b/gbp/scripts/pull.py
@@ -22,7 +22,7 @@
import sys
import os, os.path
from gbp.command_wrappers import (Command, CommandExecFailed)
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+from gbp.config import (GbpOptionParserCommon, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import GitRepositoryError
from gbp.deb.git import DebianGitRepository
@@ -70,8 +70,8 @@ def fast_forward_branch(branch, repo, options):
def main(argv):
retval = 0
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] - safely update a repository from remote')
+ parser = GbpOptionParserCommon(command=os.path.basename(argv[0]), prefix='',
+ usage='%prog [options] - safely update a repository from remote')
branch_group = GbpOptionGroup(parser, "branch options", "branch update and layout options")
parser.add_option_group(branch_group)
branch_group.add_option("--force", action="store_true", dest="force", default=False,