tazpanel rev 514

index.cgi: add package list in report
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 02 19:05:06 2015 +0200 (2015-08-02)
parents a6066b70a2af
children 06a4d2cde715
files index.cgi
line diff
     1.1 --- a/index.cgi	Wed Jul 29 16:34:16 2015 +0200
     1.2 +++ b/index.cgi	Sun Aug 02 19:05:06 2015 +0200
     1.3 @@ -591,7 +591,36 @@
     1.4  
     1.5  <h2>$(_ 'Boot scripts')</h2>
     1.6  <pre>$(filter_taztools_msgs < /var/log/boot.log)</pre>
     1.7 +
     1.8 +<h2>$(_ 'Packages')</h2>
     1.9  EOT
    1.10 +( cd /var/lib/tazpkg/installed
    1.11 +for i in * ; do
    1.12 +	echo "$i$(. $i/receipt ; echo " $VERSION $DEPENDS" )"
    1.13 +done ) | awk '{ pkg[$1]=$0; idx[c++]=$1 }
    1.14 +function name(n)
    1.15 +{
    1.16 +	split(pkg[n], x, " ")
    1.17 +	return x[1] " (" x[2] ") "
    1.18 +}
    1.19 +END {
    1.20 +	print "<pre>"
    1.21 +	for (i in pkg) for (j = split(pkg[i], p, " "); j > 2; j--) {
    1.22 +		if (pkg[p[j]]) kill[p[j]]=1
    1.23 +		else print "Missing dep " p[j] " for " name(p[1])
    1.24 +	}
    1.25 +	print ""
    1.26 +	n=0
    1.27 +	for (i=0; i < c; i++) {
    1.28 +		if (kill[idx[i]]) continue
    1.29 +		printf "%s" name(idx[i])
    1.30 +		if (n++ < 3) continue
    1.31 +		printf "\n"
    1.32 +		n=0
    1.33 +	}
    1.34 +	print "</pre>"
    1.35 +}
    1.36 +' >> $output
    1.37  		if [ "$(ls report.d/* 2> /dev/null)" ]; then
    1.38  			cat <<EOT
    1.39  	$(ok_status_t)