[Swift-commit] r6658 - trunk/bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Wed Jul 17 13:22:21 CDT 2013


Author: davidk
Date: 2013-07-17 13:22:21 -0500 (Wed, 17 Jul 2013)
New Revision: 6658

Modified:
   trunk/bin/nswift
   trunk/bin/swiftrun
Log:
-listconfig option to list all swift.propeties files being read, and display values
Change env variable SWIFT_CONFIG to SWIFT_SITE_CONF


Modified: trunk/bin/nswift
===================================================================
--- trunk/bin/nswift	2013-07-16 22:32:44 UTC (rev 6657)
+++ trunk/bin/nswift	2013-07-17 18:22:21 UTC (rev 6658)
@@ -147,7 +147,13 @@
 fi
 
 # Swiftrun
-CMDLINE="$( swiftrun $CMDLINE )"
+if [[ "$CMDLINE" == *-listconfig* ]]
+then
+   swiftrun $CMDLINE
+   exit 0
+else
+   CMDLINE="$( swiftrun $CMDLINE )"
+fi
 
 ### EXECUTE ############
 # Note: killing Swift may be briefly delayed due to Coasters shutdown

Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun	2013-07-16 22:32:44 UTC (rev 6657)
+++ trunk/bin/swiftrun	2013-07-17 18:22:21 UTC (rev 6658)
@@ -15,6 +15,7 @@
 my $option_sitesfile;		# Value of -sites.file option
 my $option_siteslist;		# Value of -sites option, comma separated
 my $option_config;		# Value of -config option
+my $option_listconfig; 		# List configuration files used, values, then exit
 my @sites;			# List of sites from -sites in array
 my $run_directory;		# Run directory to be created, run.NNNN
 my @new_swift_args;		# New command line arguments
@@ -157,6 +158,7 @@
            'tcfile=s'        => \$option_tcfile,
            'config=s'        => \$option_config,
            'site|sites=s'    => \$option_siteslist,
+           'listconfig'       => \$option_listconfig,
 );
 
 # Set @sites array from comma separated list of sites
@@ -170,7 +172,7 @@
 
 # Set the search order for properties
 &add_property_file("$swift_etc_directory/swift.properties");
-&add_property_file("$ENV{SWIFT_CONFIG}/swift.properties") if defined($ENV{SWIFT_CONFIG});
+&add_property_file("$ENV{SWIFT_SITE_CONF}/swift.properties") if defined($ENV{SWIFT_SITE_CONF});
 &add_property_file("$ENV{HOME}/.swift/swift.properties");
 &add_property_file("swift.properties");
 
@@ -205,6 +207,19 @@
    }
 }
 
+# If -listconfig is specified, print values and exit
+if( $option_listconfig ) {
+   print "\n";
+   foreach my $site(@property_files) {
+      print "Reading from: $site\n";
+   }
+   print "\nValues:\n";
+   while ( my ($key, $value) = each(%properties) ) {
+      print "\t$key=$value\n";
+   }
+   exit;
+}
+
 # Create/increment run directory
 my $run_number = 0;
 my @run_directories = <run????>;




More information about the Swift-commit mailing list