<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 31/03/11 15:00, Axel Beckert wrote:
    <blockquote cite="mid:20110331140059.GD12557@sym.noone.org"
      type="cite">
      <pre wrap="">Hi Alex,

Alex Tomlins wrote:
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">I've implemented this here:
<a class="moz-txt-link-freetext" href="https://gitorious.org/~alext/xen-tools/alext-xen-tools/commits/apt_proxy">https://gitorious.org/~alext/xen-tools/alext-xen-tools/commits/apt_proxy</a>
</pre>
          </blockquote>
          <pre wrap="">Thanks!

 From a first glance it looks good and I'll probably include your
patches. I'd though change two things:

* Change the option's name from apt_proxy to apt-proxy.
</pre>
        </blockquote>
        <pre wrap="">Makes sense.  I wasn't sure which way to go as the existing options seem  
to use a mixture.
</pre>
      </blockquote>
      <pre wrap="">
Well, yeah, historically grown. But I'd prefer to not have underscores
in long options. Maybe we'll once change all of them to dashes, but
supoort underscores for backwards-compatibility.

</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">* Instead of prepending the environment variable to some command, I'd
   prefer to use $ENV{http_proxy}, etc.
</pre>
        </blockquote>
        <pre wrap="">I was mostly being cautious there to make sure it didn't effect anything  
else (as the proxy is typically an apt-cacher type proxy, and not a  
general http proxy).
</pre>
      </blockquote>
      <pre wrap="">
Yeah, and for using $ENV{http_proxy} the opposite was the reason. I
thought it would be good if then anything uses the proxy in general.

But maybe it would be also good to distinguish between 

1) proxy setting for the installation (which happens on the Dom0)
2) proxy setting for the DomU (after installation)
3) all other things (if there are any)

</pre>
    </blockquote>
    In my use case, the apt_proxy would be an apt-cacher-ng installation
    (e.g. <a class="moz-txt-link-freetext" href="http://apt-cache:3142">http://apt-cache:3142</a>), which only supports accessing apt
    repositories, and doesn't work as a general http proxy.  I combine
    this with setting cache=no in xen-tools.conf to avoid duplicating
    the caching of .debs.<br>
    <br>
    Before I'd gone down this route i'd been setting the http_proxy
    before calling xen-create-image, and this mostly worked, but I found
    some of my role scripts were breaking when trying to install ruby
    gems for example.<br>
    <br>
    so for the above 1 and 2 would use an apt proxy/cache (but could
    also use a standard proxy)<br>
    3 (e.g. stuff in role scripts) would have to be a generic http
    proxy.<br>
    <br>
    It would be good if debootstrap had an option to specify a proxy,
    but I couldn't see one, so I went for using the http_proxy env
    variable.<br>
    <blockquote cite="mid:20110331140059.GD12557@sym.noone.org"
      type="cite">
      <pre wrap=""></pre>
      <blockquote type="cite">
        <pre wrap="">Having had a closer look, I can't see it effecting  
anything else, so I'll push that change up as well
</pre>
      </blockquote>
      <pre wrap="">
Your arguments made think a little bit more about this issue. Not sure
though, what's the best way to handle it.

                Regards, Axel
</pre>
    </blockquote>
    Maybe a solution would be to set the http_proxy ENV variable before
    the call to debootstrap, and then restore the original value
    (if_any) afterwards.<br>
    <br>
    This would mean that cases 1 and 2 would use the apt-proxy setting,
    and case 3 would the Dom0's http_proxy ENV variable.<br>
    <br>
    thanks,<br>
    Alex<br>
    <br>
    P.S. I've stopped copying the bug report as this is getting somewhat
    off-topic.<br>
    <br>
    <div class="moz-signature">-- <br>
      <table style="width: 98%; margin-top: 10px; font-family:
        arial,sans;" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td style="border-bottom: 1px solid black; font-size: 20px;
              line-height: 28px; font-family: Trebuchet MS,arial,sans;"
              valign="bottom">Alex Tomlins</td>
            <td style="border-bottom: 1px solid black;" align="right">
              <table style="width: 145px;" width="145px" align="right"
                border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td style="font-family: Trebuchet MS,arial,sans;
                      font-weight: bold; font-size: 35px; color: rgb(0,
                      0, 0); letter-spacing: -1px; height: 27px;
                      line-height: 27px;" valign="top" height="27px"
                      align="right"> Unboxed </td>
                  </tr>
                  <tr>
                    <td style="font-family: Trebuchet MS,arial,sans;
                      font-weight: bold; font-size: 30px; color:
                      rgb(146, 39, 143); letter-spacing: -1px; height:
                      42px; line-height: 27px;" valign="top"
                      height="42px;" align="right"> Consulting </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
          <tr>
            <td style="border-top: 4px solid white;" valign="top"
              align="left">
              <table style="font-size: 12px; font-family: arial;"
                align="left" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td style="width: 16px; color: rgb(146, 39, 143);">E:</td>
                    <td> <a
                        href="mailto:alex.tomlins@unboxedconsulting.com"
                        style="color: black; text-decoration: none;">alex.tomlins@unboxedconsulting.com</a></td>
                  </tr>
                  <tr>
                    <td style="width: 16px; color: rgb(146, 39, 143);">M:</td>
                    <td>+44 7824 696 890</td>
                  </tr>
                  <tr>
                    <td style="width: 16px; color: rgb(146, 39, 143);">T:</td>
                    <td>+44 20 3137 2930</td>
                  </tr>
                  <tr>
                    <td style="width: 16px; color: rgb(146, 39, 143);">F:</td>
                    <td>+44 20 7183 4251</td>
                  </tr>
                </tbody>
              </table>
            </td>
            <td style="font-size: 12px; font-family: arial; border-top:
              4px solid white;" valign="top" align="right">
              <table style="font-size: 12px; font-family: arial;"
                align="right" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td align="right">17 Blossom Street</td>
                  </tr>
                  <tr>
                    <td align="right">London, E1 6PL</td>
                  </tr>
                  <tr>
                    <td align="right">United Kingdom</td>
                  </tr>
                  <tr>
                    <td align="right"><a style="color: rgb(146, 39,
                        143); text-decoration: none;"
                        href="http://www.unboxedconsulting.com">www.unboxedconsulting.com</a></td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>