On Wed, Oct 16, 2013 at 10:39:06PM -0300, Lisandro Damián Nicanor Pérez Meyer wrote: > Package: apt > Version: 0.8.0 > Severity: wishlist
Thanks for your bugreport. > Acquire::http::ProxyAutoDetect has become very handy for autodetecting > networks with apt-cachers like ACNG (see for example squid-deb-proxy). > > In other words, allows painless proxy discovery for those of us proxy > impaired. > > Saddly it is not documented in apt.conf(5). Being documented would help in > implementations like the one described in #726430. Indeed, how do you like the attach (mostly) documentation patch? If that covers your needs I will merge it into the debian/sid branch. Cheers, Michael > Thanks, Lisandro. > > -- System Information: > Debian Release: jessie/sid > APT prefers unstable > APT policy: (990, 'unstable'), (500, 'testing'), (101, 'experimental') > Architecture: amd64 (x86_64) > Foreign Architectures: i386 > > Kernel: Linux 3.10.11+edid (SMP w/2 CPU cores) > Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/bash > > Versions of packages apt depends on: > ii debian-archive-keyring 2012.4 > ii gnupg 1.4.15-1 > ii libapt-pkg4.12 0.9.12.1 > ii libc6 2.17-93 > ii libgcc1 1:4.8.1-10 > ii libstdc++6 4.8.1-10 > > apt recommends no packages. > > Versions of packages apt suggests: > pn apt-doc <none> > ii aptitude 0.6.8.2-1.2 > ii dpkg-dev 1.17.1 > ii python-apt 0.8.9.1+b1 > ii xz-utils 5.1.1alpha+20120614-2 > > -- no debconf information > > > -- > To UNSUBSCRIBE, email to deity-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org > Archive: > http://lists.debian.org/20131017013906.18704.95742.report...@luna.lisandropm.com.ar >
>From fb099a0b8dc1844a2141f7340db93b6adf9e0b14 Mon Sep 17 00:00:00 2001 From: Michael Vogt <m...@debian.org> Date: Sat, 19 Oct 2013 18:29:59 +0200 Subject: [PATCH] add Acquire::http::Proxy-Auto-Detect to the apt.conf.5 manpage (closes: 726597) --- doc/apt-verbatim.ent | 6 ++++++ doc/apt.conf.5.xml | 8 ++++++++ methods/http.cc | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index c9bb061..0d0d95c 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -124,6 +124,12 @@ </citerefentry>" > +<!ENTITY squid-deb-proxy-client "<citerefentry> + <refentrytitle><command>squid-deb-proxy-client</command></refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry>" +> + <!ENTITY debsign "<citerefentry> <refentrytitle><command>debsign</command></refentrytitle> <manvolnum>1</manvolnum> diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 42119ba..e8da666 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -396,6 +396,14 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; <para><literal>Acquire::http::User-Agent</literal> can be used to set a different User-Agent for the http download method as some proxies allow access for clients only if the client uses a known identifier.</para> + + <para><literal>Acquire::http::Proxy-Auto-Detect</literal> can be used to + specify a external command to discover the http proxy to use. Apt expects + the command to output the proxy on stdout in the style + <literal>http://proxy:port/</literal>. See the + &squid-deb-proxy-client; package for a example implementation that + uses avahi.</para> + </listitem> </varlistentry> diff --git a/methods/http.cc b/methods/http.cc index 278ddb2..5622c33 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -1108,7 +1108,6 @@ bool HttpMethod::Configuration(string Message) PipelineDepth = _config->FindI("Acquire::http::Pipeline-Depth", PipelineDepth); Debug = _config->FindB("Debug::Acquire::http",false); - AutoDetectProxyCmd = _config->Find("Acquire::http::ProxyAutoDetect"); // Get the proxy to use AutoDetectProxy(); @@ -1373,6 +1372,11 @@ int HttpMethod::Loop() /* */ bool HttpMethod::AutoDetectProxy() { + // option is "Acquire::http::Proxy-Auto-Detect" but we allow the old + // name without the dash ("-") + AutoDetectProxyCmd = _config->Find("Acquire::http::Proxy-Auto-Detect", + _config->Find("Acquire::http::ProxyAutoDetect")); + if (AutoDetectProxyCmd.empty()) return true; -- 1.8.3.2