195a196,206
> 		# handling wget specific extension
> 		for wgetX in WGET_ENABLE WGET_CHECK_CERTIFICATES; do
> 		    eval _=\$${wgetX}
> 			if [ -z "${_}" ]; then
> 				eval ${wgetX}=`grep "^${wgetX}=" "${CONFFILE}" |
> 				    cut -f 2- -d '=' | tail -1 | tr '[:lower:]' '[:upper:]'`
> 			fi
> 		done
> 		
> 
> 
268c279,298
< 	PHTTPGET=/usr/libexec/phttpget
---
> 
> 	# do we need the usage of wget(1) instead of the
> 	# default phttpget?
> 	if [ "${WGET_ENABLE}" = "YES" ]
> 	then
> 	    PHTTPGET=/usr/local/bin/wget
> 	    PHTTPGET_OPTS=""
> 
> 	    # skip checking certificates, really dangerous!
> 	    if [ ! -z "${WGET_CHECK_CERTIFICATES}" -a "${WGET_CHECK_CERTIFICATES}" = "NO" ]
> 	    then
> 		PHTTPGET_OPTS="${PHTTPGET_OPTS} --no-check-certificate "
> 		echo "WARNING: check of certificates is disabled as specified by option WGET_CHECK_CERTIFICATES in $CONFFILE"
> 	    fi
> 	else
> 	    PHTTPGET=/usr/libexec/phttpget
> 	fi
> 
> 	check_downloader
> 	echo "Will use [$PHTTPGET] as downloader"
687,690c717,722
< 	tr '|' '-' < patchlist |
< 	    lam -s "tp/" - -s ".gz" |
< 	    xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}	\
< 	    2>${STATSREDIR} | fetch_progress
---
> 
> 	for current_file in `tr '|' '-' < patchlist | lam -s "tp/" - -s ".gz"`
> 	do
> 	    echo ${PHTTPGET} ${PHTTPGET_OPTS} ${SERVERNAME}/${current_file} > /dev/null 2>&1
> 	done
> 
721,724c753,760
< 	echo ${NDEBUG} "metadata files... "
< 	lam -s "f/" - -s ".gz" < filelist |
< 	    xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}	\
< 	    2>${QUIETREDIR}
---
> 	echo ${NDEBUG} "metadata files..."
> 
> 	# fetch metadata files using wget behind a proxy
> 	for current_file in `cat filelist`
> 	do
> 	    echo ${PHTTPGET}  ${PHTTPGET_OPTS} ${SERVERNAME}/f/${current_file}.gz  > /dev/null 2>&1
> 	done
> 	    
763,765c799,804
< 	tr '|' '-' < patchlist | lam -s "bp/" - |
< 	    xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}	\
< 	    2>${STATSREDIR} | fetch_progress
---
> 
> 	# fetch metadata files using wget behind a proxy
> 	for current_file in `tr '|' '-' < patchlist | lam -s "bp/" - -s ".gz"`
> 	do
> 	    echo ${PHTTPGET}  ${PHTTPGET_OPTS} ${SERVERNAME}/${current_file}  > /dev/null 2>&1
> 	done
794,796c833,837
< 	lam -s "f/" - -s ".gz" < filelist |
< 	    xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}	\
< 	    2>${QUIETREDIR}
---
> 	# fetch metadata files using wget behind a proxy
> 	for current_file in `lam -s "f/" - -s ".gz" < filelist`
> 	do
> 	    ${PHTTPGET}  ${PHTTPGET_OPTS} ${SERVERNAME}/${current_file}  > /dev/null 2>&1
> 	done
997a1039,1079
> # check that the downloader program is set into the variable PHTTPGET
> # and that is executable (in the case of wget(1) it must be available on
> # the system.
> #
> # In the case the downloader program is not usable the program will be aborted
> # with the following exit codes:
> # 99 = PHTTPGET internal variable not set
> # 98 = program does not exist
> # 97 = program is not executable
> #
> #
> check_downloader(){
>     should_exit=0
> 
>     if [ -z "${PHTTPGET}" ]
>     then
> 	echo "The downloader program is not set into the PHTTPGET variable!"
> 	should_exit=99
>     else
> 	if [ ! -f "${PHTTPGET}" ]
> 	then
> 	    echo "The downloader program $PHTTPGET does not exists!"
> 	    echo "See here: " `whereis "$PHTTPGET"`
> 	    should_exit=98
> 	else
> 	    if [ ! -x "${PHTTPGET}" ]
> 	    then
> 		echo "The downloader program $PHTTPGET is not executable!"
> 		should_exit=97
> 	    fi
> 	fi
>     fi
> 
>     if [ $should_exit -gt 0 ]
>     then
> 	echo "portsnap cannot continue, sorry"
> 	exit $should_exit
>     fi
> }
> 
> 
