[Swift-commit] r3526 - usertools/swift/swiftconfig/bin

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Aug 12 08:49:11 CDT 2010


Author: davidk
Date: 2010-08-12 08:49:11 -0500 (Thu, 12 Aug 2010)
New Revision: 3526

Modified:
   usertools/swift/swiftconfig/bin/swiftrun
Log:
-sites all, run on all configured sites


Modified: usertools/swift/swiftconfig/bin/swiftrun
===================================================================
--- usertools/swift/swiftconfig/bin/swiftrun	2010-08-12 05:59:24 UTC (rev 3525)
+++ usertools/swift/swiftconfig/bin/swiftrun	2010-08-12 13:49:11 UTC (rev 3526)
@@ -102,19 +102,42 @@
 
 # Create configuration files for run
 foreach my $site (@option_sites) {
-    if ( !-d "$dotswift_directory/sites/$site" ) {
-        die "Unable to find entry for $site\n";
+    # Handle 'all' to use all available configurations at once
+    if( lc($site) eq 'all' ) {
+        foreach my $all_site(<$dotswift_directory/sites/*>) {
+            print "all_site is: \"" . $all_site . "\"\n";
+            if ( !-d "$all_site" ) {
+                die "Unable to find directory for $all_site\n";
+            }
+            if ( !-e "$all_site/sites.xml" ) {
+                die "Unable to find sites.xml for $all_site\n";
+            }
+            if ( !-e "$all_site/tc.data" ) {
+                die "Unable to find tc.data for $all_site\n";
+            }
+            cat_file( "$all_site/sites.xml",
+                "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" );
+            cat_file( "$all_site/tc.data",
+                "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" );
+        }
     }
-    if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) {
-        die "Unable to find sites.xml for $site\n";
-    }
-    if ( !-e "$dotswift_directory/sites/$site/tc.data" ) {
-        die "Unable to find tc.data for $site\n";
-    }
-    cat_file( "$dotswift_directory/sites/$site/sites.xml",
-        "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" );
-    cat_file( "$dotswift_directory/sites/$site/tc.data",
-        "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" );
+    
+    # Normal, non-'all' site
+    else {    
+        if ( !-d "$dotswift_directory/sites/$site" ) {
+            die "Unable to find entry for $site\n";
+        }
+        if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) {
+            die "Unable to find sites.xml for $site\n";
+        }
+        if ( !-e "$dotswift_directory/sites/$site/tc.data" ) {
+            die "Unable to find tc.data for $site\n";
+        }
+        cat_file( "$dotswift_directory/sites/$site/sites.xml",
+            "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" );
+        cat_file( "$dotswift_directory/sites/$site/tc.data",
+            "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" );
+   }
 }
 
 # Link input data




More information about the Swift-commit mailing list