pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/47525: fetch from sourceforge fails if user sets ownFTPUSERAGENT

The following reply was made to PR pkg/47525; it has been noted by GNATS.

From: Izumi Tsutsui <>
Subject: Re: pkg/47525: fetch from sourceforge fails if user sets 
Date: Wed, 6 Feb 2013 23:01:50 +0900

 >  I don't know why you want to use such a bogus ("Mozilla/5.0") user agent,
 >  but it is the origin of the fault.
 Why?  It's valid usage and documented environment in ftp(1) man page.
 ftp(1) is not only for pkgsrc.
 >  morr@'s change may rise new other faults, because it will work well with
 >  x11/rxvt-unicode/Makefile r1.41, adding FTPUSERAGENT="NetBSD/ftp".
 >  If other sites also has same problem (empty user-agent is not welcomed),
 >  package using such site as MASTER_SITES will also fail to fetch,
 >  because usually, FTPUSERAGENT environment variable is empty.
 ftp(1) uses FTPUSERAGENT only if getenv(3) returns !NULL.
                if ((useragent=getenv("FTPUSERAGENT")) != NULL) {
                        fetch_printf(fin, "User-Agent: %s\r\n", useragent);
                } else {
                        fetch_printf(fin, "User-Agent: %s/%s\r\n",
                            FTP_PRODUCT, FTP_VERSION);
 If FTPUSERAGENT is set but empty, ftp(1) uses empty USERAGENT.
 If FTPUSERAGENT is unset, ftp(1) uses the default FTP_PRODUCT
 and FTP_VERSION (which is "NetBSD-ftp/20100605") and it has worked
 as you see with the default settings.
 The following patch makes both rxvt-unicode and sourceforge sites happy,
 but I wonder if we should rather fix mk/fetch/fetch script directly.
 Index: mk/fetch/
 RCS file: /cvsroot/pkgsrc/mk/fetch/,v
 retrieving revision 1.58
 diff -u -p -r1.58
 --- mk/fetch/  20 Jan 2013 13:22:59 -0000      1.58
 +++ mk/fetch/  6 Feb 2013 13:54:03 -0000
 @@ -239,10 +239,10 @@ _FETCH_AFTER_ARGS.custom=        ${FETCH_AFTER_
 +_FETCH_CMD=   unset FTPUSERAGENT &&                           \
 +              ${PKGSRC_SETENV} CHECKSUM=${_CHECKSUM_CMD:Q}    \
                CP=${TOOLS_CP:Q}                                \
                ECHO=${TOOLS_ECHO:Q}                            \
 -              FTPUSERAGENT=${FTPUSERAGENT:Q}                  \
                FETCH_CMD=${_FETCH_CMD.${FETCH_USING}:Q}        \
 (btw FTP_VERSION has not been bumped after recent ssl addition)
 Izumi Tsutsui

Home | Main Index | Thread Index | Old Index