diff options
author | joerg <joerg@pkgsrc.org> | 2008-06-11 19:27:03 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-06-11 19:27:03 +0000 |
commit | 09969f89837b13bf25e451507334a9f42486bd27 (patch) | |
tree | d3e08f313962c0bf535bf8148d7a71cf3b129746 | |
parent | 879bffa757465aec7d45eea2ad082d633b8e01c0 (diff) | |
download | pkgsrc-09969f89837b13bf25e451507334a9f42486bd27.tar.gz |
pbulk-0.31:
- For direct build failures, make the package location in the first
column a hyper link to the last (supposedly failing) phase.
- For indirect failures, list the first 10 failing dependencies.
-rw-r--r-- | pkgtools/pbulk/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk | 74 |
2 files changed, 70 insertions, 8 deletions
diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index b02402e175a..f9e4457160b 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.39 2008/04/18 06:30:47 bjs Exp $ +# $NetBSD: Makefile,v 1.40 2008/06/11 19:27:03 joerg Exp $ -DISTNAME= pbulk-0.30 +DISTNAME= pbulk-0.31 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk index 315ea69a563..0710f55031e 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk @@ -1,5 +1,5 @@ #!@AWK@ -f -# $NetBSD: create-report-html.awk,v 1.10 2008/04/07 19:41:07 joerg Exp $ +# $NetBSD: create-report-html.awk,v 1.11 2008/06/11 19:27:03 joerg Exp $ # # Copyright (c) 2007, 2008 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -93,9 +93,9 @@ function print_pre_fail_reason(PKGNAME, chars, in_quote, in_sep, i) { function print_failed(PKGNAME, cmd, has_pre_clean, has_depends, has_checksum,has_configure, has_build, has_install, has_package, - has_clean, has_deinstall) { - cmd = "ls " log_dir "/" PKGNAME " 2>/dev/null" + has_clean, has_deinstall, last_error) { if (status[PKGNAME] == "failed") { + cmd = "ls " log_dir "/" PKGNAME " 2>/dev/null" while ((cmd | getline) > 0) { if ($0 == "pre-clean.log") has_pre_clean = 1 @@ -117,9 +117,31 @@ function print_failed(PKGNAME, cmd, has_pre_clean, has_depends, has_deinstall = 1 } close(cmd) + + if (has_deinstall) + last_error = "deinstall.log" + else if (has_clean) + last_error = "clean.log" + else if (has_package) + last_error = "package.log" + else if (has_install) + last_error = "install.log" + else if (has_build) + last_error = "build.log" + else if (has_configure) + last_error = "configure.log" + else if (has_checksum) + last_error = "checksum.log" + else if (has_depends) + last_error = "depends.log" + else if (has_pre_clean) + last_error = "pre-clean.log" } print "<tr class=\"" status[PKGNAME] "\">" > html_report - print "<td>" location[PKGNAME] "</td>" > html_report + if (last_error) + print "<td><a href=\"../" PKGNAME "/" last_error "\"> " location[PKGNAME] "</a></td>" > html_report + else + print "<td>" location[PKGNAME] "</td>" > html_report print "<td>" PKGNAME "</td>" > html_report if (depth[PKGNAME] == 0) print "<td> </td>" > html_report @@ -137,6 +159,14 @@ function print_failed(PKGNAME, cmd, has_pre_clean, has_depends, print_failed_log_line(PKGNAME, "clean", has_clean) print_failed_log_line(PKGNAME, "deinstall", has_deinstall) print "</tr>" > html_report + if (status[PKGNAME] == "indirect-failed") { + print "<tr class=\"" status[PKGNAME] "\">" > html_report + printf "<td> </td>" > html_report + printf "<td colspan=\"13\"> Failed: " > html_report + printf "%s", failed_pkgs[PKGNAME] > html_report + print "</td>" > html_report + print "</tr>" > html_report + } if (status[PKGNAME] == "prefailed") { print "<tr class=\"" status[PKGNAME] "\">" > html_report printf "<td> </td>" > html_report @@ -147,6 +177,35 @@ function print_failed(PKGNAME, cmd, has_pre_clean, has_depends, } } +function compute_direct_failure(CUR, dep, cur_dep, cur_depends, found, i) { + if (failed_pkgs[CUR] != "") + return + split(depends[CUR], cur_depends, "[ \t]+") + for (dep in cur_depends) { + cur_dep = cur_depends[dep] + if (status[cur_dep] == "failed") { + failed_pkgs[CUR] = failed_pkgs[CUR] " " cur_dep + } else if (status[cur_dep] == "indirect-failed") { + compute_direct_failure(cur_dep) + failed_pkgs[CUR] = failed_pkgs[cur_dep] " " failed_pkgs[CUR] + } + } + split(failed_pkgs[CUR], cur_depends, "[ \t]+") + failed_pkgs[CUR] = "" + for (dep in cur_depends) { + cur_dep = cur_depends[dep] + found[cur_dep] = 1 + } + i = 0 + for (dep in found) { + if (++i == 10) { + failed_pkgs[CUR] = failed_pkgs[CUR] " ..." + break; + } + failed_pkgs[CUR] = failed_pkgs[CUR] " " dep + } +} + BEGIN { meta_dir = ARGV[1] log_dir = ARGV[2] @@ -186,6 +245,8 @@ BEGIN { status[cur] = substr($0, 14) else if ($0 ~ "^PKG_FAIL_REASON=") pre_fail_reason[cur] = substr($0, 17) + else if ($0 ~ "^DEPENDS=") + depends[cur] = substr($0, 9) } close(report_file) @@ -196,9 +257,10 @@ BEGIN { ++pkgs_failed else if (status[pkg] == "prefailed") ++pkgs_prefailed - else if (status[pkg] == "indirect-failed") + else if (status[pkg] == "indirect-failed") { + compute_direct_failure(pkg) ++pkgs_indirect_failed - else if (status[pkg] == "indirect-prefailed") + } else if (status[pkg] == "indirect-prefailed") ++pkgs_indirect_prefailed } |