Merge lp:~dennis/update-notifier/apt-proxies into lp:update-notifier

Proposed by Dennis Kaarsemaker on 2014-05-03
Status: Needs review
Proposed branch: lp:~dennis/update-notifier/apt-proxies
Merge into: lp:update-notifier
Diff against target: 17 lines (+7/-0)
1 file modified
data/package-data-downloader (+7/-0)
To merge this branch: bzr merge lp:~dennis/update-notifier/apt-proxies
Reviewer Review Type Date Requested Status
Michael Vogt Needs Information on 2014-06-05
Dennis Kaarsemaker Pending
Review via email: mp+218180@code.launchpad.net

Description of the change

Respect Acquire::http::proxy and friends

It's really annoying when apt-get works just fine, but the package-data-downloader fails because they look at different proxy settings.

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Hey Dennis, nice to see you again :)

I like your branch and I think its indeed pretty anoying that the data downloader does not use the native apt proxy setup. I think we could do even better by using the apt acquire system to download the file(s). I outlined this here: lp:~mvo/update-notifier/use-apt-helper. This will also make sure we support e.g. the auto proxy discovery.

What do you think? Could you give the alternative implemenation a testrun and let me know if it honors the proxy for you?

review: Needs Information
Dennis Kaarsemaker (dennis) wrote :

On do, 2014-06-05 at 14:16 +0000, Michael Vogt wrote:
> Review: Needs Information
>
> Hey Dennis, nice to see you again :)
>
> I like your branch and I think its indeed pretty anoying that the data
> downloader does not use the native apt proxy setup. I think we could
> do even better by using the apt acquire system to download the
> file(s). I outlined this here: lp:~mvo/update-notifier/use-apt-helper.
> This will also make sure we support e.g. the auto proxy discovery.
>
> What do you think? Could you give the alternative implemenation a
> testrun and let me know if it honors the proxy for you?

That works just fine for me, I'd prefer your solution over mine.
--
Dennis Kaarsemaker
http://www.kaarsemaker.net

Unmerged revisions

847. By Dennis Kaarsemaker on 2014-05-03

Respect Acquire::http::proxy and friends

It's really annoying when apt-get works just fine, but the
package-data-downloader fails because they look at different proxy settings.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/package-data-downloader'
--- data/package-data-downloader 2014-04-09 19:23:31 +0000
+++ data/package-data-downloader 2014-05-03 08:05:55 +0000
@@ -183,6 +183,13 @@
183 proxies = {}183 proxies = {}
184 try:184 try:
185 for proto in ('http','https','ftp'):185 for proto in ('http','https','ftp'):
186 pkey = 'Acquire::%s::proxy' % proto
187 sp = subprocess.Popen(['/usr/bin/apt-config', 'dump', pkey], stdout=subprocess.PIPE)
188 out, _ = sp.communicate()
189 for line in out.strip().splitlines():
190 key, val = line.split(None, 1)
191 if key.lower() == pkey.lower():
192 proxies[proto] = val[1:-2]
186 try:193 try:
187 proxies[proto] = os.environ[proto+"_proxy"]194 proxies[proto] = os.environ[proto+"_proxy"]
188 except KeyError:195 except KeyError:

Subscribers

People subscribed via source and target branches

to all changes: