>From ec2ccbca2433d30e79bcf756d07b673835879035 Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson Date: Thu, 19 Sep 2013 19:47:29 +0200 Subject: [PATCH] pmccabe2html: Portability issue. Allow awk versions other than Gawk. Correct wrong HTML tag closures. --- ChangeLog | 13 +++++++++++++ build-aux/pmccabe2html | 12 ++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2cc6c94..b58a877 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2013-09-17 Mats Erik Andersson + + pmccabe2html: Portability to other awk versions. + The functions systime() and strftime() are available + in Gawk only. Properly close two HTML-tags 'style' + and 'span'. + * build-aux/pmccabe2html (BEGIN): Store timing + strings in EPOCH_TIME and CHRONOS_TIME. Replace + systime() in HTML_COMMENT. + (html_header): Correctly close tag 'style'. + (END): Replace strftime() by CHRONOS_TIME. Close + tag 'span' correctly, not as 'div'. + 2013-09-17 Mats Erik Andersson (tiny change) getgroups: statement without effect diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html index 863c73e..094c3e9 100644 --- a/build-aux/pmccabe2html +++ b/build-aux/pmccabe2html @@ -47,6 +47,10 @@ # Prologue & configuration BEGIN { + # Portable lookup of present time. + "date +%s" | getline epoch_time + "date" | getline chronos_time + section_global_stats_p = 1 section_function_cyclo_p = 1 @@ -69,7 +73,7 @@ BEGIN { Copyright (c) 2007, 2008 Free Software Foundation, Inc." html_doctype = "" - html_comment = "" + html_comment = "" html_title = "Cyclomatic Complexity report for " package_name # Wiki options @@ -211,7 +215,7 @@ function html_header () print cssline } print "-->" - print "" + print "" close(css) } print "" @@ -852,12 +856,12 @@ END { if (output_lang == "html") { print "
" package_name " Cyclomatic Complexity Report
" - print "

Report generated at: " strftime() "

" + print "

Report generated at: " chronos_time "

" } if (output_lang == "wiki") { print "==" package_name " Cyclomatic Complexity Report==" - print "Report generated at: '''" strftime() "'''" + print "Report generated at: '''" chronos_time "'''" } if (section_global_stats_p) -- 1.8.4.rc3