Subject: Re: pkg/34036 (pkgsrc no longer fetches files)
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: pkgsrc-bugs
Date: 07/20/2006 13:20:03
The following reply was made to PR pkg/34036; it has been noted by GNATS.

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/34036 (pkgsrc no longer fetches files)
Date: Thu, 20 Jul 2006 15:17:50 +0200

 >  > Some fixes have been committed, does it work again for you?
 >  
 >  Nope - 'fraid not :(
 
 Can you try the patch below? I'm interested in the output of the
 failing command, if it still occurs.
 
 Joerg
 
 Index: fetch
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/fetch/fetch,v
 retrieving revision 1.4
 diff -u -r1.4 fetch
 --- fetch	19 Jul 2006 15:13:40 -0000	1.4
 +++ fetch	20 Jul 2006 13:17:29 -0000
 @@ -105,6 +105,7 @@
  ######################################################################
  
  set -e		# exit on errors
 +set -x
  
  : ${PKGSRCDIR:=/usr/pkgsrc}
  : ${CHECKSUM:=${PKGSRCDIR}/mk/checksum/checksum}
 @@ -206,24 +207,22 @@
  #
  verify_file() {
  	_file="${1#./}"
 -	${TEST} -f $_file || return 1
 +	${TEST} -f $_file || return 0
  	if ${TEST} -n "$checksum"; then
 -		${CHECKSUM} -s ".pkgsrc.resume" $distinfo ${_file} || return 1
 -		return 0
 +		${CHECKSUM} -s ".pkgsrc.resume" $distinfo ${_file} || return 0
 +		exit 0
  	elif ${TEST} -n "$distsize"; then
  		_size=`${WC} -c < $_file`
 -		${TEST} "$_size" -eq "$distsize" || return 1
 -		return 0
 +		${TEST} "$_size" -eq "$distsize" || return 0
 +		exit 0
  	fi
 -	return 0;
 +	exit 0
  }
  
  # If the file already exists and it verifies, then we don't need to fetch
  # it again.
  #
 -if verify_file $path; then
 -	exit 0
 -fi
 +verify_file $path
  
  # Set the name of the output file.  In the "resume" case, we initialize
  # the fetch loop by ensuring that the temporary output file already