[Swift-commit] r3227 - trunk/libexec
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Thu Feb 4 17:34:56 CST 2010
Author: wozniak
Date: 2010-02-04 17:34:56 -0600 (Thu, 04 Feb 2010)
New Revision: 3227
Modified:
trunk/libexec/_swiftwrap
Log:
Better use of CDM.
Modified: trunk/libexec/_swiftwrap
===================================================================
--- trunk/libexec/_swiftwrap 2010-02-04 23:31:53 UTC (rev 3226)
+++ trunk/libexec/_swiftwrap 2010-02-04 23:34:56 UTC (rev 3227)
@@ -126,9 +126,20 @@
return 1
}
-cdm() {
- log "CDM: $@"
+cdm_lookup() {
+ FILE=$1
+ CDM_FILE=$2
+ RESULT="DEFAULT"
+ if [ -f shared/cdm.pl ]; then
+ RESULT=$( perl shared/cdm.pl $FILE < $CDM_FILE )
+ fi
+ echo $RESULT
+}
+
+cdm_action() {
+ log "CDM_ACTION: $@"
+
local JOBDIR=$1 # Given jobdir
local MODE=$2 # INPUT or OUTPUT
local FILE=$3 # User file
@@ -200,6 +211,7 @@
checkEmpty "$JOBDIR" "Missing job directory prefix"
mkdir -p $INFODIR
closeinfo
+
rm -f "$INFODIR/${ID}-info"
openinfo "$INFODIR/${ID}-info"
@@ -330,10 +342,10 @@
logstate "LINK_INPUTS"
for L in $INF ; do
log "L: $L"
- CDM_POLICY=$( perl shared/cdm.pl $L < shared/$CDM_FILE )
- log "CDM_POLICY: $CDM_POLICY"
+ CDM_POLICY=$( cdm_lookup $L shared/$CDM_FILE )
+ log "CDM_POLICY: $CDM_POLICY"
if [ $CDM_POLICY != "DEFAULT" ]; then
- eval cdm $DIR "INPUT" $L $CDM_POLICY
+ eval cdm_action $DIR "INPUT" $L $CDM_POLICY
continue
fi
if [ $COPYNOTLINK = 1 ]; then
@@ -352,7 +364,7 @@
logstate "LINK_CDM_OUTPUTS"
SKIPPED_OUTPUT=()
for L in $OUTF ; do
- CDM_POLICY=$( perl shared/cdm.pl $L < shared/$CDM_FILE )
+ CDM_POLICY=$( cdm_lookup $L shared/$CDM_FILE )
log "CDM_POLICY: $CDM_POLICY"
if [ $CDM_POLICY != "DEFAULT" ]; then
eval cdm $DIR "OUTPUT" $L $CDM_POLICY
More information about the Swift-commit
mailing list