Merge lp:~xnox/ubuntu-archive-tools/sponsoree into lp:ubuntu-archive-tools

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 986
Proposed branch: lp:~xnox/ubuntu-archive-tools/sponsoree
Merge into: lp:ubuntu-archive-tools
Diff against target: 46 lines (+14/-1)
1 file modified
copy-package (+14/-1)
To merge this branch: bzr merge lp:~xnox/ubuntu-archive-tools/sponsoree
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+280554@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

ping

Revision history for this message
Martin Pitt (pitti) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'copy-package'
2--- copy-package 2015-10-23 14:27:15 +0000
3+++ copy-package 2015-12-15 08:09:29 +0000
4@@ -67,6 +67,8 @@
5 num_copies += 1
6
7 print("Candidate copy target: %s" % options.destination.archive)
8+ if options.sponsoree:
9+ print("Sponsored for: %s" % options.sponsoree)
10 if options.dry_run:
11 print("Dry run; no packages copied.")
12 else:
13@@ -83,7 +85,8 @@
14 include_binaries=options.include_binaries,
15 unembargo=options.unembargo,
16 auto_approve=options.auto_approve,
17- silent=options.silent)
18+ silent=options.silent,
19+ sponsored=options.sponsoree)
20
21 print("%d %s requested." % (
22 num_copies, "copy" if num_copies == 1 else "copies"))
23@@ -144,6 +147,10 @@
24 "When a package cannot be copied, normally this script exits "
25 "with a non-zero status. With --skip-missing instead, the "
26 "error is printed and copying continues"))
27+ parser.add_option("--sponsor", metavar="USERNAME",
28+ dest="sponsoree", default=None,
29+ help="Sponsor the sync for USERNAME (a Launchpad "
30+ "username).")
31
32 # Deprecated in favour of --to and --from.
33 parser.add_option(
34@@ -234,6 +241,12 @@
35 if not args:
36 parser.error("You must specify some packages to copy.")
37
38+ if options.sponsoree:
39+ try:
40+ options.sponsoree = options.launchpad.people[options.sponsoree]
41+ except KeyError:
42+ parser.error("Person to sponsor for not found: %s" % options.sponsoree)
43+
44 if copy_packages(options, args):
45 return 0
46 else:

Subscribers

People subscribed via source and target branches