[Swift-commit] r3550 - in usertools/swift/swiftconfig: bin lib/perl
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Mon Aug 16 20:51:45 CDT 2010
Author: davidk
Date: 2010-08-16 20:51:45 -0500 (Mon, 16 Aug 2010)
New Revision: 3550
Modified:
usertools/swift/swiftconfig/bin/swiftrun
usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm
Log:
Print run times and a few updates to application editing
Modified: usertools/swift/swiftconfig/bin/swiftrun
===================================================================
--- usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 21:39:27 UTC (rev 3549)
+++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-17 01:51:45 UTC (rev 3550)
@@ -160,7 +160,8 @@
# Run swift
chdir("$run_directory") || die "Unable to chdir to $run_directory\n";
-print "Submitting job. Check $run_directory for details\n";
+print "Executing script $option_script\n";
+print "Check $run_directory for output and debugging information\n";
my $system_command =
'swift '
. "-sites.file $run_directory/sites.xml "
@@ -175,6 +176,13 @@
# Execute
system($system_command);
+my $sec = (time - $^T);
+my $hours = ($sec/(60*60))%24;
+my $mins = ($sec/60)%60;
+my $secs = $sec%60;
+my $datestring = sprintf("%dh:%dm:%ds", $hours, $mins, $secs);
+print "Script $option_script finished in $datestring\n";
+
__END__
=head1 NAME
Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm
===================================================================
--- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 21:39:27 UTC (rev 3549)
+++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-17 01:51:45 UTC (rev 3550)
@@ -561,6 +561,7 @@
my @apps_file_data = <APPLIST>;
close(APPLIST);
foreach my $current_app (@apps_file_data) {
+ chomp($current_app);
if($apps) {
$apps = "$apps $current_app";
}
@@ -571,7 +572,7 @@
}
my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps");
- print "Available application sets are: ";
+ print "Available application sets: ";
foreach(@all_available_appsets) {
$_ = strip_directory($_);
($_, my $junk) = split('\.');
@@ -579,10 +580,7 @@
}
print "\n";
- print "Application sets for $site: ";
- $apps = <STDIN>;
- chomp($apps);
-
+ $apps = get_entry("Select application sets for $site", $apps, 0);
my @all_list = split(/ /, $apps);
open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps")
|| die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n";
@@ -648,6 +646,15 @@
print "Enter name to call this application set: ";
my $set_name = <STDIN>;
chomp($set_name);
+
+ if(-e "$ENV{'HOME'}/.swift/apps/$set_name.apps") {
+ print "Set named $set_name already exists\n";
+ my $yesno = get_entry("Overwrite $set_name?", "No", 0, ("yes", "no"));
+ if($yesno eq "no") {
+ return;
+ }
+ }
+
write_file("$ENV{'HOME'}/.swift/apps/$set_name.apps", @tc_data);
print "Successfully imported application set named $set_name\n";
}
More information about the Swift-commit
mailing list