Merge lp://staging/~jtv/launchpad/db-bug-771727 into lp://staging/launchpad/db-devel

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 10485
Proposed branch: lp://staging/~jtv/launchpad/db-bug-771727
Merge into: lp://staging/launchpad/db-devel
Diff against target: 61 lines (+14/-5)
2 files modified
lib/lp/archivepublisher/scripts/generate_contents_files.py (+2/-5)
lib/lp/archivepublisher/tests/test_generate_contents_files.py (+12/-0)
To merge this branch: bzr merge lp://staging/~jtv/launchpad/db-bug-771727
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+59203@code.staging.launchpad.net

Commit message

[r=lifeless][bug=771727] Also generate contents for the release pocket.

Description of the change

= Summary =

The new, python-based generate-contents-files (a conversion from a bash script) was not generating contents files for release pockets.

The cause: the old script used lp-query-distro to get the distribution's pocket suffixes *except the empty ones* (the release pocket doesn't have a suffix) and then computed the distribution's suites by adding the suite name, plus for each pocket suffix, the suite with the pocket suffix attached. So effectively we had code to take the release pocket out of the list and then other code to put it back in. In converting the bash code to python I missed this subtlety.

== Proposed fix ==

Don't use LpQueryDistro at all. Use what it uses: pocketsuffix.values().

== Pre-implementation notes ==

Spotted by wgrant. At first we thought the empty suffix was lost in split()ing the output from LpQueryDistro. But since it would be (both in a python split() and in a shell script) the empty suffix wasn't even in there.

== Implementation details ==

The method wasn't individually tested, so that part is easy. I added a test to prove that the release pocket is included, which duly fails without the fix.

== Tests ==

{{{
./bin/test -vvc lp.archivepublisher.tests.test_generate_contents_files
}}}

== Demo and Q/A ==

Apart from this, the script seems to work. Both Julian and William have tried it on dogfood.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/archivepublisher/tests/test_generate_contents_files.py
  lib/lp/archivepublisher/scripts/generate_contents_files.py

Jeroen

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: