Merge lp://staging/~tribaal/launchpad-buildd/apt-proxy-injection into lp://staging/launchpad-buildd

Proposed by Chris Glass
Status: Merged
Merged at revision: 323
Proposed branch: lp://staging/~tribaal/launchpad-buildd/apt-proxy-injection
Merge into: lp://staging/launchpad-buildd
Diff against target: 86 lines (+50/-0)
3 files modified
debian/changelog (+6/-0)
lpbuildd/target/build_livefs.py (+10/-0)
lpbuildd/target/tests/test_build_livefs.py (+34/-0)
To merge this branch: bzr merge lp://staging/~tribaal/launchpad-buildd/apt-proxy-injection
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+335742@code.staging.launchpad.net

Description of the change

This branch adds a "--apt-http-proxy" option to the buildlivefs command, injecting the http proxy it specifies into the chroot (by setting the appropriate env).

This allows speeding up local development of cloud images (for example) significantly by setting up a squid-deb-proxy or similar.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Please can you add a test for this? It should be possible to test the new behaviour in lpbuildd/target/tests/test_build_livefs.py.

Aside from the code review comments below, this is probably fine as far as it goes. However, I'd suggest some follow-up work (which could be in a separate branch).

One of my usual local tweaks to launchpad-buildd is to add this to the end of lpbuildd.target.apt.OverrideSourcesList.run:

        self.backend.copy_in(
            "/etc/apt/apt.conf.d/99proxy", "/etc/apt/apt.conf.d/99proxy")

This isn't totally satisfactory for various reasons, but it's been good enough as a local hack.

Now, if we were to polish this up, the most convenient approach would be if there were an item in the buildd's configuration file that gave a proxy URL. lpbuildd.debian.DebianBuildManager.doSourcesList could turn this into an option passed to override-sources-list, which could then inject an apt.conf.d file if that option is set. If we did that, it would make sense for lpbuildd.livefs to look at that same configuration item and pass the --apt-http-proxy option to buildlivefs too (which as it stands you're presumably having to do manually).

review: Needs Fixing
323. By Chris Glass

Addressed review comments:
* Added test
* Fixed style
* Fixed dch version
* Made --http-proxy a simple option (not a list)

Revision history for this message
Chris Glass (tribaal) wrote :

All comments should be addressed.

Revision history for this message
Colin Watson (cjwatson) :
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