]> piware.de Git - bin.git/commitdiff
some fixes to buildd.py
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 3 Dec 2007 07:53:59 +0000 (08:53 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 3 Dec 2007 07:53:59 +0000 (08:53 +0100)
buildd.py

index 9fec2a67b24c3d47d646a2b6421b77b2280b08cc..6540a02e15463575834b0a086784530886edbced 100755 (executable)
--- a/buildd.py
+++ b/buildd.py
@@ -30,10 +30,15 @@ urlopener = urllib2.build_opener()
 urlopener.add_handler(urllib2.HTTPCookieProcessor(cj))
 
 # find out the version in given release
-page = urlopener.open('https://launchpad.net/ubuntu/+source/' + package).read()
+try:
+       page = urlopener.open('https://launchpad.net/ubuntu/+source/' + package).read()
+except urllib2.HTTPError:
+    print >> sys.stderr, 'This source does not appear to exist in Ubuntu'
+    sys.exit(1)
+
 m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, package), page)
 if not m:
-    print >> sys.stderr, 'Cannot find this package'
+    print >> sys.stderr, 'Cannot find this source package in this release'
     sys.exit(1)
 version = m.group(1)
 print 'Source version:', version
@@ -60,7 +65,7 @@ for build, (arch, status) in buildstats.iteritems():
             urlopener.open(build+'/+rescore', urlencode(
                 {'SCORE': '5000', 'RESCORE': '1'}))
     elif op == 'retry':
-        if status in ('Failed to build', 'Chroot problem'):
+        if status in ('Failed to build', 'Chroot problem', 'Failed to upload'):
             print 'retrying', build, '(%s)' % arch
             urlopener.open(build+'/+retry', urlencode(
                 {'RETRY': '1'}))