Author: sebor
Date: Wed Jan 2 16:44:53 2008
New Revision: 608297
URL: http://svn.apache.org/viewvc?rev=608297&view=rev
Log:
2008-01-02 Martin Sebor <[EMAIL PROTECTED]>
* xcomp.awk: Added a pattern to extract date formatted in the Windows
format (the output of date /T).
(get_date): Handled badly formatted/empty dates more robustly.
(get_buildtype): Handled build types with the [redundant] "win32" bit
indicating Windows threads.
(print_section): Stripped the leading directory component from the log
file name (the equivalent of basename).
(print_section): Formatted empty date as "N/A".
Modified:
incubator/stdcxx/trunk/bin/xcomp.awk
Modified: incubator/stdcxx/trunk/bin/xcomp.awk
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/bin/xcomp.awk?rev=608297&r1=608296&r2=608297&view=diff
==============================================================================
--- incubator/stdcxx/trunk/bin/xcomp.awk (original)
+++ incubator/stdcxx/trunk/bin/xcomp.awk Wed Jan 2 16:44:53 2008
@@ -226,7 +226,7 @@
########################################################################
# logfile only processing below
-# action to extract the build date and time
+# action to extract the (POSIX) build date and time (date output)
/^##* *date *: *$/ {
getline
@@ -235,6 +235,15 @@
}
+# action to extract the Windows build date (date /T output)
+/ *date *[/]T *$/ {
+
+ getline
+
+ logdates [FILENAME] = $0
+}
+
+
# action at the beginning of component table
/^NAME *STATUS WARN/ {
start = 1
@@ -443,11 +452,28 @@
function get_date(fulldate)
{
- split(fulldate, fields)
- month = fields [2]
- mday = fields [3]
+ n = split(fulldate, fields)
+
+ if (2 == n) {
+ # assume Windows 'date /T' format (i.e., "AbWeekDay MM/DD/YYYY")
+
+ date = fields [2]
- date = monthnames [month] "/" mday
+ split(date, fields, "/")
+
+ date = (0 + fields [1]) "/" (0 + fields [2])
+ }
+ else if (2 < n) {
+ # assume POSIX standard 'date' format in the "C" locale
+ # i.e., "AbWeekDay AbMon D HH:MM:SS $TZ YYYY"
+
+ month = fields [2]
+ mday = fields [3]
+
+ date = monthnames [month] "/" mday
+ }
+ else
+ date = "N/A"
return date
}
@@ -466,13 +492,14 @@
{
# look for the beginning of the buildtype component followed
# by the (Subversion) revision number
- pos = match(fname, "-[1-9][0-9]*[aAdDsS]-[1-9][0-9]*-log")
+ pos = match(fname, "-(8|11|12|15)[aAdDsS]-[1-9][0-9]*-log")
# is not found, try looking for the buildtype followed by
# the name of the threads library and only then followed
# by the (Subversion) revision number
if (0 == pos)
- pos = match(fname, "-[1-9][0-9]*[aAdDsS]-[a-z][a-z]*-[1-9][0-9]*-log*")
+ pos = match(fname,
+ "-(8|11|12|15)[aAdDsS]-[a-z][a-z_0-9]*-[1-9][0-9]*-log*")
buildtype = substr(fname, pos + 1)
@@ -760,9 +787,17 @@
logname = logfnames [i]
- loggzfname = substr(logname, 1, index(logname, ".txt") - 1) ".gz.txt"
+ # strip the leading directory prefix, if any
+ pos = match(logname, "/[^/]+$")
+ if (0 < pos)
+ loggzfname = substr(logname, pos + 1)
+
+ # insert the .gz suffix before the final .txt suffix
+ # to form the name of the original gzipped log file
+ loggzfname = substr(loggzfname, 1, index(loggzfname, ".txt") - 1)
+ loggzfname = loggzfname ".gz.txt"
- colnos = colnos " <td title=\"" logname "\">"
+ colnos = colnos " <td title=\"" loggzfname "\">"
colnos = colnos "<a href=\"" loggzfname "\">" i "</a></td>"
buildtype = get_buildtype(logname)
@@ -770,9 +805,18 @@
row1 = row1 " <td title=\"" buildmode "\">" buildtype
"</td>\n"
- fulldate = logdates [logname]
- date = get_date(fulldate)
- time = get_time(fulldate)
+ if (logname in logdates) {
+ # parse the date and time from the date extracted
+ # from the log
+ fulldate = logdates [logname]
+ date = get_date(fulldate)
+ time = get_time(fulldate)
+ }
+ else {
+ # date not available
+ fulldate = "unknown date"
+ date = "N/A"
+ }
row2 = row2 " <td title=\"" fulldate "\">" date "</td>\n"
}