Merge lp:~james-w/launchpad/copy-archive-package-sets into lp:launchpad/db-devel
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | no longer in the source branch. |
Merged at revision: | 9495 |
Proposed branch: | lp:~james-w/launchpad/copy-archive-package-sets |
Merge into: | lp:launchpad/db-devel |
Prerequisite: | lp:~james-w/launchpad/copy-archive-test-refactor |
Diff against target: |
446 lines (+212/-15) 5 files modified
lib/lp/soyuz/adapters/packagelocation.py (+26/-4) lib/lp/soyuz/adapters/tests/test_packagelocation.py (+54/-2) lib/lp/soyuz/model/packagecloner.py (+13/-1) lib/lp/soyuz/scripts/populate_archive.py (+17/-6) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+102/-2) |
To merge this branch: | bzr merge lp:~james-w/launchpad/copy-archive-package-sets |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+28165@code.launchpad.net |
Commit message
--package-set can now be passed to populate_archive to limit the packages copied.
Description of the change
Summary
We want to be able to create copy archives that aren't the full archive.
A way to subset the archive in LP is by packageset, so we make use of that.
Proposed fix
This merge proposal adds a --package-set option to populate_
which can be specified multiple times, and then only copies the packages
contained within the named sets.
Pre-implementation notes
Spoke briefly with Julian.
Implementation details
First PackageLocation was modified to store a list of package sets for the
source. build_package_
on names.
We then hooked that up to the --package-set option to get the list of package
sets the user wants.
The final step is to hook that in to the query that copies the sources. Here we
take care to include the transitive closure of packages across the DAG of package
sets.
Tests
You can run them with
./bin/test -s lp.soyuz.scripts -m test_populatear
and
./bin/test -s lp.soyuz.adapters
Demo and Q/A
None.
lint
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pyflakes notices ==
lib/lp/
112: local variable 'ignore_this' is assigned to but never used
287: local variable 'ignore_result' is assigned to but never used
Hi James,
One minor nitpick but otherwise this branch is r=me.
> === modified file 'lib/lp/ soyuz/adapters/ packagelocation .py' soyuz/adapters/ packagelocation .py 2009-08-28 06:39:38 +0000 soyuz/adapters/ packagelocation .py 2010-06-22 12:11:56 +0000
> --- lib/lp/
> +++ lib/lp/
> @@ -63,6 +66,10 @@
> if self.component is not None:
> result += ' (%s)' % self.component.name
>
> + if self.packagesets:
We should explicitly test len() here, since we know it's going to be a
list even if it's empty.
> + result += ' [%s]' % ( s]),)
> + ", ".join([str(p.name) for p in self.packageset
> +
> return result
>
>