Thu Jan 11 08:54:37 2018 UTC ()
Add FETCH_PROXY and FETCH_PROXY.{ftp,http,https}.


(alnsn)
diff -r1.69 -r1.70 pkgsrc/mk/fetch/fetch.mk

cvs diff -r1.69 -r1.70 pkgsrc/mk/fetch/fetch.mk (expand / switch to unified diff)

--- pkgsrc/mk/fetch/fetch.mk 2017/08/01 13:15:32 1.69
+++ pkgsrc/mk/fetch/fetch.mk 2018/01/11 08:54:37 1.70
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: fetch.mk,v 1.69 2017/08/01 13:15:32 jperkin Exp $ 1# $NetBSD: fetch.mk,v 1.70 2018/01/11 08:54:37 alnsn Exp $
2 2
3.if empty(INTERACTIVE_STAGE:Mfetch) && empty(FETCH_MESSAGE:U) 3.if empty(INTERACTIVE_STAGE:Mfetch) && empty(FETCH_MESSAGE:U)
4_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}} 4_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
5.endif 5.endif
6_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}} 6_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
7 7
8# Where to put distfiles that don't have any other master site 8# Where to put distfiles that don't have any other master site
9MASTER_SITE_LOCAL?= ${MASTER_SITE_BACKUP:=LOCAL_PORTS/} 9MASTER_SITE_LOCAL?= ${MASTER_SITE_BACKUP:=LOCAL_PORTS/}
10 10
11# Set up _ORDERED_SITES to work out the exact list of sites for every file, 11# Set up _ORDERED_SITES to work out the exact list of sites for every file,
12# using the dynamic sites script, or ordering according to the master site 12# using the dynamic sites script, or ordering according to the master site
13# list, MASTER_SORT_RANDOM randomization feature, or the patterns in 13# list, MASTER_SORT_RANDOM randomization feature, or the patterns in
14# MASTER_SORT or MASTER_SORT_REGEX as appropriate. 14# MASTER_SORT or MASTER_SORT_REGEX as appropriate.
@@ -187,64 +187,98 @@ fetch-check-interactive: .USEBEFORE @@ -187,64 +187,98 @@ fetch-check-interactive: .USEBEFORE
187# 187#
188# FAILOVER_FETCH, if defined, will cause a checksum to be performed during 188# FAILOVER_FETCH, if defined, will cause a checksum to be performed during
189# a fetch to verify the transferred file is correct; if the checksum 189# a fetch to verify the transferred file is correct; if the checksum
190# is incorrect, then the next site will be tried. 190# is incorrect, then the next site will be tried.
191# 191#
192# PKG_RESUME_TRANSFERS is a yes/no variable that causes the fetch script 192# PKG_RESUME_TRANSFERS is a yes/no variable that causes the fetch script
193# to try to resume interrupted file transfers to avoid downloading 193# to try to resume interrupted file transfers to avoid downloading
194# the whole file. The default is set in pkgsrc/mk/defaults/mk.conf. 194# the whole file. The default is set in pkgsrc/mk/defaults/mk.conf.
195# 195#
196# FETCH_TIMEOUT, if defined, will cause the fetch command to quit on stalled 196# FETCH_TIMEOUT, if defined, will cause the fetch command to quit on stalled
197# connections after the given amount of seconds. 197# connections after the given amount of seconds.
198# The specific behavior depends on the command used. 198# The specific behavior depends on the command used.
199# 199#
 200# FETCH_PROXY
 201# FETCH_PROXY.ftp
 202# FETCH_PROXY.http
 203# FETCH_PROXY.https
 204# If defined, will cause the fetch command to connect over
 205# the specified proxy.
 206# The specific behavior depends on the command used.
 207#
200# FETCH_USE_IPV4_ONLY, if defined, will cause the fetch command to force 208# FETCH_USE_IPV4_ONLY, if defined, will cause the fetch command to force
201# connecting to only IPv4 addresses. 209# connecting to only IPv4 addresses.
202# 210#
203 211
 212.if defined(FETCH_PROXY)
 213FETCH_PROXY.ftp?= ${FETCH_PROXY}
 214FETCH_PROXY.http?= ${FETCH_PROXY}
 215FETCH_PROXY.https?= ${FETCH_PROXY}
 216.endif
 217
204# If this host is behind a filtering firewall, use passive ftp(1) 218# If this host is behind a filtering firewall, use passive ftp(1)
205_FETCH_BEFORE_ARGS.ftp= ${PASSIVE_FETCH:D-p} \ 219_FETCH_BEFORE_ARGS.ftp= ${PASSIVE_FETCH:D-p} \
206 ${FETCH_TIMEOUT:D-q ${FETCH_TIMEOUT}} \ 220 ${FETCH_TIMEOUT:D-q ${FETCH_TIMEOUT}} \
207 ${FETCH_USE_IPV4_ONLY:D-4} 221 ${FETCH_USE_IPV4_ONLY:D-4}
208_FETCH_AFTER_ARGS.ftp= # empty 222_FETCH_AFTER_ARGS.ftp= # empty
209_FETCH_RESUME_ARGS.ftp= -R 223_FETCH_RESUME_ARGS.ftp= -R
210_FETCH_OUTPUT_ARGS.ftp= -o 224_FETCH_OUTPUT_ARGS.ftp= -o
211_FETCH_CMD.ftp= ${TOOLS_PATH.ftp} 225_FETCH_CMD.ftp= ${PKGSRC_SETENV} \
 226 ${FETCH_PROXY.ftp:Dftp_proxy=${FETCH_PROXY.ftp:Q}} \
 227 ${FETCH_PROXY.http:Dhttp_proxy=${FETCH_PROXY.http:Q}} \
 228 ${FETCH_PROXY.https:Dhttps_proxy=${FETCH_PROXY.https:Q}} \
 229 ${TOOLS_PATH.ftp}
212 230
213_FETCH_BEFORE_ARGS.fetch= ${FETCH_TIMEOUT:D-T ${FETCH_TIMEOUT}} \ 231_FETCH_BEFORE_ARGS.fetch= ${FETCH_TIMEOUT:D-T ${FETCH_TIMEOUT}} \
214 ${FETCH_USE_IPV4_ONLY:D-4} 232 ${FETCH_USE_IPV4_ONLY:D-4}
215_FETCH_AFTER_ARGS.fetch= # empty 233_FETCH_AFTER_ARGS.fetch= # empty
216_FETCH_RESUME_ARGS.fetch= -r 234_FETCH_RESUME_ARGS.fetch= -r
217_FETCH_OUTPUT_ARGS.fetch= -o 235_FETCH_OUTPUT_ARGS.fetch= -o
218_FETCH_CMD.fetch= ${TOOLS_PATH.fetch} 236_FETCH_CMD.fetch= ${PKGSRC_SETENV} \
 237 ${FETCH_PROXY.ftp:Dftp_proxy=${FETCH_PROXY.ftp:Q}} \
 238 ${FETCH_PROXY.http:Dhttp_proxy=${FETCH_PROXY.http:Q}} \
 239 ${FETCH_PROXY.https:Dhttps_proxy=${FETCH_PROXY.https:Q}} \
 240 ${TOOLS_PATH.fetch}
219 241
220_FETCH_BEFORE_ARGS.wget= ${PASSIVE_FETCH:D--passive-ftp} \ 242_FETCH_BEFORE_ARGS.wget= ${PASSIVE_FETCH:D--passive-ftp} \
221 --no-check-certificate \ 243 --no-check-certificate \
222 ${FETCH_TIMEOUT:D--timeout=${FETCH_TIMEOUT}} \ 244 ${FETCH_TIMEOUT:D--timeout=${FETCH_TIMEOUT}} \
223 ${FETCH_USE_IPV4_ONLY:D--inet4-only} 245 ${FETCH_USE_IPV4_ONLY:D--inet4-only}
224_FETCH_AFTER_ARGS.wget= # empty 246_FETCH_AFTER_ARGS.wget= # empty
225_FETCH_RESUME_ARGS.wget= -c 247_FETCH_RESUME_ARGS.wget= -c
226_FETCH_OUTPUT_ARGS.wget= -O 248_FETCH_OUTPUT_ARGS.wget= -O
227_FETCH_CMD.wget= ${TOOLS_PATH.wget} 249_FETCH_CMD.wget= ${PKGSRC_SETENV} \
228 250 ${FETCH_PROXY.ftp:Dftp_proxy=${FETCH_PROXY.ftp:Q}} \
 251 ${FETCH_PROXY.http:Dhttp_proxy=${FETCH_PROXY.http:Q}} \
 252 ${FETCH_PROXY.https:Dhttps_proxy=${FETCH_PROXY.https:Q}} \
 253 ${TOOLS_PATH.wget}
 254
 255# Protocol-specific variables are passed as environment variables.
 256# Generic FETCH_PROXY is passed via the --proxy argument to support
 257# other protocols like socks4/socks5.
229_FETCH_BEFORE_ARGS.curl= ${PASSIVE_FETCH:D--ftp-pasv} \ 258_FETCH_BEFORE_ARGS.curl= ${PASSIVE_FETCH:D--ftp-pasv} \
230 --fail --insecure --location --remote-time \ 259 --fail --insecure --location --remote-time \
231 ${FETCH_TIMEOUT:D--connect-timeout ${FETCH_TIMEOUT}} \ 260 ${FETCH_TIMEOUT:D--connect-timeout ${FETCH_TIMEOUT}} \
232 ${FETCH_TIMEOUT:D--speed-time ${FETCH_TIMEOUT}} \ 261 ${FETCH_TIMEOUT:D--speed-time ${FETCH_TIMEOUT}} \
 262 ${FETCH_PROXY:D--proxy ${FETCH_PROXY:Q}} \
233 ${FETCH_USE_IPV4_ONLY:D--ipv4} 263 ${FETCH_USE_IPV4_ONLY:D--ipv4}
234_FETCH_AFTER_ARGS.curl= -O # must be here to honor -o option 264_FETCH_AFTER_ARGS.curl= -O # must be here to honor -o option
235_FETCH_RESUME_ARGS.curl= -C - 265_FETCH_RESUME_ARGS.curl= -C -
236_FETCH_OUTPUT_ARGS.curl= -o 266_FETCH_OUTPUT_ARGS.curl= -o
237_FETCH_CMD.curl= ${TOOLS_PATH.curl} 267_FETCH_CMD.curl= ${PKGSRC_SETENV} \
 268 ${FETCH_PROXY.ftp:Dftp_proxy=${FETCH_PROXY.ftp:Q}} \
 269 ${FETCH_PROXY.http:Dhttp_proxy=${FETCH_PROXY.http:Q}} \
 270 ${FETCH_PROXY.https:Dhttps_proxy=${FETCH_PROXY.https:Q}} \
 271 ${TOOLS_PATH.curl}
238 272
239_FETCH_CMD.manual= ${TOOLS_PATH.false} 273_FETCH_CMD.manual= ${TOOLS_PATH.false}
240 274
241_FETCH_CMD.custom= ${FETCH_CMD} 275_FETCH_CMD.custom= ${FETCH_CMD}
242_FETCH_BEFORE_ARGS.custom= ${FETCH_BEFORE_ARGS} 276_FETCH_BEFORE_ARGS.custom= ${FETCH_BEFORE_ARGS}
243_FETCH_AFTER_ARGS.custom= ${FETCH_AFTER_ARGS} 277_FETCH_AFTER_ARGS.custom= ${FETCH_AFTER_ARGS}
244_FETCH_RESUME_ARGS.custom= ${FETCH_RESUME_ARGS} 278_FETCH_RESUME_ARGS.custom= ${FETCH_RESUME_ARGS}
245_FETCH_OUTPUT_ARGS.custom= ${FETCH_OUTPUT_ARGS} 279_FETCH_OUTPUT_ARGS.custom= ${FETCH_OUTPUT_ARGS}
246 280
247_FETCH_CMD= ${PKGSRC_SETENV} CHECKSUM=${_CHECKSUM_CMD:Q} \ 281_FETCH_CMD= ${PKGSRC_SETENV} CHECKSUM=${_CHECKSUM_CMD:Q} \
248 CP=${TOOLS_CP:Q} \ 282 CP=${TOOLS_CP:Q} \
249 ECHO=${TOOLS_ECHO:Q} \ 283 ECHO=${TOOLS_ECHO:Q} \
250 FETCH_CMD=${_FETCH_CMD.${FETCH_USING}:Q} \ 284 FETCH_CMD=${_FETCH_CMD.${FETCH_USING}:Q} \