diff options
author | Rob Austein <sra@hactrn.net> | 2011-07-08 15:53:24 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-07-08 15:53:24 +0000 |
commit | 63a931bab1b225fd1d4f681d6dd28097fb19c2f1 (patch) | |
tree | 07838740af2e55eee75d7c33cca8cbd573c46fc5 | |
parent | dce20e4da60f4d170eacafeb2b282c6a92018dcf (diff) |
Remove fake "hostname" column from XML, now that we no longer need it
to maintain column-count match with <host/> elements.
svn path=/rcynic-ng/rcynic.c; revision=3926
-rw-r--r-- | rcynic-ng/rcynic.c | 3 | ||||
-rw-r--r-- | rcynic-ng/show.awk | 6 | ||||
-rw-r--r-- | rcynic-ng/show.xsl | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/rcynic-ng/rcynic.c b/rcynic-ng/rcynic.c index b9518966..3dfeba85 100644 --- a/rcynic-ng/rcynic.c +++ b/rcynic-ng/rcynic.c @@ -4217,8 +4217,7 @@ int main(int argc, char *argv[]) ok &= fprintf(f, "<?xml version=\"1.0\" ?>\n" "<rcynic-summary date=\"%s\" rcynic-version=\"%s\"" " summary-version=\"%d\" reporting-hostname=\"%s\">\n" - " <labels>\n" - " <hostname>Publication Repository</hostname>\n", + " <labels>\n", tad, svn_id, XML_SUMMARY_VERSION, hostname.s) != EOF; for (j = 0; ok && j < MIB_COUNTER_T_MAX; ++j) diff --git a/rcynic-ng/show.awk b/rcynic-ng/show.awk index bb7ac93e..84d33cda 100644 --- a/rcynic-ng/show.awk +++ b/rcynic-ng/show.awk @@ -19,6 +19,10 @@ BEGIN { FS = "\t"; + label[++nlabels] = "hostname"; + head["hostname", 1] = "Repository"; + head["hostname", 2] = "Host"; + width["hostname"] = length(head["hostname", 1]); } !NF { @@ -59,7 +63,7 @@ END { break; for (j = 1; j <= nlabels; j++) { if (j == 1) - printf "%*s", width[label[j]], head[label[j], i]; + printf "%-*s", width[label[j]], head[label[j], i]; else if (total[label[j]] > 0) printf " %*s", width[label[j]], head[label[j], i]; } diff --git a/rcynic-ng/show.xsl b/rcynic-ng/show.xsl index 9a31082f..c610adce 100644 --- a/rcynic-ng/show.xsl +++ b/rcynic-ng/show.xsl @@ -21,14 +21,21 @@ <xsl:output method="text" encoding="US-ASCII"/> + <!-- Translate rcynic XML into tab-delimited flat text --> <xsl:template match="/"> + + <!-- Write labels as two columns: <label> <tab> <text> --> <xsl:for-each select="rcynic-summary/labels/*"> <xsl:value-of select="name()"/> <xsl:text>	</xsl:text> <xsl:value-of select="."/> <xsl:text> </xsl:text> </xsl:for-each> + + <!-- Blank line between sections --> <xsl:text> </xsl:text> + + <!-- Write status as three colums: <timestamp> <tab> <status> <tab> <uri> --> <xsl:for-each select="rcynic-summary/validation_status"> <xsl:sort order="ascending" data-type="text" select="."/> <xsl:value-of select="@timestamp"/> @@ -38,6 +45,7 @@ <xsl:value-of select="."/> <xsl:text> </xsl:text> </xsl:for-each> + </xsl:template> </xsl:stylesheet> |