[Swift-commit] r6512 - branches/release-0.94/libexec

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon May 20 01:00:24 CDT 2013


Author: davidk
Date: 2013-05-20 01:00:24 -0500 (Mon, 20 May 2013)
New Revision: 6512

Modified:
   branches/release-0.94/libexec/_swiftwrap.wrapperstaging
Log:
Update to _swiftwrap.wrapperstaging to work with direct:// and stage:// (symlinks and dd)


Modified: branches/release-0.94/libexec/_swiftwrap.wrapperstaging
===================================================================
--- branches/release-0.94/libexec/_swiftwrap.wrapperstaging	2013-05-20 00:35:10 UTC (rev 6511)
+++ branches/release-0.94/libexec/_swiftwrap.wrapperstaging	2013-05-20 06:00:24 UTC (rev 6512)
@@ -56,10 +56,12 @@
 }
 
 localPath() {
-	# remove protocol://
-	PATH="${1#*://}"
-	# remove leading "/" if present
-	PATH="${PATH#/}"
+        # remove protocol://
+        PATH="${1#*://}"
+        # Remove hostname
+        PATH="${PATH#*/}"
+        # remove leading "/" if present
+        PATH="${PATH#/}"
 	log "Transformed $1 to $PATH"
 	echo $PATH
 }
@@ -80,13 +82,29 @@
 	
 	case $SRC in
 		file://*)
-			SRC=${SRC#file://}
+			SRC=${SRC#file://*/}
 			log "Copying $SRC to $DST"
 			if [ ! -f $SRC ]; then
 				fail 254 "Cannot stage in $SRC. File not found."
 			fi
-			cp $SRC $DST 2>&1 >& "$INFO"
+                        ln -s $SRC $DST 2>&1 >& "$INFO"
 			;;
+		stage://*)
+			SRC=${SRC#stage://}
+			log "Copying $SRC to $DST"
+			if [ ! -f $SRC ]; then
+				fail 254 "Cannot stage in $SRC. File not found."
+			fi
+                        dd if=$SRC of=$DST bs=10M 2>&1 >& "$INFO"
+			;;
+                direct://*)
+                	SRC=${SRC#direct://}
+                        log "Linking $SRC to $DST"
+                        if [ ! -f $SRC ]; then
+				fail 245 "Cannot stage in $SRC. File not found."
+			fi
+                        ln -s $SRC $DST 2>&1 >& "$INFO"
+                        ;;
 		http://*)
 			log "Fetching $SRC using wget"
 			wget $SRC -O $DST 2>&1 >& "$INFO"
@@ -121,7 +139,7 @@
 			DIR=`dirname $DST`
 			mkdir -p $DIR
 			log "Copying $SRC to $DST"
-			cp $SRC $DST 2>&1 >& "$INFO"
+                        dd if=$SRC of=$DST bs=10M 2>&1 >& "$INFO"
 			;;
 		*://*)
 			fail 254 "Cannot handle protocol ${DST%%://*}"
@@ -269,7 +287,6 @@
 }
 
 COMMANDLINE=$@
-
 PARAMFILE=
 
 openinfo "wrapper.log"




More information about the Swift-commit mailing list