[Piuparts-commits] [piuparts] 04/09: p-r: dwke report: compute logpath, don't lookup
Holger Levsen
holger at moszumanska.debian.org
Sat Mar 1 21:08:40 UTC 2014
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 7f29a1871f61b814acb5a4954de6787643deb7b7
Author: Andreas Beckmann <anbe at debian.org>
Date: Fri Feb 21 00:45:57 2014 +0100
p-r: dwke report: compute logpath, don't lookup
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
piuparts-report.py | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/piuparts-report.py b/piuparts-report.py
index 70d6eaf..9184c43 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1477,10 +1477,6 @@ class Section:
# START detect_well_known_errors
-def get_pkgspec(logpath):
- """For a log full file spec, return the pkgspec (<pkg>_<version)"""
- return logpath.split('/')[-1]
-
def get_bug_text(logpath):
bugpath = replace_ext(logpath, BUG_EXT)
@@ -1492,10 +1488,6 @@ def get_bug_text(logpath):
return txt
-def section_path(logpath):
- """Convert a full log path name to one relative to the section directory"""
- return '/'.join([get_where(logpath), get_pkgspec(logpath)])
-
def populate_tpl(tmpl, vals):
for key in vals:
@@ -1508,20 +1500,20 @@ def update_tpl(basedir, section, problem, failures, logdict, ftpl, ptpl, pkgsdb)
pkg_text = ""
bugged_section = False
for failure in failures:
-
- pkgspec = failure.pkgspec
- bin_pkg = get_pkg(pkgspec)
+ bin_pkg = get_pkg(failure.pkgspec)
src_pkg = pkgsdb.get_source(bin_pkg)
rdep_cnt = pkgsdb.rrdep_count(bin_pkg)
- if bugged_section is False and get_where(logdict[pkgspec]) != 'fail':
+ if bugged_section is False and failure.where != 'fail':
bugged_section = True
pkg_text += "</ul><ul>\n"
+ log = os.path.join(failure.where, failure.pkgspec + LOG_EXT)
+
pkg_text += populate_tpl(ftpl, {
- 'LOG': section_path(logdict[pkgspec]),
+ 'LOG': log,
'PACKAGE': bin_pkg,
- 'BUG': get_bug_text(logdict[pkgspec]),
+ 'BUG': get_bug_text(log),
'RDEPS': rdep_cnt,
'SDIR':source_subdir(src_pkg),
'SPKG':src_pkg,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list