tputs "<table border=\"0\">"
tputs " <tr>"
tputs " <th>"
- tputs " Last run"
+ tputs " Status"
tputs " </th>"
tputs " <td>"
- if { [file exists "@@PREFIX@@/lib/koakuma/db/data/$projname/lastrun"] } {
- set fid [open "@@PREFIX@@/lib/koakuma/db/data/$projname/lastrun" "r"]
- set date "[clock format "[gets $fid]" -format "%a %b %d %H:%M:%S %Z %Y"]"
+ if { [file exists "@@PREFIX@@/lib/koakuma/db/data/$projname/build.lock"] } {
+ set fid [open "@@PREFIX@@/lib/koakuma/db/data/$projname/build.loc" "r"]
+ if { [file exists "/proc/[gets $fid]"] } {
+ tputs "Running"
+ } else {
+ tputs "Idle"
+ }
close $fid
- tputs "$date"
} else {
- tputs "No builds yet"
+ tputs "Idle"
}
tputs " "
tputs " </td>"
tputs " </tr>"
tputs " <tr>"
tputs " <th>"
- tputs " Status"
+ tputs " Last run"
tputs " </th>"
tputs " <td>"
- if { [file exists "@@PREFIX@@/lib/koakuma/db/data/$projname/build.lock"] } {
- set fid [open "@@PREFIX@@/lib/koakuma/db/data/$projname/build.loc" "r"]
- if { [file exists "/proc/[gets $fid]"] } {
- tputs "Running"
- } else {
- tputs "Idle"
- }
+ if { [file exists "@@PREFIX@@/lib/koakuma/db/data/$projname/lastrun"] } {
+ set fid [open "@@PREFIX@@/lib/koakuma/db/data/$projname/lastrun" "r"]
+ set date "[clock format "[gets $fid]" -format "%a %b %d %H:%M:%S %Z %Y"]"
close $fid
+ tputs "$date"
} else {
- tputs "Idle"
+ tputs "No builds yet"
}
tputs " "
tputs " </td>"