From 0fa394eaa1ce3fc4819145917f7250228800a5a9 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Fri, 7 Oct 2011 18:18:45 +0000 Subject: [PATCH] tweak update all git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@445 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/cgi-bin/opkg.jim | 22 ++++++++++++++-------- var/mongoose/include/services.jim | 6 +----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 27cfaca..146be0c 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.7.5 +Version: 0.7.5-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.5),hmt(>=1.0.6),ssmtp diff --git a/var/mongoose/cgi-bin/opkg.jim b/var/mongoose/cgi-bin/opkg.jim index 366581b..4fd4edb 100755 --- a/var/mongoose/cgi-bin/opkg.jim +++ b/var/mongoose/cgi-bin/opkg.jim @@ -9,17 +9,23 @@ cgi_input set cmd [cgi_get cmd update] +proc opkg {cmd} { + chunk ">>> opkg $cmd\r\n" + set bcmd "|/mod/var/mongoose/lib/opkg $cmd" + set fd [open $bcmd r] + while {[gets $fd line] >= 0} { + chunk "$line\r\n" + #chunk_pad + } + close $fd +} + start_chunked -set bcmd "|/mod/var/mongoose/lib/opkg $cmd" -set fd [open $bcmd r] -while {[gets $fd line] >= 0} { - chunk "$line\r\n" - #chunk_pad -} -close $fd +if {$cmd eq "upgrade"} { opkg update } +opkg $cmd -if {$cmd eq "update"} { +if {$cmd eq "update" || $cmd eq "upgrade"} { chunk "Updating package meta information\r\n" pkg fetchmeta chunk "Done.\r\n" diff --git a/var/mongoose/include/services.jim b/var/mongoose/include/services.jim index 97c73bc..68d21b8 100755 --- a/var/mongoose/include/services.jim +++ b/var/mongoose/include/services.jim @@ -3,11 +3,7 @@ set services [split [exec /mod/bin/service mlist]] foreach service $services { - set data [split $service ":"] - set name [lindex $data 0] - set installed [lindex $data 1] - set auto [lindex $data 2] - set running [lindex $data 3] + lassign [split $service ":"] name installed auto running puts "$name" if (!$installed) {