Merge lp:~stgraber/ubuntu-archive-tools/pkgsets-improvements into lp:ubuntu-archive-tools

Proposed by Stéphane Graber on 2012-04-18
Status: Merged
Merged at revision: 454
Proposed branch: lp:~stgraber/ubuntu-archive-tools/pkgsets-improvements
Merge into: lp:ubuntu-archive-tools
Diff against target: 102 lines (+56/-5)
1 file modified
edit_acl.py (+56/-5)
To merge this branch: bzr merge lp:~stgraber/ubuntu-archive-tools/pkgsets-improvements
Reviewer Review Type Date Requested Status
Colin Watson 2012-04-18 Approve on 2012-05-25
Review via email: mp+102543@code.launchpad.net

Description of the Change

First commit is a bugfix as we LP stores packagesets per series but the existing code wasn't passing the distroseries.
Second commit is a quick hack to implement do_copy allowing for packageset copies between series, useful for the DMB.

To post a comment you must log in.
398. By Colin Watson on 2012-04-19

process-removals.py: fetch removals.txt rather than removals-full.txt if mirroring a removal from the current year

399. By Colin Watson on 2012-04-19

archive-cruft-check: add -v/--verbose option

400. By Martin Pitt on 2012-04-20

copy-proposed-kernel.py: Add queue URL to output

401. By Martin Pitt on 2012-04-20

copy-proposed-kernel.py: revert previous commit, still using copyPackage()

402. By Martin Pitt on 2012-04-20

copy-proposed-kernel.py: Move to asynchronous copyPackage()

403. By Martin Pitt on 2012-04-24

queuediff: switch default to precise

404. By Martin Pitt on 2012-04-25

publish-image-set.py: recognize "Pre-release" milestone

405. By Colin Watson on 2012-04-25

publish-image-set.py: add Wubi support

406. By Colin Watson on 2012-04-25

process-removals.py: add a --force option to force the removal of a single package despite it being back in unstable

407. By Colin Watson on 2012-04-25

add new branch-seeds script to branch a set of seed collections when opening a new series

408. By Martin Pitt on 2012-04-26

sru-release: use ubuntu.current_series instead of ubuntu.getDevelopmentSeries(), as that also covers frozen releases

409. By Colin Watson on 2012-04-26

branch-seeds: bind newly-created branches

410. By Colin Watson on 2012-04-26

drop maverick

411. By Colin Watson on 2012-04-26

sru-accept.py: switch default to precise

412. By Colin Watson on 2012-04-26

precise -> quantal

413. By Colin Watson on 2012-04-30

auto-sync: retry .dsc pulling on SSL errors

414. By Colin Watson on 2012-04-30

auto-sync: add --no-new option

415. By Colin Watson on 2012-05-02

auto-sync: copy large numbers of packages in smaller chunks if necessary

416. By Colin Watson on 2012-05-02

auto-sync: improve test for sources being published in source series

417. By Colin Watson on 2012-05-02

process-removals.py: call checkrdepends with series name

418. By Colin Watson on 2012-05-02

process-removals.py: call seeded-in-ubuntu

419. By Colin Watson on 2012-05-04

auto-sync: complete more gracefully if nothing to do

420. By Colin Watson on 2012-05-04

sru-report: use list comprehensions rather than filter (which returns an iterator in Python 3)

421. By Colin Watson on 2012-05-04

isotracker_xmlrpc.py: prefer Python 3 configparser name

422. By Colin Watson on 2012-05-04

backport-helper.py, edit_acl.py: use input() rather than raw_input() when running under Python 3

423. By Colin Watson on 2012-05-04

Handle Python 3 urllib/urllib2 reorganisation.

424. By Colin Watson on 2012-05-04

sync-helper.py: drop an explicit Unicode literal; this syntax won't work in Python 3, and in this case it's unnecessary in Python 2

425. By Colin Watson on 2012-05-04

synclib.py: remove support for reading request output through a pipe, and update all callers; its only user (in mass-sync.py) didn't really need it

426. By Colin Watson on 2012-05-04

Open subprocesses with universal_newlines=True when expecting to read text from them.

427. By Colin Watson on 2012-05-04

Use context managers in a few more places.

428. By Colin Watson on 2012-05-15

auto-sync: only note blacklisted packages and packages with no published sources in the source series when --verbose is given

429. By Colin Watson on 2012-05-16

synclib.py: fix return type confusion between different code paths

430. By Colin Watson on 2012-05-16

Switch to backportpackage and decommission backport-source. (The archive admin interface to backports is hereby deprecated, and backporters should DIY.)

431. By Colin Watson on 2012-05-16

process-removals.py: switch from checkrdepends to reverse-depends for reverse dependency analysis

432. By Colin Watson on 2012-05-16

new-source-filter.py: remove; obsoleted by new auto-sync script

433. By Colin Watson on 2012-05-18

auto-sync: deduplicate differences

434. By Colin Watson on 2012-05-18

isotracker_xmlrpc.py, post-image-to-iso-tracker.py: allow getting per-series default milestone

435. By Colin Watson on 2012-05-18

isotracker_xmlrpc.py: fix error handling

436. By Colin Watson on 2012-05-18

import-blacklist.py, sync-blacklist.py: new programs from Iain Lane and Stefano Rivera

437. By Colin Watson on 2012-05-18

sync-blacklist.py: remove unused import

438. By Colin Watson on 2012-05-18

import-blacklist.py, sync-blacklist.py: make Launchpad instance a command-line option

439. By Colin Watson on 2012-05-19

import-blacklist.py, sync-blacklist.py: make Python 3-compatible; use input/output files as arguments to avoid having to mess with sys.stdin/sys.stdout encoding

440. By Colin Watson on 2012-05-19

import-blacklist.py: add -n/--dry-run option

441. By Colin Watson on 2012-05-22

priority-mismatches: allow libdrm-intel1 and libpciaccess0 to be optional on amd64/i386 when they should be required, due to architecture-specific plymouth requirement

442. By Colin Watson on 2012-05-23

component-mismatches: allow overriding default suite and flavours on the command line

443. By Colin Watson on 2012-05-23

component-mismatches: modernise terminology (distro -> flavour)

444. By Colin Watson on 2012-05-23

component-mismatches: use more neutral language for movements between main and universe

445. By Colin Watson on 2012-05-23

auto-sync: add a --batch mode that assumes the default answer to all questions

446. By Colin Watson on 2012-05-23

auto-sync: list updated and new source packages separately at end of output

447. By Colin Watson on 2012-05-23

auto-sync: Skip new packages already in NEW queue

448. By Colin Watson on 2012-05-23

auto-sync: Only look at syncs and source uploads in NEW

449. By Colin Watson on 2012-05-24

Be a little more careful about opening files in binary mode.

450. By Colin Watson on 2012-05-24

auto-sync: Cache queries for Distribution.main_archive.

451. By Colin Watson on 2012-05-24

auto-sync: Add a fallback mode where we compute the set of changes using Debian Sources files rather than DistroSeriesDifferences. Use this by default, as testing reveals that the results of this are strictly more correct than DSDs right now.

452. By Colin Watson on 2012-05-25

auto-sync: fix parent_source_version caching

453. By Colin Watson on 2012-05-25

auto-sync: default to syncing from unstable

Colin Watson (cjwatson) wrote :

Looks good to me, thanks! There's one more small tweak needed for Python 3 compatibility, but I can take care of that.

Colin Watson (cjwatson) :
review: Approve
454. By Colin Watson on 2012-05-25

merge lp:~stgraber/ubuntu-archive-tools/pkgsets-improvements

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'edit_acl.py'
2--- edit_acl.py 2012-01-17 02:24:34 +0000
3+++ edit_acl.py 2012-04-18 16:01:42 +0000
4@@ -344,19 +344,68 @@
5 print("You must specify exactly one person to own the new package set.")
6 return False
7
8+ if options.series:
9+ distro_series = launchpad.distributions['ubuntu'].getSeries(
10+ name_or_version=options.series)
11+ else:
12+ distro_series = launchpad.distributions['ubuntu'].getDevelopmentSeries()[0]
13+
14 lp_person = launchpad.people[options.person[0]]
15
16 for packageset in options.packageset:
17 try:
18- if launchpad.packagesets.getByName(name=packageset):
19+ if launchpad.packagesets.getByName(
20+ name=packageset, distroseries=distro_series):
21 print("Package set %s already exists" % packageset)
22 continue
23 except (TypeError, launchpadlib.errors.HTTPError):
24 pass
25 desc = raw_input("Description for new package set %s: " % packageset)
26 ps = launchpad.packagesets.new(name=packageset, description=desc,
27- owner=lp_person)
28- print(ps)
29+ distroseries=distro_series, owner=lp_person)
30+ print(ps)
31+
32+
33+def do_copy(options):
34+ if options.archive is None:
35+ archives = launchpad.distributions['ubuntu'].archives
36+ else:
37+ archives = [get_archive(options, launchpad)]
38+
39+ if not options.packageset:
40+ print("You can only copy a package set, not something else.")
41+ return False
42+
43+ if options.series:
44+ distro_series = launchpad.distributions['ubuntu'].getSeries(
45+ name_or_version=options.series)
46+ else:
47+ distro_series = launchpad.distributions['ubuntu'].getDevelopmentSeries()[0]
48+
49+ dst = raw_input("Name of the destination series: ")
50+ dst_series = launchpad.distributions['ubuntu'].getSeries(name_or_version=dst)
51+
52+ for packageset in options.packageset:
53+ src_pkgset = launchpad.packagesets.getByName(
54+ name=packageset, distroseries=distro_series)
55+ if not src_pkgset:
56+ print("Package set %s doesn't exist" % packageset)
57+
58+ ps = launchpad.packagesets.new(name=packageset, description=src_pkgset.description,
59+ distroseries=dst_series, owner=src_pkgset.owner_link)
60+ print(ps)
61+
62+ ps.addSources(names=src_pkgset.getSourcesIncluded())
63+
64+ perms = []
65+ for archive in archives:
66+ perms.extend(archive.getUploadersForPackageset(
67+ packageset=src_pkgset))
68+
69+ for perm in perms:
70+ archive.newPackagesetUploader(
71+ person=perm.person_link, packageset=ps)
72+
73
74
75 def do_check(options):
76@@ -417,6 +466,8 @@
77 do_delete(options)
78 elif action == "create":
79 do_create(options)
80+ elif action == "copy":
81+ do_copy(options)
82 elif action == "check":
83 do_check(options)
84 else:
85@@ -426,7 +477,7 @@
86
87
88 if __name__ == '__main__':
89- parser = OptionParser(usage="usage: %prog [options] query|add|delete|create|check")
90+ parser = OptionParser(usage="usage: %prog [options] query|add|delete|create|copy|check")
91
92 parser.add_option(
93 "-l", "--launchpad", dest="launchpad_instance", default="production")
94@@ -443,7 +494,7 @@
95
96 options, args = parser.parse_args()
97
98- possible_actions = ('query', 'add', 'delete', 'create', 'check')
99+ possible_actions = ('query', 'add', 'delete', 'create', 'copy', 'check')
100
101 if len(args) != 1:
102 parser.error(

Subscribers

People subscribed via source and target branches