diff options
author | dsainty <dsainty> | 2015-09-19 11:45:56 +0000 |
---|---|---|
committer | dsainty <dsainty> | 2015-09-19 11:45:56 +0000 |
commit | cf41af89dbf7163be3cb9fa1cf466db3f391cada (patch) | |
tree | d3cce20108f92b43ede0e522ff59a3cdbfe13903 /mk/fetch | |
parent | 34cac31bd3ef31de141cbfc3f4f3be76a52e71ab (diff) | |
download | pkgsrc-cf41af89dbf7163be3cb9fa1cf466db3f391cada.tar.gz |
Alter the behaviour of the "fetch" executable to accept zero download sites
as an acceptable input.
Fixes Pkgsrc for users that set PKG_RESUME_TRANSFERS=yes in their mk.conf if
installing a package that has an interactive fetch stage, after
mk/fetch/fetch.mk revision 1.66.
Tested for all combinations of:
+ PKG_RESUME_TRANSFERS=yes/no; and
+ interactive fetch=yes/no; and
+ distfile=downloaded/not downloaded
... with no signs of misbehaviour.
The specific case that was broken, and this change fixes, is:
+ PKG_RESUME_TRANSFERS=yes; and
+ interactive fetch=yes; and
+ distfile=downloaded
This change was designed with the following considerations:
1. Given it's a freeze, keep it simple.
2. The change in behaviour allows 'fetch' to succeed where it would previously
fail fatally, so it's unlikely to affect any (intentional) existing
behaviour in Pkgsrc.
3. The behaviour of 'fetch' with zero sites is essentially the same as a
fetch where all the possible download sites fail, I.e. Pkgsrc already
expects to handle such behaviour.
ok gdt@
Diffstat (limited to 'mk/fetch')
-rwxr-xr-x | mk/fetch/fetch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mk/fetch/fetch b/mk/fetch/fetch index 00cf4828293..f2ae3f8c936 100755 --- a/mk/fetch/fetch +++ b/mk/fetch/fetch @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: fetch,v 1.17 2015/09/08 12:37:56 joerg Exp $ +# $NetBSD: fetch,v 1.18 2015/09/19 11:45:56 dsainty Exp $ # # Copyright (c) 2006, 2015 The NetBSD Foundation, Inc. # All rights reserved. @@ -43,7 +43,7 @@ # fetch -- fetch files via URLs # # SYNOPSIS -# fetch [-c] [-d dir] [-f distinfo] [-p hook] [-r] [-v] file site ... +# fetch [-c] [-d dir] [-f distinfo] [-p hook] [-r] [-v] file [site ...] # # DESCRIPTION # fetch will attempt to fetch the file from the list of specified @@ -123,7 +123,7 @@ self="${0##*/}" usage() { - ${ECHO} 1>&2 "usage: $self [-c] [-d dir] [-f distinfo] [-p hook] [-r] [-v] file site ..." + ${ECHO} 1>&2 "usage: $self [-c] [-d dir] [-f distinfo] [-p hook] [-r] [-v] file [site ...]" } # Process optional arguments @@ -166,7 +166,7 @@ if ${TEST} -n "$resume"; then fi # Process required arguments -if ${TEST} $# -lt 2; then +if ${TEST} $# -lt 1; then usage exit 1 fi |