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

Proposed by Dennis Kaarsemaker
Status: Needs review
Proposed branch: lp:~dennis/update-notifier/apt-proxies
Merge into: lp:update-notifier/ubuntu
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 (community) Needs Information
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.
Revision history for this message
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
Revision history for this message
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

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
1=== modified file 'data/package-data-downloader'
2--- data/package-data-downloader 2014-04-09 19:23:31 +0000
3+++ data/package-data-downloader 2014-05-03 08:05:55 +0000
4@@ -183,6 +183,13 @@
5 proxies = {}
6 try:
7 for proto in ('http','https','ftp'):
8+ pkey = 'Acquire::%s::proxy' % proto
9+ sp = subprocess.Popen(['/usr/bin/apt-config', 'dump', pkey], stdout=subprocess.PIPE)
10+ out, _ = sp.communicate()
11+ for line in out.strip().splitlines():
12+ key, val = line.split(None, 1)
13+ if key.lower() == pkey.lower():
14+ proxies[proto] = val[1:-2]
15 try:
16 proxies[proto] = os.environ[proto+"_proxy"]
17 except KeyError:

Subscribers

People subscribed via source and target branches

to all changes: