Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70028 - [PATCH] PORTAGE_BINHOST with custom FTP-port doesn't work
Summary: [PATCH] PORTAGE_BINHOST with custom FTP-port doesn't work
Status: RESOLVED OBSOLETE
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 267377 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-04 02:25 UTC by Patrik Kullman
Modified: 2013-01-28 22:29 UTC (History)
1 user (show)

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


Attachments
Patch for getbinpkg.patch to support port in HTTP/HTTPS/FTP (getbinpkg.patch,917 bytes, patch)
2004-11-04 03:14 UTC, Patrik Kullman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Kullman 2004-11-04 02:25:24 UTC
If specifying a custom port for PORTAGE_BINHOST, I get the following:

Fetching binary packages info...
Traceback (most recent call last):
  File "/usr/bin/emerge", line 2899, in ?
    mydepgraph=depgraph(myaction,myopts)
  File "/usr/bin/emerge", line 866, in __init__
    portage.db["/"]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts))
  File "/usr/lib/portage/pym/portage.py", line 5647, in populate
    self.remotepkgs = getbinpkg.dir_get_metadata(settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
  File "/usr/lib/portage/pym/getbinpkg.py", line 414, in dir_get_metadata
    conn,protocol,address,params,headers = create_conn(baseurl, conn)
  File "/usr/lib/portage/pym/getbinpkg.py", line 123, in create_conn
    conn = ftplib.FTP(host)
  File "/usr/lib/python2.3/ftplib.py", line 107, in __init__
    self.connect(host)
  File "/usr/lib/python2.3/ftplib.py", line 117, in connect
    for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
socket.gaierror: (-2, 'Name or service not known')
Comment 1 Brian Harring (RETIRED) gentoo-dev 2004-11-04 02:30:46 UTC
emerge info, and the PORTAGE_BINHOST string please (need to know how you specified it).
Comment 2 Patrik Kullman 2004-11-04 02:38:50 UTC
Portage 2.0.51-r2 (default-linux/x86/2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-paprik1 i686)
=================================================================
System uname: 2.6.9-gentoo-paprik1 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -msse -msse2 -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -funroll-loops -pipe -mmmx -msse -msse2 -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc distlocks getbinpkg sandbox sfperms"
GENTOO_MIRRORS="http://mirror.pudas.net/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac aalib acpi alsa amd apache2 avi berkdb bindist bitmap-fonts bonobo cairo cddb cdr chroot clamav client crypt cups curl dga divx4linux dnd eds encode esd evo f77 faac faad fam ffmpeg flac flash foomaticdb freetype fs gb gd gdbm geoip gif gimp gimpprint gnome gnomedb gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal icq imagemagick imap imlib imlib2 irmc jabber java javascript jp2 jpeg junit ldap libg++ libwww live mad matroska mdb mikmod mmx mmx2 mng mono motif mozcalendar mozilla moznocompose moznoirc moznomail mozp3p mozsvg mozxmlterm mpeg mpeg4 mplayer msn mysql mythtv nas ncurses net network nls ntlm nvidia oav offensive oggvorbis openal opengl operanom2 oscar oss pam passfile pdflib perl png pnp ppds python quicktime quotes readline rtc samba sasl sdl silc slang slp snmp speex spell sqlite sse sse2 ssl svg svga tetex theora tiff truetype type1 unicode usb v4l v4l2 vim-with-x virus-scan wmf wxwin wxwindows x86 xforms xml xml2 xosd xprint xv xvid xvmc zlib"

PORTAGE_BINHOST="ftp://binpkg:binftp@digimyth.yes.nu:2121/pentium4"

In getbinpkg.py, a port argument is never splitted out from "host" and never submitted to ftplib..
Comment 3 Patrik Kullman 2004-11-04 02:57:29 UTC
Ok I've patched my getbinpkg.py to support port, but when checking the source, I realized that ftp://binpkg:binftp@213.89.77.37*:2121/pentium4/All/ would be the proper way to specify PASV mode, though it only strips out the * after hostname when using ftplib, not when it calls wget.. will check if there's possible to tell wget not to use the * or if it has to be solved in another way.
Comment 4 Patrik Kullman 2004-11-04 03:14:26 UTC
Created attachment 43277 [details, diff]
Patch for getbinpkg.patch to support port in HTTP/HTTPS/FTP

Self-explanatory patch
Comment 5 Patrik Kullman 2004-11-05 01:49:33 UTC
After going through the source more thoroughly, my suggestion is that a variable in /etc/make.conf should be read instead.

Maybe a boolean FETCH_PASSIVE that affects both the standard FETCHCOMMAND and getbinpkg?
Comment 6 moowei 2005-03-22 21:37:55 UTC
looks like this bug was discovered long time ago. I just encountered the same problem. Is is going to be fixed in portage?

my PORTAGE_BINHOST looks like
PORTAGE_BINHOST="anonymous:pass@192.168.1.4:2121/"

portage gives me this same error message as above.
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2007-06-29 07:34:11 UTC
Zac: you know that code better, opinion on this one?
Comment 8 Zac Medico gentoo-dev 2007-07-01 16:07:43 UTC
(In reply to comment #4)
> Created an attachment (id=43277) [edit]
> Patch for getbinpkg.patch to support port in HTTP/HTTPS/FTP
> 
> Self-explanatory patch

The patch looks good enough to commit.

(In reply to comment #5)
> After going through the source more thoroughly, my suggestion is that a
> variable in /etc/make.conf should be read instead.
> 
> Maybe a boolean FETCH_PASSIVE that affects both the standard FETCHCOMMAND and
> getbinpkg?
> 

Is that directly related to this bug?  Bug 167902 has been filed wrt failures with servers that don't allow PASV.  I wonder why passive mode shouldn't always be default since it works nicely when the client is using network address translation (unlike active mode).
Comment 9 SpanKY gentoo-dev 2013-01-28 22:23:28 UTC
(In reply to comment #8)

time to push it in then ? :)
Comment 10 SpanKY gentoo-dev 2013-01-28 22:23:48 UTC
*** Bug 267377 has been marked as a duplicate of this bug. ***
Comment 11 Zac Medico gentoo-dev 2013-01-28 22:29:15 UTC
The this patch is obsolete, since the affected code has been disabled since bug #438640 here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d159be545ecb431addc3e7bb31a8ed8cfd9984af