[Swift-commit] r3823 - trunk/libexec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Dec 23 12:31:47 CST 2010


Author: wozniak
Date: 2010-12-23 12:31:47 -0600 (Thu, 23 Dec 2010)
New Revision: 3823

Modified:
   trunk/libexec/cdm_lib.sh
Log:
Fix CDM LOCAL cp/dd options


Modified: trunk/libexec/cdm_lib.sh
===================================================================
--- trunk/libexec/cdm_lib.sh	2010-12-23 17:37:14 UTC (rev 3822)
+++ trunk/libexec/cdm_lib.sh	2010-12-23 18:31:47 UTC (rev 3823)
@@ -51,9 +51,7 @@
 			fi
 			;;
  		LOCAL)
- 			#TOOL=${ARGS[0]}
- 			#REMOTE_DIR=${ARGS[1]}
- 			#FLAGS=${ARGS[3]}
+			# TODO: Can/should we use this as a cache?
 			TOOL=$1
 			REMOTE_DIR=$2
 			FLAGS=$3
@@ -62,10 +60,17 @@
  			if [ $MODE == "INPUT" ]; then
  				[ -f "$REMOTE_DIR/$FILE" ]
  				checkError 254 "CDM[LOCAL]: $REMOTE_DIR/$FILE does not exist!"
- 				$TOOL $FLAGS $REMOTE_DIR/$FILE $JOBDIR/$FILE
- 				checkError 254 "CDM[LOCAL]: Tool failed!"
+				if [ $TOOL == "cp" ]; then
+ 					$TOOL $FLAGS $REMOTE_DIR/$FILE $JOBDIR/$FILE
+					checkError 254 "CDM[LOCAL]: cp failed!"
+				elif [ $TOOL == "dd" ]; then
+					$TOOL $FLAGS if=$REMOTE_DIR/$FILE of=$JOBDIR/$FILE
+					checkError 254 "CDM[LOCAL]: dd failed!"
+				else
+					fail 254 "CDM[LOCAL]: Unknown TOOL: $TOOL"
+				fi
  			elif [ $MODE == "OUTPUT" ]; then
- 				log "CDM[LOCAL]..."
+ 				log "CDM[LOCAL]..." # This should probably be an error
  			else
  				fail 254 "Unknown MODE: $MODE"
  			fi




More information about the Swift-commit mailing list