cookutils diff lighttpd/index.cgi @ rev 904

Introduce SliTaz packages receipts v2. Tune 'cook' and 'lighttpd/index.cgi' for it. Small improvements to CSS styles.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri May 26 16:22:26 2017 +0300 (2017-05-26)
parents f3a90eaf1154
children c711ef2e51a9
line diff
     1.1 --- a/lighttpd/index.cgi	Thu May 18 13:14:23 2017 +0300
     1.2 +++ b/lighttpd/index.cgi	Fri May 26 16:22:26 2017 +0300
     1.3 @@ -575,15 +575,28 @@
     1.4  		if grep -q "cook:$pkg$" $command; then
     1.5  			show_note i "The Cooker is currently building $pkg"
     1.6  		elif fgrep -q "Summary for:" $log; then
     1.7 -			sed '/^Summary for:/,$!d' $log | head -n13 | awk '
     1.8 +			sed '/^Summary for:/,$!d' $log | awk '
     1.9  			BEGIN { print "<section>" }
    1.10 +			function row(line) {
    1.11 +				split(line, s, " : ");
    1.12 +				printf("\t<tr><td>%s</td><td>%s</td></tr>\n", s[1], s[2]);
    1.13 +			}
    1.14 +			function row2(line, rowNum) {
    1.15 +				split(line, s, " : ");
    1.16 +				if (rowNum == 1)
    1.17 +					printf("\t<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n", s[1], s[2], s[3], s[4], s[5]);
    1.18 +				else
    1.19 +					printf("\t<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", s[1], s[2], s[3], s[4], s[5]);
    1.20 +			}
    1.21  			{
    1.22 -				if (NR==1) {
    1.23 -					printf("<h3>%s</h3>\n<table>\n", $0)
    1.24 -				} else if ($0 !~ "===") {
    1.25 -					split($0, s, " : ");
    1.26 -					printf("<tr><td>%s</td><td>%s</td></tr>", s[1], s[2]);
    1.27 +				if (NR==1) { printf("<h3>%s</h3>\n<table>\n", $0); next }
    1.28 +				if ($0 ~ "===") { seen++; if (seen == 1) next; else exit; }
    1.29 +				if ($0 ~ "---") {
    1.30 +					seen2++;
    1.31 +					if (seen2 == 1) printf("</table>\n<table class=\"pkgslist\">\n")
    1.32 +					next
    1.33  				}
    1.34 +				if (seen2) row2($0, seen2); else row($0);
    1.35  			}
    1.36  			END { print "</table></section>" }
    1.37  			'
    1.38 @@ -1022,7 +1035,7 @@
    1.39  			echo -n '<section><h3>Unpackaged files:</h3><pre class="files">'
    1.40  			echo "$orphans" | awk '
    1.41  			function tag(text, color) { printf("<span class=\"c%s1\">%s</span> %s\n", color, text, $0); }
    1.42 -			/\/perllocal.pod$/ || /\/\.packlist$/ || /\/share\/bash-completion\// { tag("---", 0); next }
    1.43 +			/\/perllocal.pod$/ || /\/\.packlist$/ || /\/share\/bash-completion\// || /\/lib\/systemd\// { tag("---", 0); next }
    1.44  			/\.pod$/  { tag("pod", 5); next }
    1.45  			/\/share\/man\// { tag("man", 5); next }
    1.46  			/\/share\/doc\// || /\/share\/gtk-doc\// || /\/share\/info\// || /\/share\/devhelp\// { tag("doc", 5); next }