sup rev 30

Small fix to CGI hub
author Christophe Lincoln <pankso@slitaz.org>
date Mon Feb 27 22:50:53 2017 +0100 (2017-02-27)
parents 38d6569ce70f
children cfbb082f19f2
files libsup.sh server/sup/sup-admin.cgi
line diff
     1.1 --- a/libsup.sh	Mon Feb 27 22:21:15 2017 +0100
     1.2 +++ b/libsup.sh	Mon Feb 27 22:50:53 2017 +0100
     1.3 @@ -16,7 +16,7 @@
     1.4  activity="$cache/activity.log"
     1.5  
     1.6  mirror="http://scn.slitaz.org/content/sup/packages"
     1.7 -pkgsdb="$supdb/packages.db"
     1.8 +pkgsdb="$supdb/packages.sql"
     1.9  
    1.10  wok="$supdb/wok"
    1.11  supcook="$HOME/sup-cook"
     2.1 --- a/server/sup/sup-admin.cgi	Mon Feb 27 22:21:15 2017 +0100
     2.2 +++ b/server/sup/sup-admin.cgi	Mon Feb 27 22:50:53 2017 +0100
     2.3 @@ -38,7 +38,7 @@
     2.4  Database tables  : $(sqlite3 ${pkgsdb} '.tables')
     2.5  Database size    : $(du -mh ${pkgsdb} | cut -d "	" -f 1)
     2.6  EOT
     2.7 -			sqlite3 ${pkgsdb} 'SELECT * FROM info' \
     2.8 +			sqlite3 ${pkgsdb} 'SELECT timestamp FROM info' \
     2.9  				| awk '{printf "Timestamp        : %s %s\n",$1,$2 }'
    2.10  			echo "</pre>"
    2.11  		else
    2.12 @@ -47,13 +47,18 @@
    2.13  		
    2.14  		# Check/admin wok: remove packagage
    2.15  		#
    2.16 -		#echo "<h3>Public wok</h3>"
    2.17 -		#echo "<pre>"
    2.18 -		#echo "Checking public wok..."
    2.19 -		#for pkg in $(ls $content/sup/wok); do
    2.20 +		echo "<h3>Public wok</h3>"
    2.21 +		echo "<pre>"
    2.22 +		echo "Wok path     : $wok"
    2.23 +		echo "Wok size     : $(du -smh $wok | cut -d "	" -f 1)"
    2.24 +		echo "Packages     : $(ls $wok | wc -l)"
    2.25 +		echo "README files : $(find ${wok} -name README -type f | wc -l)"
    2.26 +		
    2.27 +		#${wok}/${pkg}/receip
    2.28 +		#for pkg in $(ls $wok); do
    2.29  			#echo "$pkg"
    2.30  		#done
    2.31 -		#echo "</pre>"
    2.32 +		echo "</pre>"
    2.33  		
    2.34  		html_footer && exit 0 ;;
    2.35  	
    2.36 @@ -80,7 +85,7 @@
    2.37  		create_pkgs_table() {
    2.38  			sqlite3 ${pkgsdb} << EOT
    2.39  CREATE TABLE pkgs(
    2.40 -	pkg PRIMARY KEY,
    2.41 +	name PRIMARY KEY,
    2.42  	version,
    2.43  	short_desc,
    2.44  	maintainer,
    2.45 @@ -152,8 +157,8 @@
    2.46  				# SUP SQLite commands testsuite
    2.47  				echo "<pre>"
    2.48  				
    2.49 -				echo "Running: <span class='value'>SELECT pkg FROM pkgs LIMIT 4</span>"
    2.50 -				sqlite3 ${pkgsdb} 'SELECT pkg FROM pkgs LIMIT 4' && newline
    2.51 +				echo "Running: <span class='value'>SELECT name FROM pkgs LIMIT 4</span>"
    2.52 +				sqlite3 ${pkgsdb} 'SELECT name FROM pkgs LIMIT 4' && newline
    2.53  				
    2.54  				# .schema
    2.55  				echo "<span class='value'>CREATE statements</span>"