[Piuparts-commits] rev 445 - piatti/home/piupartsm/bin trunk trunk/debian
Holger Levsen
holger at alioth.debian.org
Sat Jun 20 12:58:26 UTC 2009
Author: holger
Date: 2009-06-20 12:58:25 +0000 (Sat, 20 Jun 2009)
New Revision: 445
Modified:
piatti/home/piupartsm/bin/detect_well_known_errors
trunk/TODO
trunk/debian/changelog
trunk/piuparts-report.py
Log:
generate pages for known issues, which are detected by bash helper
script, run by cron on piuparts.debian.org and available from
svn/piuparts/piatti/home/piupartsm/bin/detect_well_known_errors
Modified: piatti/home/piupartsm/bin/detect_well_known_errors
===================================================================
--- piatti/home/piupartsm/bin/detect_well_known_errors 2009-06-20 12:52:03 UTC (rev 444)
+++ piatti/home/piupartsm/bin/detect_well_known_errors 2009-06-20 12:58:25 UTC (rev 445)
@@ -47,7 +47,7 @@
if [ -s $LOGS ] ; then
OUTPUT=$HTDOCS/$SECTION/${problem%.conf}.tpl
echo '<table class="righttable"><tr class="titlerow"><td class="titlecell">' > $OUTPUT
- echo "$HEADER" >> $OUTPUT
+ echo "$HEADER in $SECTION" >> $OUTPUT
echo '</td></tr><tr class="normalrow"><td class="contentcell2">' >> $OUTPUT
echo "$HELPTEXT" >> $OUTPUT
echo '</td></tr><tr class="titlerow"><td class="alerttitlecell">Please file bugs!</td></tr></tr><tr class="normalrow"><td class="contentcell2" colspan="3">' >> $OUTPUT
@@ -55,7 +55,7 @@
echo "<p>Affected packages in $SECTION: $COUNT</p>" >> $OUTPUT
echo "<ul>" >> $OUTPUT
for LOG in $(cat $LOGS) ; do
- echo "<li><a href='/$LOG'>$LOG</a></li>" >> $OUTPUT
+ echo "<li><a href='/$SECTION/$LOG'>$LOG</a></li>" >> $OUTPUT
done
echo "$LOGS" >> ${KNOWNLOGS[$NR]}
echo "</ul></td></tr></table>" >> $OUTPUT
@@ -83,7 +83,7 @@
if [ -s $LOGS ] ; then
OUTPUT=$HTDOCS/$SECTION/unknown_failures.tpl
echo '<table class="righttable"><tr class="titlerow"><td class="titlecell">' > $OUTPUT
- echo "Packages with failures not yet well known detected" >> $OUTPUT
+ echo "Packages with failures not yet well known detected in $SECTION" >> $OUTPUT
echo '</td></tr><tr class="normalrow"><td class="contentcell2">' >> $OUTPUT
echo "<p>Please investigate and improve detection of known error types!</p>" >> $OUTPUT
echo '</td></tr><tr class="titlerow"><td class="alerttitlecell">Please file bugs!</td></tr></tr><tr class="normalrow"><td class="contentcell2" colspan="3">' >> $OUTPUT
@@ -91,7 +91,7 @@
echo "<p>Affected packages in $SECTION: $COUNT</p>" >> $OUTPUT
echo "<ul>" >> $OUTPUT
for LOG in $(cat $LOGS) ; do
- echo "<li><a href='/$LOG'>$LOG</a></li>" >> $OUTPUT
+ echo "<li><a href='/$SECTION/$LOG'>$LOG</a></li>" >> $OUTPUT
done
echo "</ul></td></tr></table>" >> $OUTPUT
fi
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-06-20 12:52:03 UTC (rev 444)
+++ trunk/TODO 2009-06-20 12:58:25 UTC (rev 445)
@@ -3,10 +3,8 @@
for 0.36:
-- create pages for known problems
+- PackagesDB: get rid of 50% of unique() - done, Lars just needs to test and commit
-- PackagesDB: get rid of 50% of unique() :)
-
once 0.36 is released:
- integration with packages.qa.debian.org
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2009-06-20 12:52:03 UTC (rev 444)
+++ trunk/debian/changelog 2009-06-20 12:58:25 UTC (rev 445)
@@ -75,6 +75,9 @@
- include index.tpl (if it exists) from output-directory into the
generated index page, so one can add news to the index page without
editing piuparts-report.py.
+ - generate pages for known issues, which are detected by bash helper
+ script, run by cron on piuparts.debian.org and available from
+ svn/piuparts/piatti/home/piupartsm/bin/detect_well_known_errors
* Always use alphabetic time zone abbreviation in timestamps.
* Makefile:
- add "~$date" to versionstring if building an unreleased version, thus
Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py 2009-06-20 12:52:03 UTC (rev 444)
+++ trunk/piuparts-report.py 2009-06-20 12:58:25 UTC (rev 445)
@@ -1,6 +1,7 @@
#!/usr/bin/python
#
# Copyright 2005 Lars Wirzenius (liw at iki.fi)
+# Copyright 2009 Holger Levsen (holger at layer-acht.org)
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -265,6 +266,12 @@
</table>
"""
+ANALYSIS_BODY_TEMPLATE = """
+ <table class="righttable">
+ $rows
+ </table>
+"""
+
# this template is normally replaced with from $htdocs
INDEX_BODY_TEMPLATE = """
<table class="righttable">
@@ -329,7 +336,19 @@
"untestable": "dependency-cannot-be-tested",
}
+linktarget_by_template = {
+ "command_not_found_error.tpl": "due to a 'command not found' error",
+ "files_in_usr_local_error.tpl": "due to files in /usr/local",
+ "overwrite_other_packages_files_error.tpl": "due to overwriting other packages files",
+ "owned_files_after_purge_error.tpl": "due to owned files existing after purge",
+ "owned_files_by_many_packages_error.tpl": "due to owned files by many packages",
+ "processes_running_error.tpl": "due to leaving processes running behind",
+ "unowned_files_after_purge_error.tpl": "due to unowned files after purge",
+ "unknown_failures.tpl": "unclassified failures",
+ "command_not_found_issue.tpl": "but logfile contains 'command not found'",
+}
+
class Config(piupartslib.conf.Config):
def __init__(self, section="report"):
@@ -788,16 +807,48 @@
r('legend(x="bottom",legend=colnames(t), ncol=2,fill=1:13,xjust=0.5,yjust=0,bty="n")')
return "<tr class=\"normalrow\"> <td class=\"contentcell2\" colspan=\"3\"><a href=\"%s\"><img src=\"/%s/%s\" height=\"450\" width=\"800\" alt=\"Package states in the last 2 months\"></a></td></tr>\n" % ("bimonthly-states.png", self._config.section, "bimonthly-states.png")
+ def create_and_link_to_analysises(self,state):
+ link="<ul>"
+ print self._output_directory
+ templates = find_files_with_suffix(self._output_directory,".tpl")
+ print state
+ for template in templates:
+ if (state == "failed-testing" and template[-9:] != "issue.tpl") or (state == "successfully-tested" and template[-9:] == "issue.pl"):
+ print template
+
+ tpl = os.path.join(self._output_directory, template)
+ f = file(tpl, "r")
+ analysis = file.read(f)
+ f.close()
+ os.unlink(tpl)
+
+ htmlpage = string.Template(HTML_HEADER + ANALYSIS_BODY_TEMPLATE + HTML_FOOTER)
+ filename = os.path.join(self._output_directory, template[:-len(".tpl")]+".html")
+ f = file(filename, "w")
+ f.write(htmlpage.safe_substitute( {
+ "section_navigation": create_section_navigation(self._section_names,self._config.section),
+ "time": time.strftime("%Y-%m-%d %H:%M %Z"),
+ "rows": analysis,
+ }))
+ f.close()
+
+ link += "<li><a href=%s>%s</a></li>" % (template[:-len(".tpl")]+".html", linktarget_by_template[template])
+ link += "</ul>"
+ return link
+
def write_section_index_page(self,dirs,total_packages):
tablerows = ""
for state in self._binary_db.get_states():
dir_link = ""
+ analysis = ""
for dir in dirs:
if dir in ("pass","fail","bugged") and state_by_dir[dir] == state:
dir_link += "<a href='%s.html'>%s</a> logs<br>" % (dir, html_protect(dir))
- tablerows += ("<tr class=\"normalrow\"><td class=\"contentcell2\"><a href='state-%s.html'>%s</a></td>" +
+ if state in ("successfully-tested", "failed-testing"):
+ analysis = self.create_and_link_to_analysises(state)
+ tablerows += ("<tr class=\"normalrow\"><td class=\"contentcell2\"><a href='state-%s.html'>%s</a>%s</td>" +
"<td class=\"contentcell2\">%d</td><td class=\"contentcell2\">%s</td></tr>\n") % \
- (html_protect(state), html_protect(state), len(self._binary_db.get_packages_in_state(state)),
+ (html_protect(state), html_protect(state), analysis, len(self._binary_db.get_packages_in_state(state)),
dir_link)
try:
tablerows += self.make_stats_graph();
More information about the Piuparts-commits
mailing list