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
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'}))