ports/154770: [patch] Mk/bsd.port.mk: do-fetch fails on ftp:// transfers with ftp(1) fallback

Anonymous swell.k at gmail.com
Mon Feb 14 08:10:08 UTC 2011


>Number:         154770
>Category:       ports
>Synopsis:       [patch][regression] Mk/bsd.port.mk: do-fetch fails on ftp:// transfers with ftp(1) fallback
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 14 08:10:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
/head at r218673M and 8.2-RC3
FTP_PASSIVE_MODE=YES (set by default from login.conf)
>Description:
When restarting ftp:// transfer ftp(1)'s reget wants local file to exists.
This doesn't affect http:// and file:// transfers.

Introduced by `-R' option from ports/109966.
>How-To-Repeat:
$ sudo mv /usr/bin/fetch /tmp
$ cd devel/gettext
$ make checksum DISTDIR=/tmp MASTER_SITES= MASTER_SITE_OVERRIDE=
===>  License check disabled, port has not defined LICENSE
=> gettext-0.18.1.1.tar.gz doesn't seem to exist in /tmp/.
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles//gettext-0.18.1.1.tar.gz
Trying 204.152.184.73...
Connected to ftp.FreeBSD.org.
220 Welcome to freebsd.isc.org.
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
250 Directory successfully changed.
250-If you're looking for one of the FreeBSD releases, please look in the
250-releases/${ARCH}/${RELNAME} directory, where ARCH = "alpha", "amd64",
250-"i386", "ia64", "pc98", or "sparc64" and RELNAME = the release
250-you're interested in, e.g. "7.1-RELEASE" or "8.0-RELEASE".
250 Directory successfully changed.
250 Directory successfully changed.
250 Directory successfully changed.
ftp: local: gettext-0.18.1.1.tar.gz: No such file or directory
221 Goodbye.
cannot open gettext-0.18.1.1.tar.gz: No such file or directory
*** Error code 2

Stop in /usr/ports/devel/gettext.

$ touch /tmp/gettext-0.18.1.1.tar.gz
$ make checksum FETCH_REGET=1 DISTDIR=/tmp MASTER_SITES= MASTER_SITE_OVERRIDE=
===>  License check disabled, port has not defined LICENSE
=> SHA256 Checksum mismatch for gettext-0.18.1.1.tar.gz.
===>  Refetch for 1 more times files: gettext-0.18.1.1.tar.gz
===>  License check disabled, port has not defined LICENSE
=> gettext-0.18.1.1.tar.gz doesn't seem to exist in /tmp/.
=> Attempting to fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles//gettext-0.18.1.1.tar.gz
Trying 204.152.184.73...
Connected to ftp.FreeBSD.org.
220 Welcome to freebsd.isc.org.
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
250 Directory successfully changed.
250-If you're looking for one of the FreeBSD releases, please look in the
250-releases/${ARCH}/${RELNAME} directory, where ARCH = "alpha", "amd64",
250-"i386", "ia64", "pc98", or "sparc64" and RELNAME = the release
250-you're interested in, e.g. "7.1-RELEASE" or "8.0-RELEASE".
250 Directory successfully changed.
250 Directory successfully changed.
250 Directory successfully changed.
local: gettext-0.18.1.1.tar.gz remote: gettext-0.18.1.1.tar.gz
229 Entering Extended Passive Mode (|||13757|).
150 Opening BINARY mode data connection for gettext-0.18.1.1.tar.gz (15139737 bytes).
100% |************************************| 14784 KB  106.64 KB/s    00:00 ETA
226 File send OK.
15139737 bytes received in 02:18 (106.48 KB/s)
221 Goodbye.
===>  License check disabled, port has not defined LICENSE
=> SHA256 Checksum OK for gettext-0.18.1.1.tar.gz.
>Fix:
Don't restart any proto transfer as reget is disabled by default in
bsd.port.mk, anyway.

--- a.diff begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /a/.cvsup/ports/Mk/bsd.port.mk,v
retrieving revision 1.668
diff -u -p -u -p -r1.668 Mk/bsd.port.mk
--- Mk/bsd.port.mk	7 Feb 2011 13:50:13 -0000	1.668
+++ Mk/bsd.port.mk	14 Feb 2011 06:03:45 -0000
@@ -2321,7 +2332,7 @@ FETCH_BEFORE_ARGS+=	$${CKSIZE:+-S $$CKSI
 .endif
 .else
 FETCH_BINARY?=	/usr/bin/ftp
-FETCH_ARGS?=	-R
+FETCH_ARGS?=	# none
 FETCH_REGET?=	0
 .endif
 FETCH_CMD?=		${FETCH_BINARY} ${FETCH_ARGS}
--- a.diff ends here ---

Alternatively, one can make reget to get the file if it doesn't exist
similar to other protos.

--- b.diff begins here ---
Index: contrib/lukemftp/src/cmds.c
===================================================================
--- contrib/lukemftp/src/cmds.c	(revision 218674)
+++ contrib/lukemftp/src/cmds.c	(working copy)
@@ -611,7 +611,8 @@ getit(int argc, char *argv[], int restartit, const
 		if (restartit == 1) {
 			if (ret < 0) {
 				warn("local: %s", locfile);
-				goto freegetit;
+				mode = "w";
+				goto get;
 			}
 			restart_point = stbuf.st_size;
 		} else {
@@ -629,6 +630,7 @@ getit(int argc, char *argv[], int restartit, const
 		}
 	}
 
+ get:
 	recvrequest("RETR", locfile, remfile, mode,
 	    remfile != argv[1] || locfile != argv[2], loc);
 	restart_point = 0;
--- b.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list