buildd: Create a base to add code for the new v2 mode

This commit is contained in:
Michael Bienia 2009-07-29 14:49:06 +02:00
parent cdb1292963
commit 4f97f5ba15

16
buildd
View File

@ -6,6 +6,7 @@
# Authors:
# - Martin Pitt <martin.pitt@canonical.com>
# - Jonathan Davies <jpds@ubuntu.com>
# - Michael Bienia <geser@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -73,15 +74,11 @@ optParser.add_option_group(v2options)
# Parse our options.
(options, args) = optParser.parse_args()
# 'help' called by itself - show our help.
try:
if args[0].lower() in ("help") and len(args) == 1:
if not len(args):
optParser.print_help()
sys.exit(0)
except IndexError:
optParser.print_help()
sys.exit(0)
sys.exit(1)
if not options.v2mode:
# Check we have the correct number of arguments.
if len(args) < 3:
optParser.error("Incorrect number of arguments.")
@ -92,7 +89,7 @@ try:
op = str(args[2]).lower()
except IndexError:
optParser.print_help()
sys.exit(0)
sys.exit(1)
# Check our operation.
if op not in ("rescore", "retry", "status"):
@ -185,3 +182,6 @@ if done: sys.exit(0)
print "No builds for '%s' found in the %s release - it may have been " \
"built in a former release." % (package, release.capitalize())
sys.exit(0)
# V2 mode
sys.exit(0)