diff options
author | joerg <joerg@pkgsrc.org> | 2009-08-02 02:38:52 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-08-02 02:38:52 +0000 |
commit | e68b30c5b722f3c0d2ce0bcff4a1d58f5693f731 (patch) | |
tree | 59a7752741fcec0a085986367c65d51fcc540177 /mk | |
parent | c997f414f0f13d96cf05ec713b821c14c2ab8f68 (diff) | |
download | pkgsrc-e68b30c5b722f3c0d2ce0bcff4a1d58f5693f731.tar.gz |
Add support for fetching from URLs that do not end in the distfile.
If the URL is prefixed with a dash, it is considered complete.
Diffstat (limited to 'mk')
-rwxr-xr-x | mk/fetch/fetch | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mk/fetch/fetch b/mk/fetch/fetch index 93c84d64df1..397be2dde0d 100755 --- a/mk/fetch/fetch +++ b/mk/fetch/fetch @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: fetch,v 1.13 2009/07/20 09:09:02 tnn Exp $ +# $NetBSD: fetch,v 1.14 2009/08/02 02:38:52 joerg Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -267,12 +267,20 @@ ${TEST} -z "$distsize" || ${ECHO} "=> Total size: $distsize $distunits" # while ${TEST} $# -gt 0; do site="$1"; shift + case "$site" in + -*) + url=${site#-} + ;; + *) + url=$site$file + ;; + esac ( cd $fetchdir if ${TEST} -n "$resume"; then - fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${FETCH_RESUME_ARGS} ${FETCH_OUTPUT_ARGS} $outputfile $site$file" + fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${FETCH_RESUME_ARGS} ${FETCH_OUTPUT_ARGS} $outputfile $url" else - fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${FETCH_OUTPUT_ARGS} $outputfile $site$file ${FETCH_AFTER_ARGS}" + fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${FETCH_OUTPUT_ARGS} $outputfile $url ${FETCH_AFTER_ARGS}" fi ${TEST} -z "$verbose" || ${ECHO} "$fetch_cmd" $fetch_cmd ) |