cookutils rev 1025

cook: fix but while CONFIG_FILES wasn't added to generated receipt (thanks Ceel); lighttpd/index.cgi: show "Latest cook" listing with modern BusyBox too.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jan 27 11:43:58 2018 +0200 (7 months ago)
parents be4a05be1a6f
children c51331bcb617
files cook lighttpd/index.cgi
line diff
     1.1 --- a/cook	Wed Jan 24 12:14:38 2018 +0200
     1.2 +++ b/cook	Sat Jan 27 11:43:58 2018 +0200
     1.3 @@ -927,7 +927,7 @@
     1.4  
     1.5  	cd $taz
     1.6  	action 'Copying "%s"...' 'receipt'
     1.7 -	export PACKAGE DEPENDS PROVIDE SUGGESTED TAZPANEL_DAEMON TAGS CAT
     1.8 +	export PACKAGE DEPENDS PROVIDE SUGGESTED TAZPANEL_DAEMON TAGS CAT CONFIG_FILES
     1.9  	@@PREFIX@@/libexec/cookutils/mk_pkg_receipt "$(realpath ../receipt)" > $pack/receipt
    1.10  	chown 0.0 $pack/receipt; status
    1.11  
     2.1 --- a/lighttpd/index.cgi	Wed Jan 24 12:14:38 2018 +0200
     2.2 +++ b/lighttpd/index.cgi	Sat Jan 27 11:43:58 2018 +0200
     2.3 @@ -1048,13 +1048,34 @@
     2.4  		section $blocked 12 "Blocked|All blocked packages"
     2.5  
     2.6  	cd $PKGS
     2.7 -	ls -let *.tazpkg | awk '
     2.8 -	(NR<=20){
     2.9 -		sub(/:[0-9][0-9]$/, "", $9);
    2.10 -		mon = index("  JanFebMarAprMayJunJulAugSepOctNovDec", $7) / 3;
    2.11 -		printf("%d-%02d-%02d %s : <a href=\"get/%s\">%s</a>\n", $10, mon, $8, $9, $11, $11);
    2.12 -	}' | \
    2.13 -		section $activity 1000 "Latest cook"
    2.14 +	# About BusyBox's `ls`
    2.15 +	# On the Tank server: BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.
    2.16 +	# It supported the option `-e`, output with `-let` options is like this:
    2.17 +	# -rw-r--r--    1 user     group       100000 Fri Nov  3 10:00:00 2017 filename
    2.18 +	# 1             2 3        4           5      6   7    8 9        10   11
    2.19 +	# Newer BusyBox v1.27.2 don't support option `-e` and have no configs to
    2.20 +	# configure it or return the option back. It supported the long option
    2.21 +	# `--full-time` instead, but output is different:
    2.22 +	# -rw-r--r--    1 user     group       100000 2017-11-03 10:00:00 +0200 filename
    2.23 +	# 1             2 3        4           5      6          7        8     9
    2.24 +	if ls -let >/dev/null 2>&1; then
    2.25 +		ls -let *.tazpkg \
    2.26 +		| awk '
    2.27 +		(NR<=20){
    2.28 +			sub(/:[0-9][0-9]$/, "", $9);
    2.29 +			mon = index("  JanFebMarAprMayJunJulAugSepOctNovDec", $7) / 3;
    2.30 +			printf("%d-%02d-%02d %s : <a href=\"get/%s\">%s</a>\n", $10, mon, $8, $9, $11, $11);
    2.31 +		}' \
    2.32 +		| section $activity 1000 "Latest cook"
    2.33 +	else
    2.34 +		ls -lt --full-time *.tazpkg \
    2.35 +		| awk '
    2.36 +		(NR<=20){
    2.37 +			sub(/:[0-9][0-9]$/, "", $7);
    2.38 +			printf("%s %s : <a href=\"get/%s\">%s</a>\n", $6, $7, $9, $9);
    2.39 +		}' \
    2.40 +		| section $activity 1000 "Latest cook"
    2.41 +	fi
    2.42  
    2.43  	echo '</div>'
    2.44  	datalist