cookutils rev 1022

lighttpd/index.cgi: syntax_highlighter(): fix colorization for audacious and audacious-pluging logs; update all_names() from `cook` to display all available packages under [download] section.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Jan 10 03:06:07 2018 +0200 (2018-01-10)
parents ee2f3d4790a4
children 713fecc03454
files lighttpd/index.cgi
line diff
     1.1 --- a/lighttpd/index.cgi	Fri Dec 29 13:05:43 2017 +0000
     1.2 +++ b/lighttpd/index.cgi	Wed Jan 10 03:06:07 2018 +0200
     1.3 @@ -550,14 +550,19 @@
     1.4  				\
     1.5  				-e "s|\[\([01]\)m\[3\([1-7]\)m|<span class='c\2\1'>|g;
     1.6  					s|\[\([01]\);3\([1-7]\)m|<span class='c\2\1'>|g;
     1.7 +					s|\[3\([1-7]\)m|<span class='c\10'>|g;
     1.8  					s|\[\([01]\);0m|<span class='c0\1'>|g;
     1.9  					s|\[0m|</span>|g;
    1.10  					s|\[m|</span>|g;
    1.11 -					s|\[0;10m|</span>|g;" \
    1.12 +					s|\[0;10m|</span>|g;
    1.13 +					s|\[K||g;" \
    1.14  				\
    1.15  				-e "s|\[9\([1-6]\)m|<span class='c\10'>|;
    1.16  					s|\[39m|</span>|;
    1.17 -					s|\[1m|<span class='c01'>|g;" \
    1.18 +					#s|\[1m|<span class='c01'>|g;
    1.19 +					s|\[1m|<span style='font-weight:bold'>|g; s|(B|</span>|g;
    1.20 +					s|\[m||g;
    1.21 +					" \
    1.22  				-e "s!^|\(+.*\)!|<span class='c20'>\1</span>!;
    1.23  					s!^|\(-.*\)!|<span class='c10'>\1</span>!;
    1.24  					s!^|\(@@.*@@\)\$!|<span class='c30'>\1</span>!;"
    1.25 @@ -769,14 +774,24 @@
    1.26  # Return all the names of packages bundled in this receipt
    1.27  
    1.28  all_names() {
    1.29 -	local split=" $SPLIT "
    1.30 -	if [ "${split/ $PACKAGE /}" != "$split" ]; then
    1.31 +	# Get package names from $SPLIT variable
    1.32 +	local split=$(echo $SPLIT \
    1.33 +		| awk '
    1.34 +			BEGIN { RS = " "; FS = ":"; }
    1.35 +			{ print $1; }' \
    1.36 +		| tr '\n' ' ')
    1.37 +	local split_space=" $split "
    1.38 +	if ! head -n1 $WOK/$pkg/receipt | fgrep -q 'v2'; then
    1.39 +		# For receipts v1: $SPLIT may present in the $WANTED package,
    1.40 +		# but split packages have their own receipts
    1.41 +		echo $PACKAGE
    1.42 +	elif [ "${split_space/ $PACKAGE /}" != "$split_space" ]; then
    1.43  		# $PACKAGE included somewhere in $SPLIT (probably in the end).
    1.44  		# We should build packages in the order defined in the $SPLIT.
    1.45 -		echo $SPLIT
    1.46 +		echo $split
    1.47  	else
    1.48  		# We'll build the $PACKAGE, then all defined in the $SPLIT.
    1.49 -		echo $PACKAGE $SPLIT
    1.50 +		echo $PACKAGE $split
    1.51  	fi
    1.52  }
    1.53