MANPAGES=$(SGML_MANPAGES) $(POD_MANPAGES)
MANUAL=docs/manual-html
PYCHECKS=$(patsubst %,%.py,$(COMMANDS))
-PYCHECKER_ARGS=--maxlines=300 --maxargs=12 -boptparse --no-override --no-shadowbuiltin
+PYCHECKER_ARGS=--maxlines=200 --maxargs=12 -boptparse --no-override --no-shadowbuiltin
GBP_VERSION=gbp/gbp_version.py
VERSION_ENT=docs/version.ent
os.environ['ARCH'] = options.pbuilder_arch
-def main(argv):
- changelog = 'debian/changelog'
- retval = 0
- prefix = "git-"
- cp = None
-
+def parse_args(argv, prefix):
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 ]
parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix=prefix)
except ConfigParser.ParsingError, err:
gbp.log.err(err)
- return 1
+ return None, None, None
tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "branch options", "branch layout options")
export_group.add_option("--git-dont-purge", action="store_false", dest="purge", default=True,
help="retain exported package build directory")
export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay")
- (options, args) = parser.parse_args(args)
- gbp.log.setup(options.color, options.verbose)
+ options, args = parser.parse_args(args)
+ gbp.log.setup(options.color, options.verbose)
if options.retag:
if not options.tag and not options.tag_only:
gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix))
- return 1
+ return None, None, None
if options.overlay and not options.export_dir:
- parser.error("Overlay must be used with --git-export-dir")
+ gbp.log.err("Overlay must be used with --git-export-dir")
+ return None, None, None
+
+ return options, args, dpkg_args
+
+
+def main(argv):
+ retval = 0
+ changelog = 'debian/changelog'
+ prefix = "git-"
+ cp = None
+
+ options, gbp_args, dpkg_args = parse_args(argv, prefix)
+ if not options:
+ return 1
try:
repo = GitRepository(os.path.curdir)
repo.move_tag(old, new)
-def main(argv):
- dirs = dict(top=os.path.abspath(os.curdir))
- needs_repo = False
- ret = 0
- skipped = False
- parents = None
-
+def parse_args(argv):
try:
parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
usage='%prog [options] /path/to/package.dsc')
except ConfigParser.ParsingError, err:
gbp.log.err(err)
- return 1
+ return None, None
import_group = GbpOptionGroup(parser, "import options",
"pristine-tar and filtering")
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose)
+ return options, args
+
+
+def main(argv):
+ dirs = dict(top=os.path.abspath(os.curdir))
+ needs_repo = False
+ ret = 0
+ skipped = False
+ parents = None
+
+ options, args = parse_args(argv)
gitTag = gbpc.GitTag(options.sign_tags, options.keyid)
try:
if len(args) != 1:
- parser.print_help()
+ gbp.log.err("Need to give exactly one package to import. Try --help.")
raise GbpError
else:
pkg = args[0]
# bit clearer.
gbp.log.warn("\nNot a valid upstream version: '%s'.\n%s" % (version, upstreamversion_msg))
-def main(argv):
- ret = 0
- tmpdir = ''
- pristine_orig = None
+def parse_args(argv):
try:
parser = GbpOptionParser(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 1
+ return None, None
import_group = GbpOptionGroup(parser, "import options",
"pristine-tar and filtering")
if options.filters:
turn_off_fastimport(options, "Import filters currently not supported with fastimport.")
+ return options, args
+
+
+def main(argv):
+ ret = 0
+ tmpdir = ''
+ pristine_orig = None
+ (options, args) = parse_args(argv)
try:
if options.uscan: # uscan mode
# tarball specified
if len(args) != 1:
- parser.print_help()
+ gbp.log.err("More than one tarball specified. Try --help.")
raise GbpError
else:
archive = args[0]