commit:3cbdf79c511129ad5a6856fffdaed230469d95eb
author:Chip Black
committer:Chip Black
date:Mon Aug 18 02:13:17 2008 -0500
parents:320fab753945ca5e407cf91161ac222f3b15ffcc
Changed runcheckdir so that failure and success only trigger once per change
diff --git a/runcheckdir b/runcheckdir
line changes: +7/-11
index 4964a4c..7dbfa2f
--- a/runcheckdir
+++ b/runcheckdir
@@ -76,19 +76,15 @@ $details = join('', <CHECK>);
 close CHECK;
 my $exitstatus = $? >> 8;
 
-if ($exitstatus == 0) {
-	foreach my $command (@{$on{success}}) {
-		do_command $command;
-	}
-} else {
-	foreach my $command (@{$on{failure}}) {
-		do_command $command;
-	}
+my $command;
+if ($exitstatus == 0 && $oldstatus != 0) {
+	do_command($command) foreach $command @{$on{success}};
+}
+if ($exitstatus != 0 && $oldstatus == 0) {
+	do_command($command) foreach $command @{$on{failure}};
 }
 if ($exitstatus != $oldstatus) {
-	foreach my $command(@{$on{change}}) {
-		do_command $command;
-	}
+	do_command($command) foreach $command @{$on{change}};
 }
 
 open STATUS, ">$dir/checkstatus";