From c1439bd59341d0e71f20653da2eae969224f3f88 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Tue, 11 Nov 2008 09:45:18 +0100 Subject: [PATCH] remove buildd.py, in ubuntu-dev-tools now --- buildd.py | 77 ------------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100755 buildd.py diff --git a/buildd.py b/buildd.py deleted file mode 100755 index 766fb49..0000000 --- a/buildd.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/python - -# CLI for Launchpad buildd operations -# (C) 2007 Canonical Ltd. -# Author: Martin Pitt - -import urllib2, cookielib, re, sys, glob, os.path -from urllib import urlencode - -# parse arguments -try: - (package, release, op) = sys.argv[1:] -except ValueError: - print >> sys.stderr, '''Usage: %s - -operation: status | retry | rescore [priority (default 5000)]''' % sys.argv[0] - sys.exit(1) - -# find cookie file -cookiefile = os.path.expanduser('~/.lpcookie') -if not os.path.exists(cookiefile): - try: - cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0] - except IndexError: - print >> sys.stderr, 'Could not find Firefox cookie file' - sys.exit(1) - -# build HTML opener with cookie file -cj = cookielib.MozillaCookieJar() -cj.load(cookiefile) -urlopener = urllib2.build_opener() -urlopener.add_handler(urllib2.HTTPCookieProcessor(cj)) - -# find out the version in given release -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.replace('+', '\+')), page) -if not m: - print >> sys.stderr, 'Cannot find this source package in this release' - sys.exit(1) -version = m.group(1) -print 'Source version:', version - -# parse out build URLs, states, and arches -buildstats = {} -page = urlopener.open('https://launchpad.net/ubuntu/+source/%s/%s' % (package, version)) -url = page.geturl() -page = page.read() -for m in re.finditer('"/ubuntu/\+source/%s/%s(/\+build/\d+)"[^\n]+\n\s*(\w+).*?(\w+).*?\s*([^\n]+)\n' % - (package.replace('+', '\+'), version.replace('+', '\+')), page, re.S): - if m.group(2) == release: - print '%s: %s' % (m.group(3), m.group(4)) - buildstats[url + m.group(1)] = [m.group(3).strip(), m.group(4).strip()] - -# operations -if op == 'status': - sys.exit(0) - -for build, (arch, status) in buildstats.iteritems(): - if op == 'rescore': - if status == 'Needs building': - print 'rescoring', build, '(%s)' % arch - urlopener.open(build+'/+rescore', urlencode( - {'SCORE': '5000', 'RESCORE': '1'})) - elif op == 'retry': - if status in ('Failed to build', 'Chroot problem', 'Failed to upload'): - print 'retrying', build, '(%s)' % arch - urlopener.open(build+'/+retry', urlencode( - {'RETRY': '1'})) - - else: - print >> sys.stderr, 'Invalid operation' - sys.exit(1) -- 2.39.5