[Lunar-commits] CVS: theedge/var/lib/lunar/plugins download-file.plugin, 1.1, 1.2 download-generic.plugin, 1.3, 1.4

Auke Kok sofar at lunar-linux.org
Thu Apr 7 09:19:59 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-file.plugin download-generic.plugin 
Log Message:
API change: separately pass the filename argument when downloading and verifying files (url, filename, target dir)


Index: download-file.plugin
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/plugins/download-file.plugin,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- download-file.plugin	23 Mar 2005 16:18:13 -0000	1.1
+++ download-file.plugin	7 Apr 2005 09:19:57 -0000	1.2
@@ -17,7 +17,7 @@
   fi
   debug_msg "plugin_source_download_file ($@)"
 
-  cp $(echo $1 | sed 's/file:\/\///') $2
+  cp "${1:7}$2" $3
 }
 
 

Index: download-generic.plugin
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/plugins/download-generic.plugin,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- download-generic.plugin	4 Apr 2005 13:36:31 -0000	1.3
+++ download-generic.plugin	7 Apr 2005 09:19:57 -0000	1.4
@@ -18,7 +18,7 @@
   debug_msg "plugin_source_download_generic ($@)"
 
   # this is what the download will be stored as initially:
-  TMP_FILE=$TMPDIR/$(basename $2)
+  TMP_FILE=$TMPDIR/$2
 
   if [ "$FTP_ACTIVE" == "off" -o "$FTP_PASSIVE" == "on" ] ; then
     WGET_FTP_CONNECTION="--passive-ftp"
@@ -46,21 +46,21 @@
   [ -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 --output-document $TMP_FILE\""
-  if erase $TMP_FILE && wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL "$1" --output-document "$TMP_FILE" ; then
+  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
     # looks like it worked
     if testpack $TMP_FILE ; then
-      if [ "$TMP_FILE" != "$(dirname $2)/$(basename $TMP_FILE)" ]; then
-        install -m644 $TMP_FILE $(dirname $2)/$(basename $TMP_FILE)
+      if [ "$TMP_FILE" != "$3/$2" ]; then
+        install -m644 $TMP_FILE "$3/$2"
         rm $TMP_FILE
       fi
-      verbose_msg "download of \"$1\" successful"
+      verbose_msg "download of \"$2\" successful"
     else
       rm -f $TMP_FILE
 	  return 1
     fi
   else
-    activity_log  "lget"  "$MODULE"  "$VERSION"  "failed" "broken URL: $1"
+    activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$1$2\""
     return 1
   fi
 }



More information about the Lunar-commits mailing list