From efb470463446f655d7438a5f7d85a0152545c0f6 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 2 Jan 2004 15:16:56 +0000 Subject: [PATCH] Alejandro Mery : we don't want -list telling stuff about proxy :) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@2100 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- scripts/Download | 63 ++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/scripts/Download b/scripts/Download index c458b220e..12b501246 100755 --- a/scripts/Download +++ b/scripts/Download @@ -189,29 +189,6 @@ if [ $notimeout -eq 1 ] ; then curl_options="$curl_options -y 60 -Y 1 --connect-timeout 300" fi -if [ -f download/Proxy ]; then - proxy="`cat download/Proxy`" - if [ "$proxy" ]; then - test $this_is_the_2nd_run -eq 0 && \ - echo "INFO: Setting proxy to $proxy." - curl_options="$curl_options --proxy $proxy" - else - echo "INFO: Empty proxy definition... removing download/Proxy." - rm download/Proxy - fi -fi -if [ -f download/Proxy-auth ]; then - proxyauth="`cat download/Proxy-auth`" - if [ "$proxyauth" ]; then - test $this_is_the_2nd_run -eq 0 && \ - echo "INFO: Setting proxy authentication information." - curl_options="$curl_options --proxy-user $proxyauth" - else - echo "INFO: No proxy-auth information... removing download/Proxy-auth." - rm download/Proxy-auth - fi - fi - # cksum_chk filename cksum origfile # # This function verifies the checksum. If it fails it renames the file @@ -786,10 +763,44 @@ all() { rm -f src/down.$$.lst } -# Do mirror detection only once +# Things to do only for downloading # -if [ $this_is_the_2nd_run = 0 -a "${1:0:5}" != "-list" -a $checkonly = 0 ]; then - detect_mirror +if [ "${1:0:5}" != "-list" -a $checkonly = 0 ]; then + # Set proxy information + if [ -f download/Proxy ]; then + proxy="`cat download/Proxy`" + if [ "$proxy" ]; then + curl_options="$curl_options --proxy $proxy" + else + echo "INFO: No proxy information... removing download/Proxy." + rm download/Proxy + fi + fi + if [ -f download/Proxy-auth ]; then + proxyauth="`cat download/Proxy-auth`" + if [ "$proxyauth" ]; then + curl_options="$curl_options --proxy-user $proxyauth" + else + echo "INFO: No proxy-auth information... removing download/Proxy-auth." + rm download/Proxy-auth + fi + fi + + # Thing to do only once + # + if [ $this_is_the_2nd_run = 0 ]; then + # am i using a proxy? + # -- say i'm doing it even when i already did ;-) + if [ "$proxy" ]; then + echo "INFO: Setting proxy to $proxy." + fi + if [ "$proxyauth" ]; then + echo "INFO: Setting proxy authentication information." + fi + + # do mirror detection + detect_mirror + fi fi case "$1" in