From 65343630163793c4f9e6cc709582dd07120fd278 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 3 Dec 2007 08:53:59 +0100 Subject: [PATCH] some fixes to buildd.py --- buildd.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/buildd.py b/buildd.py index 9fec2a6..6540a02 100755 --- 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'})) -- 2.39.5