pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk pbulk-0.31:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/17b21eac84f9
branches:  trunk
changeset: 543260:17b21eac84f9
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Jun 11 19:27:03 2008 +0000

description:
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.

diffstat:

 pkgtools/pbulk/Makefile                                   |   4 +-
 pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk |  74 +++++++++++++-
 2 files changed, 70 insertions(+), 8 deletions(-)

diffs (140 lines):

diff -r 3fd771d60af2 -r 17b21eac84f9 pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile   Wed Jun 11 16:46:36 2008 +0000
+++ b/pkgtools/pbulk/Makefile   Wed Jun 11 19:27:03 2008 +0000
@@ -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 -r 3fd771d60af2 -r 17b21eac84f9 pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk
--- a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk Wed Jun 11 16:46:36 2008 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk Wed Jun 11 19:27:03 2008 +0000
@@ -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@localhost>.
 # All rights reserved.
@@ -93,9 +93,9 @@
 
 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 @@
                                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>&nbsp;</td>" > html_report
@@ -137,6 +159,14 @@
        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>&nbsp;</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>&nbsp;</td>" > html_report
@@ -147,6 +177,35 @@
        }
 }
 
+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 @@
                        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 @@
                        ++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
        }
 



Home | Main Index | Thread Index | Old Index