From 8ba739394c65112319084fa520b3e668bce1e322 Mon Sep 17 00:00:00 2001 From: Jonathan Patrick Davies Date: Wed, 13 Aug 2008 23:20:55 +0100 Subject: [PATCH] * buildd: Check that the architecture specified is correct and that --arch is not used for incorrect operations. --- buildd | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/buildd b/buildd index 7c45d65..731be27 100755 --- a/buildd +++ b/buildd @@ -52,8 +52,8 @@ optParser.add_option_group(retryOptions) if len(args) < 3: optParser.error("Incorrect number of arguments.") -package = str(args[0]) -release = str(args[1]) +package = str(args[0]).lower() +release = str(args[1]).lower() op = str(args[2]).lower() # Check our operation. @@ -63,8 +63,18 @@ 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 options.architecture: oneArch = True -else: oneArch = False +if op != "retry" and options.architecture: + print >> sys.stderr, "Operation %s does not use the --arch option." % op + sys.exit(1) +elif op == "retry" and options.architecture: + if options.architecture not in ("sparc", "powerpc", "lpia", "ia64", "i386", + "hppa", "amd64"): + print >> sys.stderr, "Invalid architecture specified: %s." % options.architecture + sys.exit(1) + else: + oneArch = True +else: + oneArch = False # Prepare Launchpad cookie. launchpadCookie = common.prepareLaunchpadCookie()