From efb92c73afc0ca41450c1476b2a49bf8e4f6e47b Mon Sep 17 00:00:00 2001 From: Jonathan Patrick Davies Date: Thu, 14 Aug 2008 19:50:13 +0100 Subject: [PATCH] * buildd: Code cleanup on single arch options. * doc/buildd.1: Created. * doc/requestsync.1: Added note about sponsorship detecting. --- buildd | 40 +++++++++++++++-------------------- debian/changelog | 5 ++++- doc/buildd.1 | 53 +++++++++++++++++++++++++++++++++++++++++++++++ doc/requestsync.1 | 13 ++++++++++++ 4 files changed, 87 insertions(+), 24 deletions(-) create mode 100644 doc/buildd.1 diff --git a/buildd b/buildd index ab9dbd5..7940f77 100755 --- a/buildd +++ b/buildd @@ -95,7 +95,7 @@ except urllib2.HTTPError: m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, package.replace('+', '\+')), page) if not m: - print >> sys.stderr, "Cannot find this source package (%s) in this " \ + print >> sys.stderr, "Unable to find this source package (%s) in this " \ "release (%s)." % (package, release.capitalize()) sys.exit(1) @@ -128,32 +128,26 @@ for build, (arch, status) in buildstats.iteritems(): # Skip this architecture. continue - # Check if our package is successfully built and retry/rescore requested. - if oneArch and options.architecture == arch: - if status in ("Successfully built", "Currently building", - "Build for superseded Source", "Dependency wait"): - print "Package is marked as %s on %s." % (status.lower(), arch) - print "A %s of this package shall not be requested." % op - - # Check if package is building, before rescoring. - if status not in ("Needs building") and op in ("rescore"): - print "Package is not in the build queue on %s - shall not " \ - "rescore it." % arch - - # Stop, no other architectures require checking. - sys.exit(0) - - if op == 'rescore': - if status == 'Needs building': + if op in ('rescore'): + if status in ('Needs building'): print 'Rescoring', build, '(%s).' % arch + try: urlopener.open(build + '/+rescore', urlencode( {'SCORE': '5000', 'RESCORE': '1'})) except: - print "Unable to request rescore of %s on %s." % (package, - arch) - elif op == 'retry': + print >> sys.stderr, "Unable to request rescore on %s." % arch + else: + print "Not rescoring on %s; status is: %s." % (arch, status.lower()) + + if op in ('retry'): # Retry requested. if status in ('Failed to build', 'Chroot problem', 'Failed to upload'): print 'Retrying:', build, '(%s).' % arch - urlopener.open(build + '/+retry', urlencode( - {'RETRY': '1'})) + + try: + urlopener.open(build + '/+retry', urlencode( + {'RETRY': '1'})) + except: # Error encountered while submitting request. + print >> sys.stderr, "Unable to request retry on %s." % arch + else: # The package does not require rebuilding. + print "Not retrying on %s; status is %s." % (arch, status.lower()) diff --git a/debian/changelog b/debian/changelog index ac471d2..8973b2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ ubuntu-dev-tools (0.40ubuntu1) intrepid; urgency=low - * Changes go here. + [ Jonathan Patrick Davies ] + * buildd: Code cleanup on single arch options. + * doc/buildd.1: Created. + * doc/requestsync.1: Added note about sponsorship detecting. -- Jonathan Patrick Davies Thu, 14 Aug 2008 12:23:41 +0100 diff --git a/doc/buildd.1 b/doc/buildd.1 new file mode 100644 index 0000000..1ca4cbb --- /dev/null +++ b/doc/buildd.1 @@ -0,0 +1,53 @@ +.TH BUILDD "1" "14 August 2008" "ubuntu-dev-tools" +.SH NAME +buildd \- command-line interface to Launchpad build operations + +.SH SYNOPSIS + +.B buildd + +.B buildd \-\-help + +.SH DESCRIPTION +.PP +\fBbuildd\fR provides a command line interface to the Launchpad build +operations. + +.PP +\fBbuildd\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to authenticate +to Launchpad. + +.SH OPERATIONS +.PP +Listed below are the available operations for \fBbuildd\fR: +.TP +.B status +Outputs the build status of the package on Launchpad on all architectures. +.TP +.B retry +Requests that the package has another attempt at rebuilding from source. This +shall only work if the package has \fIFailed to build\fR on Launchpad. +.TP +.B rescore +Requests that the packages build priority be raised in the build queue. Only +members of the Launchpad build administrators may issue this operation and may +only be performed on packages which \fINeed building\fR. + +.SH OPTIONS +.PP +Listed below are the command line options for \fBbuildd\fR: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-a or \-\-architecture +Only available for \fIrescore\fR and \fIretry\fR operations only. This shall +only request the rebuilding/rescoring on the specified architecture only. + +.SH AUTHORS +.PP +\fBbuildd\fR was written by Martin Pitt , and +this manual page was written by Jonathan Patrick Davies . +.PP +Both are released under the terms of the GNU General Public License, version 3 +or (at your option) any later version. diff --git a/doc/requestsync.1 b/doc/requestsync.1 index 8a24602..a22617c 100644 --- a/doc/requestsync.1 +++ b/doc/requestsync.1 @@ -18,6 +18,19 @@ follows so that it can sign the mail and send it off to Launchpad. Alternatively a sync request can be filed directly using the launchpadbugs python module (option \fB\-\-lp\fR). \fBrequestsync\fR falls back to mail the sync request if submitting using the launchpadbugs module fails. + +.PP +\fBrequestsync\fR checks if you have the permissions to request the sync from +the archive administrators directly by checking if you are a member of the +\fI~ubuntu-dev\fR team (for universe/multiverse syncs) or a member of the +\fI~ubuntu-core-dev\fR team (for main/restricted syncs) on Launchpad. If you are +not a member of the appropriate team, the script shall subscribe the necessary +team with approval rights to the bug report for you. + +.PP +\fBrequestsync\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to +authenticate with Launchpad. + .SH OPTIONS .PP Listed below are the command line options for requestsync: