[Lunar-commits] CVS: theedge/var/lib/lunar/plugins download-generic.plugin, 1.4, 1.5

Auke Kok sofar at lunar-linux.org
Tue Apr 12 07:34:20 UTC 2005


Update of /var/cvs/lunar/theedge/var/lib/lunar/plugins
In directory espresso.foo-projects.org:/home/sofar/active/theedge/var/lib/lunar/plugins

Modified Files:
	download-generic.plugin 
Log Message:
Move the appending of '/' to URL's to the wget method only, the other methods do not concatenate the URL with the FILE part.


Index: download-generic.plugin
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/plugins/download-generic.plugin,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- download-generic.plugin	7 Apr 2005 09:19:57 -0000	1.4
+++ download-generic.plugin	12 Apr 2005 07:34:17 -0000	1.5
@@ -17,6 +17,12 @@
   fi
   debug_msg "plugin_source_download_generic ($@)"
 
+  URL=$1
+  # add trailing '/'
+  if [ "${URL:((${#URL}-1)):1}" != "/" ] ; then
+    URL="${URL}/"
+  fi
+
   # this is what the download will be stored as initially:
   TMP_FILE=$TMPDIR/$2
 
@@ -46,8 +52,8 @@
   [ -n  "$ftp_proxy" ] && export  ftp_proxy=$ftp_proxy
   [ -n   "$no_proxy" ] && export   no_proxy=$no_proxy
 
-  verbose_msg "calling \"wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL \"$1$2\" --output-document $TMP_FILE\""
-  if erase $TMP_FILE && wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL "$1$2" --output-document "$TMP_FILE" ; then
+  verbose_msg "calling \"wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL \"$URL$2\" --output-document $TMP_FILE\""
+  if erase $TMP_FILE && wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL "$URL$2" --output-document "$TMP_FILE" ; then
     # looks like it worked
     if testpack $TMP_FILE ; then
       if [ "$TMP_FILE" != "$3/$2" ]; then
@@ -60,7 +66,7 @@
 	  return 1
     fi
   else
-    activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$1$2\""
+    activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$URL$2\""
     return 1
   fi
 }



More information about the Lunar-commits mailing list