Merge lp:~jtv/launchpad/db-bug-768342 into lp:launchpad/db-devel
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10473 |
Proposed branch: | lp:~jtv/launchpad/db-bug-768342 |
Merge into: | lp:launchpad/db-devel |
Prerequisite: | lp:~jtv/launchpad/db-bug-735621 |
Diff against target: |
88 lines (+32/-15) 2 files modified
lib/lp/archivepublisher/scripts/generate_contents_files.py (+27/-10) lib/lp/services/command_spawner.py (+5/-5) |
To merge this branch: | bzr merge lp:~jtv/launchpad/db-bug-768342 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+58685@code.launchpad.net |
This proposal supersedes a proposal from 2011-04-21.
Commit message
[r=allenap][bug=768342] Log "live" output when generate-contents script runs apt-ftparchive.
Description of the change
= Summary =
The generate-contents script runs apt-ftparchive, which may take a long time. It's not very nice to save up all its log output and dump it just once at the end: we want live output.
== Proposed fix ==
Luckily this is all neatly isolated in a function called "execute." I replaced its subprocess.Popen implementation with one based on CommandSpawner (and its helpful friends for logging and result tracking).
== Pre-implementation notes ==
This was Julian's one gripe from testing the branch for bug 735621, currently landing, which is a requisit for this one. We couldn't think of any meaningful tests for it, since I just re-implemented an existing, tested function.
== Implementation details ==
CommandSpawner is really meant for running multiple commands in parallel, but there's nothing against using it for just one.
== Tests ==
{{{
./bin/test -vvc lp.archivepubli
}}}
== Demo and Q/A ==
Run the generate-contents script on dogfood (or some other sizable archive) and watch its output. It won't be exactly per-line granularity because of buffering, but there should be some output from apt-ftparchive before it completes.
= Launchpad lint =
This lint was previously present and is, as far as I can see, inevitable:
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical
lib/lp/
lib/lp/
lib/canonical
cronscripts/
cronscripts/
scripts/
cronscripts/
lib/lp/
./lib/canonical
536: Line exceeds 78 characters.
619: Line exceeds 78 characters.
995: Line exceeds 78 characters.
1084: Line exceeds 78 characters.
./cronscripts/
4: Line exceeds 78 characters.
5: Line exceeds 78 characters.
./scripts/
8: '_pythonpath' imported but unused
I like CommandSpawner :)