Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61845 - [PATCH] --getbinpkg doesn't support $http_proxy
Summary: [PATCH] --getbinpkg doesn't support $http_proxy
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks: 377365
  Show dependency tree
 
Reported: 2004-08-26 12:03 UTC by Elan Ruusamäe
Modified: 2013-04-10 16:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for the version 2.0.51.22-r1, applied to lib/portage/pym/getbinpkg.py (proxy_squid_workaround.patch,3.24 KB, patch)
2005-09-27 15:03 UTC, André Luiz A. G. Carvalho
Details | Diff
The corrected proposed patch... (proxy2.patch,3.21 KB, patch)
2005-11-08 06:01 UTC, André Luiz A. G. Carvalho
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elan Ruusamäe 2004-08-26 12:03:21 UTC
i have PORTAGE_BINHOST pointing to http url where the .tbz2 files reside, defined in /etc/make.conf
and when i run 'emerge -u world -gk -vpt' it will not respect $http_proxy set via env, via /etc/make.conf and thus failing to fetch packages info. 

i also tried to set FETCH_COMMAND in /etc/make.conf to wget (wget works fine with proxy), but seems that the 'info fetching phase' is done by portage itself (compared the useragent string in apache log)


X.X.X.X - - [26/Aug/2004:21:20:58 +0300] "GET /HOSTNAME/ HTTP/1.1" 200 75877 "-" "-"
X.X.X.X - - [26/Aug/2004:21:21:14 +0300] "GET /HGOSTNAME/kdebase-3.2.3-r1.tbz2 HTTP/1.0" 200 20229076 "-" "Wget/1
.9"





Reproducible: Always
Steps to Reproduce:
1. define PORTAGE_BINHOST in /etc/make.conf
2. set http_proxy pointing to some working proxy. also check that no_proxy does not exclude $PORTAGE_BINHOST
3. run emerge -guk world -vpt
4. see which ip you have in apache log of $PORTAGE_BINHOST, proxy or real ip where you ran 'emerge'



Expected Results:  
portage to use $http_proxy all the time :)
Comment 1 Elan Ruusamäe 2004-08-26 12:13:58 UTC
using portage-2.0.50-r10,

PORTAGE_BINHOST="http://gentoo.XXX.TLD/HOSTNAME/" from /etc/make.conf
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2004-10-09 20:54:23 UTC
Try this patch.

http://zarquon.twobit.net/gentoo/portage/getbinpkg.py.diff
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-16 20:43:23 UTC
(In reply to comment #2)
> Try this patch.
> 
> http://zarquon.twobit.net/gentoo/portage/getbinpkg.py.diff

Did that patch actually work for anyone, is there someone who uses BINHOST who 
can test it?
Comment 4 André Luiz A. G. Carvalho 2005-09-27 15:03:41 UTC
Created attachment 69378 [details, diff]
Patch for the version 2.0.51.22-r1, applied to lib/portage/pym/getbinpkg.py

This patch contains the code to make the http_proxy variable work, but it
doesn't get the value from make.conf, since this would be a much larger patch.

It also has a workaround for the strange squid behavior when making requests
with suffix range, as in Range: bytes=-3000, which is the most frequent case in
getbinpkg.py. 

Squid randomly gets the whole file and sends to the client, sometimes, this
caused my first patch to crash with MemoryError when trying to get metadata
from large packages such as OpenOffice.
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2005-11-08 04:50:21 UTC
Patch looks good. One question though; what's the "Do not send user/password 
here" about? 
Comment 6 André Luiz A. G. Carvalho 2005-11-08 06:01:16 UTC
Created attachment 72451 [details, diff]
The corrected proposed patch...

The "Do not send password here" is for not sending the password as a URL. This
is because it goes in a header and encoded.
But it should be as this one I'm sending now, and not with the line that do
this commented out. :)
Now I think it's ok.
Comment 7 白川間瀬流 2011-05-10 11:56:21 UTC
Is this fixed in the recent stable portage version?

If so, this bug can be closed =)
Comment 8 Zac Medico gentoo-dev 2013-04-10 16:08:03 UTC
This looks like it may be a duplicate of bug 438640. Please re-open if it's still an issue.