summaryrefslogtreecommitdiff
path: root/bin/auto_compile
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-29 23:44:16 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-29 23:44:16 +0000
commitcccb96021b16c66f554aa4930b409bef5b03d27c (patch)
tree3842a3ecf0f1a7c0aca114a285c6d554dce2e5a7 /bin/auto_compile
parent9b1e1507609aef4241b1f231befcfc6554e86db1 (diff)
downloadATCD-cccb96021b16c66f554aa4930b409bef5b03d27c.tar.gz
ChangeLogTag:Fri Jan 29 17:40:34 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'bin/auto_compile')
-rwxr-xr-xbin/auto_compile15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/auto_compile b/bin/auto_compile
index 1fab6da8ab1..d4ea2bb3708 100755
--- a/bin/auto_compile
+++ b/bin/auto_compile
@@ -70,6 +70,8 @@ $MAKEFLAGS = $ARGV[4];
# When an error is found we try to die gracefully and send some email
# to ADMIN.
+$disable_file = $LOGDIR . '/.disable';
+
sub mydie {
local @msg = @_;
open(MAIL, "|mail $ADMIN")
@@ -85,6 +87,8 @@ sub mydie {
close(MAIL)
|| die "cannot close email pipe on error: $msg\n";
print HIST 'FAILED', "\n";
+ unlink $disable_file
+ || die "cannot unlink disable file";
exit 0;
}
@@ -99,11 +103,17 @@ $date = localtime;
print HIST $CMD, ': running at ', $date, ' ';
-if (-f $LOGDIR . '/.disable') {
+if (-f $disable_file) {
print HIST "DISABLED\n";
exit 0;
}
+open (DISABLE, '>' . $disable_file)
+ || mydie "cannot open disable file";
+print DISABLE "auto_compile <$date> is running\n";
+close (DISABLE)
+ || mydie "cannot close disable file";
+
$LOGFILE = $LOGDIR . '/' . POSIX::strftime("%b%d_%Y.log", localtime);
open(LOG, '>' . $LOGFILE)
|| mydie "cannot open log file";
@@ -240,3 +250,6 @@ close(LOG)
print HIST "OK\n";
close(HIST)
|| mydie "cannot close history file";
+
+unline $disable_file
+ || mydie "cannot unlink disable file";