Use new syncpackage script instead of subscribing archive-admins.

This commit is contained in:
Benjamin Drung 2010-05-10 22:04:39 +02:00
parent 7292782ef8
commit 42406c4be8

View File

@ -50,9 +50,7 @@ def LogCall(command):
logging.info("Running %s", " ".join(command)) logging.info("Running %s", " ".join(command))
return command return command
def get_source(package, version, section): def get_source(package, version, section, dist, uploader, bug):
assert section in ("main", "contrib", "non-free")
if os.path.isdir("/tmpfs"): if os.path.isdir("/tmpfs"):
workdir = "/tmpfs/ack-sync" workdir = "/tmpfs/ack-sync"
else: else:
@ -60,16 +58,15 @@ def get_source(package, version, section):
if not os.path.isdir(workdir): if not os.path.isdir(workdir):
os.makedirs(workdir) os.makedirs(workdir)
os.chdir(workdir) os.chdir(workdir)
if package.startswith("lib"): cmd = ["syncpackage", package, "-r", dist, "-V", version, "-b", str(bug)]
group = package[0:4] if section is not None:
else: cmd += ["-c", section]
group = package[0] if uploader is not None:
cmd += ["-u", uploader]
subprocess.check_call(cmd)
dsc_file = package + "_" + strip_epoch(version) + ".dsc" dsc_file = package + "_" + strip_epoch(version) + ".dsc"
location = os.path.join("http://ftp.debian.org/debian/pool", section, group, package, dsc_file)
#print "location:", location
subprocess.check_call(["dget", "-u", location])
return dsc_file return dsc_file
def build_source(dist, dsc_file): def build_source(dist, dsc_file):
@ -78,7 +75,7 @@ def build_source(dist, dsc_file):
subprocess.check_call(LogCall(["sbuild", "-c", dist,"-A", dsc_file])) subprocess.check_call(LogCall(["sbuild", "-c", dist,"-A", dsc_file]))
else: else:
cmd = ["sudo", "env", "DIST=" + dist, "pbuilder", "build", cmd = ["sudo", "env", "DIST=" + dist, "pbuilder", "build",
"--buildresult", ".", dsc_file] "--buildresult", "buildresult", dsc_file]
subprocess.check_call(LogCall(cmd)) subprocess.check_call(LogCall(cmd))
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print >> sys.stderr, "E: %s failed to build." % (dsc_file) print >> sys.stderr, "E: %s failed to build." % (dsc_file)
@ -123,6 +120,7 @@ def main(bug_numbers, package, version, section, update, verbose=False, silent=F
for bug_number in bug_numbers: for bug_number in bug_numbers:
bug = launchpad.bugs[bug_number] bug = launchpad.bugs[bug_number]
uploader = bug.owner.display_name + " <" + bug.owner.preferred_email_address.email + ">"
task = list(bug.bug_tasks)[0] task = list(bug.bug_tasks)[0]
@ -136,7 +134,7 @@ def main(bug_numbers, package, version, section, update, verbose=False, silent=F
version = get_version(bug.title) version = get_version(bug.title)
print "package:", package print "package:", package
print "version:", version print "version:", version
dsc_file = get_source(package, version, section) dsc_file = get_source(package, version, section, dist, uploader, bug_number)
build_source(dist, dsc_file) build_source(dist, dsc_file)
@ -172,22 +170,14 @@ def main(bug_numbers, package, version, section, update, verbose=False, silent=F
print "ubuntu-sponsors unsubscribed" print "ubuntu-sponsors unsubscribed"
task.assignee = None task.assignee = None
print "unassigned me" print "unassigned me"
task.status = "Triaged"
print "status set to Triaged"
if task.importance == "Undecided": if task.importance == "Undecided":
task.importance = "Wishlist" task.importance = "Wishlist"
print "importance set to Wishlist" print "importance set to Wishlist"
task.lp_save() task.lp_save()
if piuparts:
bug.newMessage(content="package builds and installs, sync request ACK'd")
else:
bug.newMessage(content="package builds, sync request ACK'd")
print "Ack comment added"
aa = launchpad.people['ubuntu-archive']
bug.subscribe(person=aa)
print "Archive admin subscribed"
bug.subscribe(person=launchpad.me) bug.subscribe(person=launchpad.me)
print "subscribed me" print "subscribed me"
changes_file = dsc_file[:-4] + "_source.changes"
subprocess.check_call(["dput", changes_file])
def usage(): def usage():
print """ack-sync <bug numbers> print """ack-sync <bug numbers>
@ -216,7 +206,7 @@ if __name__ == '__main__':
package = None package = None
sbuild = False sbuild = False
section = "main" section = None
silent = False silent = False
update = False update = False
verbose = False verbose = False