Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 1997 13:04:52 PST
From:      Bill Fenner <fenner@parc.xerox.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/2949: bsd.port.mk needs something like FETCH_ENV?
Message-ID:  <199703112104.NAA09431@fenestro.parc.xerox.com>
Resent-Message-ID: <199703112240.OAA15533@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         2949
>Category:       ports
>Synopsis:       bsd.port.mk needs something like FETCH_ENV?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 11 14:40:02 PST 1997
>Last-Modified:
>Originator:     Bill Fenner
>Organization:
Xerox
>Release:        FreeBSD 2.2-BETA_A i386
>Environment:

	
-current ports tree, behind a firewall

>Description:

	
benchmarks/iozone/Makefile redefines FETCH_CMD to add a variable
to fetch's environment.  However, in order to make sure that fetch
knows how to get through my firewall, I already set FETCH_CMD in
/etc/make.conf.  This means that iozone doesn't work for me.
I suspect that a good solution may be to define FETCH_ENV
and add it to the beginning of ${FETCH_CMD} when running fetch
so that I can have "FETCH_ENV=HTTP_PROXY=wwwproxy:8000" and
iozone can have "FETCH_ENV+=FTP_PASSWORD=president@whitehouse.gov".

>How-To-Repeat:

	
"make fetch" in iozone when you have FETCH_CMD redefinied in /etc/make.conf
and see your definition get overridden.

>Fix:
	
	

Of course, this doesn't help all the ports who use ${FETCH_CMD} to
fetch a file directly.  I don't know if that means that this idea is
broken or using ${FETCH_CMD} directly is broken.

--- bsd.port.mk.orig	Tue Mar 11 12:50:10 1997
+++ bsd.port.mk	Tue Mar 11 12:51:18 1997
@@ -164,6 +164,7 @@
 #
 # FETCH_CMD		  - Full path to ftp/http fetch command if not in $PATH
 #				  (default: /usr/bin/fetch).
+# FETCH_ENV			- Environment to pass to fetch command
 # FETCH_BEFORE_ARGS -
 #				  Arguments to ${FETCH_CMD} before filename (default: none).
 # FETCH_AFTER_ARGS -
@@ -768,7 +769,7 @@
 			${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
 			for site in ${MASTER_SITES}; do \
 			    ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
-				if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
+				if ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
 					continue 2; \
 				fi \
 			done; \
@@ -790,7 +791,7 @@
 			${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
 			for site in ${PATCH_SITES}; do \
 			    ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
-				if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
+				if ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
 					continue 2; \
 				fi \
 			done; \
@@ -1194,7 +1195,7 @@
 	 for file in ${DISTFILES}; do \
 		if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
 			for site in ${MASTER_SITES}; do \
-				${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \
+				${ECHO} -n ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \
 					break; \
 			done; \
 			${ECHO} "echo $${file} not fetched" ; \
@@ -1205,7 +1206,7 @@
 	 for file in ${PATCHFILES}; do \
 		if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
 			for site in ${PATCH_SITES}; do \
-				${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \
+				${ECHO} -n ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \
 					break; \
 			done; \
 			${ECHO} "echo $${file} not fetched" ; \

--- benchmarks/iozone/Makefile.orig	Tue Mar 11 12:51:44 1997
+++ benchmarks/iozone/Makefile	Tue Mar 11 12:52:05 1997
@@ -13,7 +13,7 @@
 DISTFILES=      iozone-2.01.shar.gz
 
 # This site not allows root@<hostname> password
-FETCH_CMD=      FTP_PASSWORD=president@whitehouse.gov /usr/bin/fetch
+FETCH_ENV+=	FTP_PASSWORD=president@whitehouse.gov
 
 MAINTAINER=	jmz@FreeBSD.org
 
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703112104.NAA09431>