summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorxtraeme <xtraeme>2004-07-27 15:56:19 +0000
committerxtraeme <xtraeme>2004-07-27 15:56:19 +0000
commit17d19e9d91cfcad81dc86ca97e38861fea3278f1 (patch)
tree2b3e1610cd212f5a0c5486df0b2bf0c199ec17d2 /mk
parentcae34082a6b4fd134bf3ef4af879112c6b745e96 (diff)
downloadpkgsrc-17d19e9d91cfcad81dc86ca97e38861fea3278f1.tar.gz
Make the option to resume transfer optional, as suggested by
Robert Elz in PR pkg/26448 (at least for now). If you want to use it, PKG_RESUME_TRANSFERS must be set to [Yy][Ee][Ss]. While here, no need to use ${AWK} to get the size with ${WC} -c, ${WC} -c < file is enough. Thanks to Robert Elz for suggestions, still I have to fix the problems reported in the PR.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.defaults.mk8
-rw-r--r--mk/bsd.pkg.mk11
2 files changed, 14 insertions, 5 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk
index 01912d66bf3..2dbe1fc0156 100644
--- a/mk/bsd.pkg.defaults.mk
+++ b/mk/bsd.pkg.defaults.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.defaults.mk,v 1.266 2004/07/27 10:34:53 xtraeme Exp $
+# $NetBSD: bsd.pkg.defaults.mk,v 1.267 2004/07/27 15:56:19 xtraeme Exp $
#
# A file providing defaults for pkgsrc and the packages collection.
@@ -237,6 +237,12 @@ PKG_INSTALLATION_PREFS?= overwrite pkgviews
# Possible: any of: overwrite, pkgviews
# Default: overwrite pkgviews
+PKG_RESUME_TRANSFERS?= YES
+# Used in pkgsrc to resume transfers, if enabled the whole file won't be
+# downloaded from scratch again.
+# Possible: yes or no.
+# Default: YES.
+
PKG_SYSCONFBASE?= ${PREFIX}/etc
# This is the main config directory under which all package configuration
# files should be found.
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 5e700af22ba..dbb8cdd3326 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1479 2004/07/27 10:34:53 xtraeme Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1480 2004/07/27 15:56:19 xtraeme Exp $
#
# This file is in the public domain.
#
@@ -1414,7 +1414,7 @@ package:
# Resume a previous transfer not finished totally.
_RESUME_TRANSFER= \
- dsize=`${WC} -c ${DISTDIR}/${DIST_SUBDIR}/$$bfile | ${AWK} '{print $$1}'`; \
+ dsize=`${WC} -c < ${DISTDIR}/${DIST_SUBDIR}/$$bfile`; \
tsize=`${AWK} '/^Size/ && $$2 == '"\"($$file)\""' { print $$4 }' ${DISTINFO_FILE}` || ${TRUE}; \
case "$$tsize" in \
"") ${ECHO_MSG} "No size in distinfo file (${DISTINFO_FILE})"; \
@@ -1625,8 +1625,11 @@ do-fetch:
unsorted_sites="${SITES_${fetchfile:T:S/=/--/}} ${_MASTER_SITE_BACKUP}"; \
sites="${ORDERED_SITES}"; \
${_CHECK_DIST_PATH}; \
- ${_FETCH_FILE}; \
- ${_RESUME_TRANSFER}
+ if ${TEST} "${PKG_RESUME_TRANSFERS:M[Yy][Ee][Ss]}" ; then \
+ ${_FETCH_FILE}; ${_RESUME_TRANSFER}; \
+ else \
+ ${_FETCH_FILE}; \
+ fi
. endif # defined(_FETCH_MESSAGE)
. endfor
. endif # INTERACTIVE_STAGE == fetch