← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Chris Glass has proposed merging lp:~tribaal/launchpad-buildd/apt-proxy-injection into lp:launchpad-buildd.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~tribaal/launchpad-buildd/apt-proxy-injection/+merge/335742

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.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~tribaal/launchpad-buildd/apt-proxy-injection into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog	2017-11-29 14:19:20 +0000
+++ debian/changelog	2018-01-05 11:56:36 +0000
@@ -1,3 +1,9 @@
+launchpad-buildd (157ubuntu1) UNRELEASED; urgency=medium
+
+  * Add support for passing apt proxies to the debootstrap/chroot.
+
+ -- Christopher Glass (Ubuntu) <tribaal@xxxxxxxxxx>  Fri, 05 Jan 2018 12:49:11 +0100
+
 launchpad-buildd (157) xenial; urgency=medium
 
   [ Colin Watson ]

=== modified file 'lpbuildd/target/build_livefs.py'
--- lpbuildd/target/build_livefs.py	2017-11-13 16:07:55 +0000
+++ lpbuildd/target/build_livefs.py	2018-01-05 11:56:36 +0000
@@ -58,6 +58,9 @@
             "--extra-ppa", dest="extra_ppas", default=[], action="append",
             help="use this additional PPA")
         parser.add_argument(
+            "--apt-http-proxy", dest="http_proxy", default=[], action="append",
+            help="use this http proxy for apt.")
+        parser.add_argument(
             "--debug", default=False, action="store_true",
             help="enable detailed live-build debugging")
 
@@ -127,6 +130,12 @@
                 lb_env["PROPOSED"] = "1"
             if self.args.extra_ppas:
                 lb_env["EXTRA_PPAS"] = " ".join(self.args.extra_ppas)
+            if self.args.http_proxy:
+                proxy_dict = {
+                    "http_proxy": self.args.http_proxy,
+                    "LB_APT_HTTP_PROXY": self.args.http_proxy}
+                lb_env.update(proxy_dict)
+                base_lb_env.update(proxy_dict)
             self.run_build_command(["lb", "config"], env=lb_env)
             self.run_build_command(["lb", "build"], env=base_lb_env)