* buildd: Allow the rescoring of one arch too.

This commit is contained in:
Jonathan Patrick Davies 2008-08-13 23:37:06 +01:00
parent abea053a51
commit ba12b9a4d6
2 changed files with 13 additions and 12 deletions

22
buildd
View File

@ -40,14 +40,14 @@ usage += "Only Launchpad Buildd Admins may rescore package builds."
optParser = OptionParser(usage)
# Retry options
retryOptions = OptionGroup(optParser, "Retry options",
"These options may only be used with the 'retry' operation.")
retryOptions.add_option("-a", "--arch", type = "string",
retryRescoreOptions = OptionGroup(optParser, "Retry and rescore options",
"These options may only be used with the 'retry' and 'rescore' operations.")
retryRescoreOptions.add_option("-a", "--arch", type = "string",
action = "store", dest = "architecture",
help = "Try to rebuild a specific architecture.")
help = "Rebuild or rescore a specific architecture.")
# Add the retry options to the main group.
optParser.add_option_group(retryOptions)
optParser.add_option_group(retryRescoreOptions)
# Parse our options.
(options, args) = optParser.parse_args()
@ -67,10 +67,10 @@ if op not in ("rescore", "retry", "status"):
# If the user has specified an architecture to build, we only wish to rebuild it
# and nothing else.
if op != "retry" and options.architecture:
if op not in ("retry", 'rescore') and options.architecture:
print >> sys.stderr, "Operation %s does not use the --arch option." % op
sys.exit(1)
elif op == "retry" and options.architecture:
elif op in ("retry", "rescore") and options.architecture:
if options.architecture not in ("sparc", "powerpc", "lpia", "ia64", "i386",
"hppa", "amd64"):
print >> sys.stderr, "Invalid architecture specified: %s." % options.architecture
@ -123,6 +123,10 @@ if op == 'status':
sys.exit(0)
for build, (arch, status) in buildstats.iteritems():
if oneArch and not options.architecture == arch:
# Skip this architecture.
continue
if op == 'rescore':
if status == 'Needs building':
print 'Rescoring', build, '(%s).' % arch
@ -130,10 +134,6 @@ for build, (arch, status) in buildstats.iteritems():
{'SCORE': '5000', 'RESCORE': '1'}))
elif op == 'retry':
if status in ('Failed to build', 'Chroot problem', 'Failed to upload'):
if oneArch and not options.architecture == arch:
# Skip this architecture.
continue
print 'Retrying:', build, '(%s).' % arch
urlopener.open(build + '/+retry', urlencode(
{'RETRY': '1'}))

3
debian/changelog vendored
View File

@ -4,7 +4,8 @@ ubuntu-dev-tools (0.39ubuntu1) intrepid; urgency=low
* common.py: Use os.path.expanduser() instead of os.environ.
* buildd:
- Added optparse support for option handling.
- Added support to request the rebuilding of only one architecture.
- Added support to request the rebuilding or rescoring of only one
architecture.
* hugdaylist: Improved number of bugs option handling.
[ Siegfried-Angel Gevatter Pujals ]