diff options
author | joerg <joerg> | 2009-02-10 18:55:54 +0000 |
---|---|---|
committer | joerg <joerg> | 2009-02-10 18:55:54 +0000 |
commit | 874dee45ab7d13193e9573b8fe2a1a08212c1f3e (patch) | |
tree | af3c21628b384d6c057c3d456f12964d3929d7e0 /mk | |
parent | 65f820b9c156c656afea3b8ff5af1c9595c6c455 (diff) | |
download | pkgsrc-874dee45ab7d13193e9573b8fe2a1a08212c1f3e.tar.gz |
Change the way the fetch process is organised as proposed on tech-pkg:
- Introduce FETCH_USING, which specifies the mechanism to use; possible
values are ftp, fetch, curl, wget, manual and custom.
- Depend on the correct tool/program if not using manual or custom.
- For manual, just use /usr/bin/false to bail out if a distfile is
missing.
- For custom, FETCH_CMD and related variables are used as before.
- Default value is ftp.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/defaults/mk.conf | 15 | ||||
-rw-r--r-- | mk/fetch/bsd.fetch-vars.mk | 16 | ||||
-rw-r--r-- | mk/fetch/fetch-list.mk | 6 | ||||
-rw-r--r-- | mk/fetch/fetch.mk | 45 |
4 files changed, 50 insertions, 32 deletions
diff --git a/mk/defaults/mk.conf b/mk/defaults/mk.conf index 4cb846983ad..0ade3242b9d 100644 --- a/mk/defaults/mk.conf +++ b/mk/defaults/mk.conf @@ -1,4 +1,4 @@ -# $NetBSD: mk.conf,v 1.180 2008/11/29 13:38:52 rillig Exp $ +# $NetBSD: mk.conf,v 1.181 2009/02/10 18:55:54 joerg Exp $ # # This file provides default values for variables that may be overridden @@ -347,10 +347,15 @@ DEFAULT_VIEW?= "" # This is the default view to which packages are added after installation. # Default: "" (the empty view) -FETCH_CMD?= ${TOOLS_PATH.ftp} -# Default program to fetch the files with pkgsrc. -# Default: NetBSD's ftp(1). -# Possible: any. +FETCH_USING?= ftp +# The program type to fetch files. +# "manual" will explicitly fail if the DISTFILES don't exist locally. +# "custom" requires setting FETCH_CMD, FETCH_BEFORE_ARGS, FETCH_AFTER_ARGS, +# FETCH_RESUME_ARGS and FETCH_OUTPUT_ARGS. +# +# The default value can be overriden by a package before including +# bsd.prefs.mk and by the user in mk.conf. +# Possible: curl, custom, fetch, ftp, manual, wget #FIX_SYSTEM_HEADERS= # Make pkgtools/posix_headers an automatic build dependency for all diff --git a/mk/fetch/bsd.fetch-vars.mk b/mk/fetch/bsd.fetch-vars.mk index 8427fa0c42d..77f98efc9fd 100644 --- a/mk/fetch/bsd.fetch-vars.mk +++ b/mk/fetch/bsd.fetch-vars.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.fetch-vars.mk,v 1.11 2008/05/22 20:11:55 joerg Exp $ +# $NetBSD: bsd.fetch-vars.mk,v 1.12 2009/02/10 18:55:54 joerg Exp $ # # This Makefile fragment is included separately by bsd.pkg.mk and # defines some variables which must be defined earlier than where @@ -73,9 +73,15 @@ NO_SKIP= # defined _BOOTSTRAP_VERBOSE= # defined .endif -.if !empty(_CKSUMFILES) -USE_TOOLS+= ftp:bootstrap -. if defined(FAILOVER_FETCH) +.if !empty(_CKSUMFILES) && defined(FAILOVER_FETCH) USE_TOOLS+= digest:bootstrap -. endif .endif + +_FETCH_TOOLS.ftp= ftp +_FETCH_TOOLS.fetch= fetch +_FETCH_DEPENDS.wget= wget-[0-9]*:../../net/wget +_FETCH_DEPENDS.curl= curl-[0-9]*:../../www/curl +_FETCH_TOOLS.manual= false + +USE_TOOLS+= ${_FETCH_TOOLS.${FETCH_USING}:C/$/:bootstrap/} +BOOTSTRAP_DEPENDS+= ${_FETCH_DEPENDS.${FETCH_USING}} diff --git a/mk/fetch/fetch-list.mk b/mk/fetch/fetch-list.mk index 40aed739d89..245d9db2ae1 100644 --- a/mk/fetch/fetch-list.mk +++ b/mk/fetch/fetch-list.mk @@ -1,4 +1,4 @@ -# $NetBSD: fetch-list.mk,v 1.10 2009/02/08 23:16:08 wiz Exp $ +# $NetBSD: fetch-list.mk,v 1.11 2009/02/10 18:55:54 joerg Exp $ ###################################################################### ### fetch-list (PUBLIC) @@ -82,7 +82,7 @@ fetch-list-one-pkg: ${ECHO} "${MKDIR} ${_DISTDIR}"; \ ${ECHO} 'cd ${_DISTDIR} && { [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \ ${ECHO} 'for site in $$sites; do'; \ - ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \ + ${ECHO} ' ${_FETCH_CMD.${FETCH_USING}:Q} ${_FETCH_BEFORE_ARGS.${FETCH_USING}:Q} "$${site}${fetchfile:T}" ${_FETCH_AFTER_ARGS.${FETCH_USING}:Q} && break ||'; \ ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \ ${ECHO} 'done; }'; \ ${ECHO} ')'; \ @@ -100,7 +100,7 @@ fetch-list-one-pkg: ${ECHO} "${MKDIR} ${_DISTDIR}"; \ ${ECHO} 'cd ${_DISTDIR} && { [ -f ${fetchfile} -o -f ${fetchfile:T} ] ||'; \ ${ECHO} 'for site in $$sites; do'; \ - ${ECHO} ' ${FETCH_CMD} ${FETCH_BEFORE_ARGS} "$${site}${fetchfile:T}" ${FETCH_AFTER_ARGS} && break ||'; \ + ${ECHO} ' ${_FETCH_CMD.${FETCH_USING}:Q} ${_FETCH_BEFORE_ARGS.${FETCH_USING}:Q} "$${site}${fetchfile:T}" ${_FETCH_AFTER_ARGS.${FETCH_USING}:Q} && break ||'; \ ${ECHO} ' ${ECHO} ${fetchfile:T} not fetched'; \ ${ECHO} 'done; }'; \ fi) diff --git a/mk/fetch/fetch.mk b/mk/fetch/fetch.mk index 7c05d1b83e8..8099c186cf6 100644 --- a/mk/fetch/fetch.mk +++ b/mk/fetch/fetch.mk @@ -1,4 +1,4 @@ -# $NetBSD: fetch.mk,v 1.37 2008/10/08 15:39:07 joerg Exp $ +# $NetBSD: fetch.mk,v 1.38 2009/02/10 18:55:54 joerg Exp $ _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}} _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}} @@ -163,9 +163,9 @@ fetch-check-interactive: .USEBEFORE ### transfer the files from the appropriate sites if needed. ### # -# FETCH_CMD is the program used to fetch files. It must understand -# fetching files located via URLs, e.g. NetBSD's ftp, net/tnftp, -# etc. The default value is set in pkgsrc/mk/defaults/mk.conf. +# FETCH_CMD is the program used to fetch files for FETCH_USING=manual. +# It must understand fetching files located via URLs, +# e.g. NetBSD's ftp, net/tnftp, etc. # # The following variables are all lists of options to pass to he command # used to do the actual fetching of the file. @@ -188,11 +188,6 @@ fetch-check-interactive: .USEBEFORE # to try to resume interrupted file transfers to avoid downloading # the whole file. The default is set in pkgsrc/mk/defaults/mk.conf. # -#FETCH_CMD?= ftp # default is set by pkgsrc/mk/defaults/mk.conf -FETCH_BEFORE_ARGS?= ${_FETCH_BEFORE_ARGS.${FETCH_CMD:T}} -FETCH_AFTER_ARGS?= ${_FETCH_AFTER_ARGS.${FETCH_CMD:T}} -FETCH_RESUME_ARGS?= ${_FETCH_RESUME_ARGS.${FETCH_CMD:T}} -FETCH_OUTPUT_ARGS?= ${_FETCH_OUTPUT_ARGS.${FETCH_CMD:T}} _FETCH_BEFORE_ARGS.ftp= # empty # If this host is behind a filtering firewall, use passive ftp(1) @@ -200,34 +195,46 @@ _FETCH_BEFORE_ARGS.ftp+= ${PASSIVE_FETCH:D-p} _FETCH_AFTER_ARGS.ftp= # empty _FETCH_RESUME_ARGS.ftp= -R _FETCH_OUTPUT_ARGS.ftp= -o +_FETCH_CMD.ftp= ${TOOLS_PATH.ftp} _FETCH_BEFORE_ARGS.fetch= # empty _FETCH_AFTER_ARGS.fetch= # empty _FETCH_RESUME_ARGS.fetch= -r _FETCH_OUTPUT_ARGS.fetch= -o +_FETCH_CMD.fetch= ${TOOLS_PATH.fetch} _FETCH_BEFORE_ARGS.wget= # empty _FETCH_AFTER_ARGS.wget= # empty _FETCH_RESUME_ARGS.wget= -c _FETCH_OUTPUT_ARGS.wget= -O +_FETCH_CMD.wget= ${PREFIX}/bin/wget _FETCH_BEFORE_ARGS.curl= # empty _FETCH_BEFORE_ARGS.curl+= ${PASSIVE_FETCH:D--ftp-pasv} _FETCH_AFTER_ARGS.curl= -O # must be here to honor -o option _FETCH_RESUME_ARGS.curl= -C - _FETCH_OUTPUT_ARGS.curl= -o +_FETCH_CMD.curl= ${PREFIX}/bin/wget + +_FETCH_CMD.manual= ${TOOLS_PATH.false} + +_FETCH_CMD.custom= ${FETCH_CMD} +_FETCH_BEFORE_ARGS.custom= ${FETCH_BEFORE_ARGS} +_FETCH_AFTER_ARGS.custom= ${FETCH_AFTER_ARGS} +_FETCH_RESUME_ARGS.custom= ${FETCH_RESUME_ARGS} +_FETCH_OUTPUT_ARGS.custom= ${FETCH_OUTPUT_ARGS} _FETCH_CMD= ${SETENV} CHECKSUM=${_CHECKSUM_CMD:Q} \ - CP=${TOOLS_CP:Q} \ - ECHO=${TOOLS_ECHO:Q} \ - FETCH_CMD=${FETCH_CMD:Q} \ - FETCH_BEFORE_ARGS=${FETCH_BEFORE_ARGS:Q} \ - FETCH_AFTER_ARGS=${FETCH_AFTER_ARGS:Q} \ - FETCH_RESUME_ARGS=${FETCH_RESUME_ARGS:Q} \ - FETCH_OUTPUT_ARGS=${FETCH_OUTPUT_ARGS:Q} \ - MKDIR=${TOOLS_MKDIR:Q} MV=${TOOLS_MV:Q} \ - TEST=${TOOLS_TEST:Q} TOUCH=${TOOLS_TOUCH:Q} \ - WC=${TOOLS_WC:Q} \ + CP=${TOOLS_CP:Q} \ + ECHO=${TOOLS_ECHO:Q} \ + FETCH_CMD=${_FETCH_CMD.${FETCH_USING}:Q} \ + FETCH_BEFORE_ARGS=${_FETCH_BEFORE_ARGS.${FETCH_USING}:Q} \ + FETCH_AFTER_ARGS=${_FETCH_AFTER_ARGS.${FETCH_USING}:Q} \ + FETCH_RESUME_ARGS=${_FETCH_RESUME_ARGS.${FETCH_USING}:Q} \ + FETCH_OUTPUT_ARGS=${_FETCH_OUTPUT_ARGS.${FETCH_USING}:Q} \ + MKDIR=${TOOLS_MKDIR:Q} MV=${TOOLS_MV:Q} \ + TEST=${TOOLS_TEST:Q} TOUCH=${TOOLS_TOUCH:Q} \ + WC=${TOOLS_WC:Q} \ ${SH} ${PKGSRCDIR}/mk/fetch/fetch _FETCH_ARGS+= ${PKG_VERBOSE:D-v} |