| @@ -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 |
9 | MASTER_SITE_LOCAL?= ${MASTER_SITE_BACKUP:=LOCAL_PORTS/} | | 9 | MASTER_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) |
| | | 213 | FETCH_PROXY.ftp?= ${FETCH_PROXY} |
| | | 214 | FETCH_PROXY.http?= ${FETCH_PROXY} |
| | | 215 | FETCH_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} \ |