From e3dcc5733343ce125f7d60c13936e24aa242f4dc Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 7 Apr 2008 19:41:07 +0000 Subject: pbulk-0.30: Print the collected PKG_FAIL_REASON in the HTML version of the report. --- pkgtools/pbulk/Makefile | 4 +- .../files/pbulk/scripts/create-report-html.awk | 55 ++++++++++++++++++++-- 2 files changed, 53 insertions(+), 6 deletions(-) (limited to 'pkgtools/pbulk') diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index 07bcdf0d387..9c2abbdf8ad 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.37 2008/04/04 17:58:59 joerg Exp $ +# $NetBSD: Makefile,v 1.38 2008/04/07 19:41:07 joerg Exp $ -DISTNAME= pbulk-0.29 +DISTNAME= pbulk-0.30 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 059ae0cbf9a..315ea69a563 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk +++ b/pkgtools/pbulk/files/pbulk/scripts/create-report-html.awk @@ -1,7 +1,7 @@ #!@AWK@ -f -# $NetBSD: create-report-html.awk,v 1.9 2008/03/01 19:04:37 rillig Exp $ +# $NetBSD: create-report-html.awk,v 1.10 2008/04/07 19:41:07 joerg Exp $ # -# Copyright (c) 2007 Joerg Sonnenberger . +# Copyright (c) 2007, 2008 Joerg Sonnenberger . # All rights reserved. # # This code was developed as part of Google's Summer of Code 2007 program. @@ -53,6 +53,44 @@ function print_failed_log_line(PKGNAME, PHASE, VAR) { print " " > html_report } +function print_pre_fail_reason(PKGNAME, chars, in_quote, in_sep, i) { + split(pre_fail_reason[PKGNAME], chars, "") + in_quote = 0 + in_sep = 0 + for (i = 1; i < length(chars); ++i) { + if (chars[i] == "\"") { + in_quote = 1 - in_quote + continue + } + if (in_quote == 0 && chars[i] == " ") { + if (!in_sep) + printf "
" > html_report + in_sep = 1 + continue + } + in_sep = 0 + + if (chars[i] == "\\") { + ++i + if (chars[i] == "n") + printf " " > html_report + else if (chars[i] == "t") + printf " " > html_report + else if (chars[i] == "<") + printf "<" > html_report + else if (chars[i] == ">") + printf ">" > html_report + else if (chars[i] == "&") + printf "&" > html_report + else + printf "%s", chars[i] > html_report + continue + } + printf "%s", chars[i] > html_report + } + printf "\n" > html_report +} + function print_failed(PKGNAME, cmd, has_pre_clean, has_depends, has_checksum,has_configure, has_build, has_install, has_package, has_clean, has_deinstall) { @@ -99,6 +137,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 "" > html_report + if (status[PKGNAME] == "prefailed") { + print "" > html_report + printf " " > html_report + printf "" > html_report + print_pre_fail_reason(PKGNAME) + print "" > html_report + print "" > html_report + } } BEGIN { @@ -136,9 +182,10 @@ BEGIN { location[cur] = substr($0, 14) else if ($0 ~ "^PKG_DEPTH=") depth[cur] = substr($0, 11) - 1 - else if ($0 ~ "^BUILD_STATUS=") { + else if ($0 ~ "^BUILD_STATUS=") status[cur] = substr($0, 14) - } + else if ($0 ~ "^PKG_FAIL_REASON=") + pre_fail_reason[cur] = substr($0, 17) } close(report_file) -- cgit v1.2.3