-
Notifications
You must be signed in to change notification settings - Fork 9
/
parseInstallLog.tcl
106 lines (91 loc) · 3.25 KB
/
parseInstallLog.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/sh
#exec tclsh "$0" "$@"
# parse EA install log files
#
# This program reads an install log, attempting to weed out all of the crap
#
# usage:
# tclsh parseInstallLog.tcl <logfile>
#
#---------------------------------------------------------------------
# parseFile
#
# Read from the install log, printing out only the relevant
# lines
#
# Results:
# None.
#---------------------------------------------------------------------
proc parseFile {filename} {
set lastlinefound false
if {[catch {open $filename r} f]} {
puts stdout "parselog: $f"
exit 1
}
while {[gets $f line] != -1} {
if {[string match {*\* This is build:*} $line]} {
puts $line
} elseif {[string match {*Read Previous Options File setting*} $line]} {
puts $line
} elseif {[ string match {*Executing action Copy File logfile to final location*} $line]} {
puts $line;set lastlinefound true
} elseif {[string match {*<%EC_AGENT_AGENT_NUMBER%> greater <%EC_PROCESSOR_COUNT%>*} $line]} {
puts $line
if {[gets $f line] != -1} { puts $line }
} elseif {[string match {*Check*} $line]} {
} elseif {[string match {*Installing*} $line]} {
} elseif {[string match {*Skipping action*} $line]} {
} elseif {[string match {*Executing*} $line]} {
} elseif {[string match {*Call Finish*} $line]} {
} elseif {[string match {*Copy*} $line]} {
} elseif {[string match {*Rename*} $line]} {
} elseif {[string match {*Error while executing*} $line]} {
puts **********************>;puts $line;
} elseif {[string match {*Building*} $line]} {
puts $line
} elseif {[string match {*WARNING*} $line]} {
puts $line
} elseif {[string match {*PATH=:*} $line]} {
puts $line
} elseif {[string match {*lofs*} $line]} {
puts $line
} elseif {[string match {*make*} $line]} {
puts $line
} elseif {[string match {*Wait For CM to Start*} $line]} {
puts $line
} elseif {[string match {*Create File Link*} $line]} {
puts $line
} elseif {[string match {*ERROR*} $line]} {
puts $line
} elseif {[string match {*\*\* Free Disk Size*} $line]} {
puts $line
if {[gets $f line] != -1} { puts $line }
if {[gets $f line] != -1} { puts $line }
if {[gets $f line] != -1} { puts $line }
if {[gets $f line] != -1} { puts $line }
if {[gets $f line] != -1} { puts $line }
} elseif {[string match {*Displaying pane*} $line]} {
puts $line
} elseif {[string match {*Setting active setup type to*} $line]} {
puts $line
}
}
if {$lastlinefound == false} {
puts stderr "The install log was abnormally terminated."
}
puts "** END OF INSTALL LOG **"
}
# ----------------------------------------------------------------------
# main
# ----------------------------------------------------------------------
proc main {} {
# Must be given name of input file.
set fname [lindex $::argv 0]
if {$fname == ""} {
puts stderr "Usage: parseInstallLog <logfile>"
exit 1
}
puts "Parsing $fname\n"
parseFile $fname
}
main