From 294598faf6bf69578f29cd043877e992b42b7106 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Sun, 9 Nov 2014 20:24:44 +0000 Subject: [PATCH] misc updates git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2062 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/cgi-bin/opkg.jim | 8 ++++++-- webif/html/diskspace/diskspace.jim | 2 +- webif/lib/plugin | 2 +- webif/lib/pretty_size | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 12b8135..b4d08b6 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.17-6 +Version: 1.0.17-8 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.13),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),mongoose diff --git a/webif/cgi-bin/opkg.jim b/webif/cgi-bin/opkg.jim index 333c608..6bc03cf 100755 --- a/webif/cgi-bin/opkg.jim +++ b/webif/cgi-bin/opkg.jim @@ -22,7 +22,11 @@ proc opkg {cmd} { httpheader "text/plain" -if {![system connectivity]} { +set cmdargs [lassign $cmd cmd] + +set netcmds {install update upgrade} + +if {$cmd in $netcmds && ![system connectivity]} { puts "" puts "!! ERROR - No network connectivity to package repository !!" puts "" @@ -31,7 +35,7 @@ if {![system connectivity]} { } if {$cmd eq "upgrade"} { opkg update } -opkg $cmd +opkg "$cmd $cmdargs" if {$cmd eq "update" || $cmd eq "upgrade"} { puts "Updating package meta information" diff --git a/webif/html/diskspace/diskspace.jim b/webif/html/diskspace/diskspace.jim index fade8e6..d21b767 100755 --- a/webif/html/diskspace/diskspace.jim +++ b/webif/html/diskspace/diskspace.jim @@ -30,7 +30,7 @@ puts " diskspace_data = \[ { name: 'Used', - y: $($used - $dbs), + y: $used, sliced: false, pretty: '$usedstr' }, diff --git a/webif/lib/plugin b/webif/lib/plugin index 0d3bf01..c44c52c 100644 --- a/webif/lib/plugin +++ b/webif/lib/plugin @@ -1,6 +1,6 @@ proc eval_plugins {hook} { - foreach plugin [glob -nocomplain /mod/webif/plugin/*] { + foreach plugin [lsort [glob -nocomplain /mod/webif/plugin/*]] { if {[file isfile "$plugin/$hook.hook"]} { catch {uplevel source "$plugin/$hook.hook"} } diff --git a/webif/lib/pretty_size b/webif/lib/pretty_size index 1a4b472..ec353de 100644 --- a/webif/lib/pretty_size +++ b/webif/lib/pretty_size @@ -3,7 +3,8 @@ if {![exists -proc pretty_size]} { proc pretty_size {size} { set units {bytes KiB MiB GiB TiB} - for {set i 0} {$size > 1023} {incr i} { + for {set i 0; set l [llength $units]; incr l -1} { + $size > 1023 && $i < $l} {incr i} { set size $($size / 1024.0) }