cookutils diff lighttpd/index.cgi @ rev 989

cook: initial support of --trials|-t; copy(): @rm as quick alias for remove_already_packed(); cook_copy_icons(): initial removing of all hicolor icons; lighttpd/index.cgi: extend packages info; some more tiny edits.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Oct 28 16:04:43 2017 +0300 (2017-10-28)
parents 3417c788230c
children c13b693c75c8
line diff
     1.1 --- a/lighttpd/index.cgi	Sun Oct 22 19:16:17 2017 +0300
     1.2 +++ b/lighttpd/index.cgi	Sat Oct 28 16:04:43 2017 +0300
     1.3 @@ -507,6 +507,7 @@
     1.4  				\
     1.5  				-e 's#^.*[Ff][Aa][Ii][Ll][Ee][Dd].*#<b>\0</b>#' \
     1.6  				-e 's#^.*[Ff]atal.*#<b>\0</b>#' \
     1.7 +				-e '/non-fatal/ s|</*b>||g' \
     1.8  				-e 's#^.*[Nn]ot found.*#<b>\0</b>#' \
     1.9  				-e 's#^.*[Nn]o such file.*#<b>\0</b>#' \
    1.10  				-e 's#^.*No package .* found.*#<b>\0</b>#' \
    1.11 @@ -547,7 +548,9 @@
    1.12  					s|$_stuff|<var>\${stuff}</var>|g" \
    1.13  				-e "s|\[9\([1-6]\)m|<span class='c\10'>|;
    1.14  					s|\[39m|</span>|;
    1.15 -					s|\[1m|<strong>|g; s|\[0m|</strong>|g;"
    1.16 +					s|\[1m|<strong>|g; s|\[0m|</strong>|g" \
    1.17 +				-e "s|^+.*|<i>\0</i>|;
    1.18 +					s|^-.*|<b>\0</b>|; /----/s|</*b>||"
    1.19  			;;
    1.20  
    1.21  		files)
    1.22 @@ -661,7 +664,7 @@
    1.23  	local log active bpkg
    1.24  	log="$LOGS/$pkg.log"
    1.25  
    1.26 -	echo "<h2><a href=\"$base/$pkg\">$pkg</a></h2>"
    1.27 +	echo "<h2><a href=\"$base/$pkg\">$pkg</a>$(. $wok/$pkg/receipt; [ -n "$SHORT_DESC" ] && echo ": $SHORT_DESC")</h2>"
    1.28  	echo '<div id="info">'
    1.29  	echo "<a class='button icon receipt$(active receipt stuff)' href='$base/$pkg/receipt'>receipt &amp; stuff</a>"
    1.30  
    1.31 @@ -691,8 +694,11 @@
    1.32  	[ -d "$wok/$pkg/install/usr/share/info" ] &&
    1.33  		echo "<a class='button icon doc$(active info)' href='$base/$pkg/info/#Top'>info</a>"
    1.34  
    1.35 -	[ -n "$LFS" ] &&
    1.36 -		echo "<a class='button icon doc' href='$LFS' target='_blank' rel='noopener noreferrer'>(B)LFS</a>"
    1.37 +	if [ -n "$LFS" ]; then
    1.38 +		printf "<a class='button icon doc' href='%s' target='_blank' rel='noopener noreferrer'>" "$LFS"
    1.39 +		[ "${LFS/blfs/}" != "$LFS" ] && printf "B"
    1.40 +		printf "LFS</a>\n"
    1.41 +	fi
    1.42  
    1.43  	[ -s "$log" ] &&
    1.44  		echo "<a class='button icon log$(active log)' href='$base/$pkg/log/'>logs</a>"
    1.45 @@ -1019,6 +1025,7 @@
    1.46  	'')
    1.47  		page_header
    1.48  
    1.49 +		requested_pkg="$pkg"
    1.50  		# Package info.
    1.51  		if [ ! -f "$wok/$pkg/receipt" ]; then
    1.52  			# Let's look at the cases when the package was not found
    1.53 @@ -1069,13 +1076,15 @@
    1.54  		summary "$log"
    1.55  
    1.56  		# Informal table with dependencies
    1.57 +		pkg="$requested_pkg"
    1.58  		cat <<EOT
    1.59  <section>
    1.60 -	<h3>Dependencies of packages</h3>
    1.61 -	<table class="half">
    1.62 +	<h3>Related packages</h3>
    1.63 +	<table class="third">
    1.64  		<thead>
    1.65  			<tr>
    1.66  				<th>Build dependencies</th>
    1.67 +				<th>Runtime dependencies</th>
    1.68  				<th>Required by</th>
    1.69  			</tr>
    1.70  		</thead>
    1.71 @@ -1094,6 +1103,23 @@
    1.72  					<table>
    1.73  EOT
    1.74  		{
    1.75 +			[ -s "$PKGS/packages.info" ] &&
    1.76 +			awk -F$'\t' -vp="$pkg" '{
    1.77 +				if ($1 == p) print $8
    1.78 +			}' "$PKGS/packages.info"
    1.79 +		} | tr ' ' '\n' | sort -u | \
    1.80 +		while read i; do
    1.81 +			[ -n "$i" ] &&
    1.82 +			echo "<tr><td><img src='$base/s/$i'> <a href='$base/$i'>$i</a></td></tr>"
    1.83 +		done
    1.84 +		cat <<EOT
    1.85 +					</table>
    1.86 +				</td>
    1.87 +				<td>
    1.88 +					<table>
    1.89 +EOT
    1.90 +
    1.91 +		{
    1.92  			for i in $(awk -F$'\t' -vp="$pkg" '{if($1==p)print $2}' $splitdb); do
    1.93  
    1.94  				[ -s "$PKGS/packages.info" ] &&
    1.95 @@ -1336,6 +1362,7 @@
    1.96  			/\/share\/locale\// { tag("loc", 4); next }
    1.97  			/\.h$/ || /\.a$/ || /\.la$/ || /\.pc$/ || /\/bin\/.*-config$/ ||
    1.98  				/\/Makefile.*$/ { tag("dev", 3); next }
    1.99 +			/\/share\/help\// || /\/share\/appdata\// { tag("gnm", 6); next }
   1.100  			{ tag("???", 1) }
   1.101  			' > $table
   1.102  
   1.103 @@ -1346,7 +1373,7 @@
   1.104  					head) echo -n '<table class="summary"><tr>';;
   1.105  					body) echo -n '<th> </th></tr><tr>';;
   1.106  				esac
   1.107 -				for j in '???1' dev3 loc4 ico2 doc5 man5 pod5 '---0'; do
   1.108 +				for j in '???1' dev3 loc4 ico2 doc5 man5 pod5 gnm6 '---0'; do
   1.109  					tag=${j:0:3}; class="c${j:3:1}0"; [ "$class" == 'c00' ] && class='c01'
   1.110  					case $i in
   1.111  						head) echo -n "<th class='$class'>$tag</th>";;