tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fixing PKG_RESUME_TRANSFERS=yes on interactive fetch packages



On 16/09/15 14:14, David Sainty wrote:
On 15/09/15 23:40, David Sainty wrote:
On 15/09/15 23:29, Greg Troxel wrote:
David Sainty <david.sainty%gmail.com@localhost> writes:

On 14/09/15 03:03, Joerg Sonnenberger wrote:
Module Name:    pkgsrc
Committed By:    joerg
Date:        Sun Sep 13 15:03:57 UTC 2015

Modified Files:
    pkgsrc/mk/fetch: bsd.fetch-vars.mk fetch.mk

Log Message:
Introduce IGNORE_INTERACTIVE_FETCH to allow trying to fetch files from
the override site, even for INTERACTIVE_STATE=stage or FETCH_MESSAGE.
Ignore all backup sites as they won't have the distfile anyway, the
fetch wouldn't be interactive in first place otherwise.
This breaks for PKG_RESUME_TRANSFERS=yes.
Does one of you have a proposed fix?  Or should we back out the above
change, for redoing post freeze?   It sounds like it might not be too
hard/scary to fix - would be good to get a patch to review to tech-pkg.


I haven't tried to fix it, I figure Joerg has a better handle on the nuances of IGNORE_INTERACTIVE_FETCH.

I would probably take the approach of removing the fatal error on zero sites to "fetch". I would guess that would have no real side-effects on existing usage...


This patch is a possible fix. Below are testing results with this patch in-place.

Suggested updated patch (attached) that also makes the usage message match the new reality. No functional change.

--- mk/fetch/fetch.orig	2015-09-10 13:01:28.886319302 +1200
+++ mk/fetch/fetch	2015-09-16 15:04:24.947346833 +1200
@@ -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 @@
 fi
 
 # Process required arguments
-if ${TEST} $# -lt 2; then
+if ${TEST} $# -lt 1; then
 	usage
 	exit 1
 fi


Home | Main Index | Thread Index | Old Index