From 0cfc8f233ac51ff667fe905b2bd8d8a907731a23 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 3 Feb 2014 21:42:20 +0000 Subject: [PATCH] package management improvements git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1778 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 5 ++-- var/mongoose/html/img/info.png | Bin 0 -> 1052 bytes var/mongoose/html/pkg/pkg.jim | 23 ++++++++++++++--- var/mongoose/html/pkg/script.js | 5 +++- var/mongoose/lib/pkg.class | 42 +++++++++++++++++++++++++++++--- 5 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 var/mongoose/html/img/info.png diff --git a/CONTROL/control b/CONTROL/control index ffcd6e0..4d91bd0 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.0.8 +Version: 1.0.8-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) +Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) Suggests: Description: An evolving web interface for the Humax. +Tags: http://hummy.tv/forum/threads/webif-version-1-0-8-released.4553/ diff --git a/var/mongoose/html/img/info.png b/var/mongoose/html/img/info.png new file mode 100644 index 0000000000000000000000000000000000000000..5c6c3133765ab428a0db3612015856828df7bd8d GIT binary patch literal 1052 zcmV+%1mpXOP)9(E6vuz}zBkjEGE+?;sT>P;!1;rjk-YzF#^%BATbe05H}{e zQ1JsyT#y*HF4T~^&{Sd(G?oYSpl7Qx@yC?=p;%(%95E%TyudgL5FYB*sFqEX6A&Iezw{IrP@f{Mf$&@bvzYzH?A-ziZGx(4HYz z4U^-wg1JC~^OxKk-(Rr%j=qvykwk!P2TSRVYrPNG4R}w@Ra>E6GXXpezf9PZr_R~U zM|S6nO9t3>u%z!>;~iby?`@f_NK|B@_O&S$lgZQY`=lEl8MBXm^m4uur{gyRxUHbK z5B7Rnie-sV3b3+U^YA@BPT-60LjEd7Aw%Hi<@%v@19Ax15vQZ$2A_Go)VJyueV|wt zLIXjgheBVMMr(!dDSB6Es$oo=fw?LaI`#G!-YjigbOmlL=$$~W8brTp!A8am?HPr2 z!sxgq2%E=hjb7QM_X1Be&P6)6b$?0Uzux;*P<>4^0w6edRUj_ab>^G|qvvh^2Yd39 z_2ZEWWYXNN6n&M1uLoG&r&&KRzx>oW!=)*g7@zh@=d(Nl98UyjZ&O3YLeS#8cjh&B z40-_k^qXxNk3f5y+Rzff^XRDr(lVi|E0A@PxCdbV)=c@T&^R6e5J86qLYoXAb$ZUV zjt6iOg^U1%Mkb9_*d+jn&@w*dLnUCcaXbQ04LKcJ!6fe~glhyMU|ezw6pGoZjJ5=@ zj?phuqSbtF)iZ5A+&sc zWOv7Of%rr1%Zb1+O<(=cfJ{SNa>aVE+KW WwGlD+N@1x00000 literal 0 HcmV?d00001 diff --git a/var/mongoose/html/pkg/pkg.jim b/var/mongoose/html/pkg/pkg.jim index 47c65f0..7c19b9d 100755 --- a/var/mongoose/html/pkg/pkg.jim +++ b/var/mongoose/html/pkg/pkg.jim @@ -30,11 +30,28 @@ proc pkgrow {pkg} { puts "[$pkg get latest]" } + puts "" if {[dict exists $::pkgmeta $name]} { - puts "$::pkgmeta($name)" + puts "$::pkgmeta($name)" } else { - puts "[$pkg get descr]" + puts "[$pkg get descr]" } + if {$::type eq "upgr"} { + $pkg loadraw + set url [$pkg get url] + set changes [$pkg get changes] + if {$changes ne ""} { + puts "
  - $changes" + } + if {$url ne ""} { + puts " +
+ + $url + " + } + } + puts "" if {![$pkg is installed]} { set type Install @@ -82,7 +99,7 @@ if {[llength $pkgs] > 0} { pkgrow [pkg load $pkg] } puts "" - if {$filter} { + if {$type ne "upgr" && $filter} { puts "This is a filtered package list. To show all packages, enable the Show development and advanced packages in the settings screen." } } else { diff --git a/var/mongoose/html/pkg/script.js b/var/mongoose/html/pkg/script.js index b132fb5..40017d8 100644 --- a/var/mongoose/html/pkg/script.js +++ b/var/mongoose/html/pkg/script.js @@ -4,6 +4,7 @@ $(document).ready(function() { var busy = false; var tswitch = false; + var stick = false; $('#opkgupdate') .button() @@ -94,8 +95,9 @@ $(document).ready(function() { $('#dresults').text(data); $('#dspinner').hide('slow'); $('#complete').show('slow'); - if (status == 'success') + if (status == 'success' && !stick) $('#dialogue').dialog('close'); + stick = false; } else $('#dresults').append(data); @@ -151,6 +153,7 @@ $(document).ready(function() { $('a.depends').click(function(e) { e.preventDefault(); var pkg = $(this).closest('tr').attr('pkg'); + stick = true; execopkg(encodeURIComponent('whatdepends ' + pkg), false); }); diff --git a/var/mongoose/lib/pkg.class b/var/mongoose/lib/pkg.class index 36b3a8a..2867fb9 100755 --- a/var/mongoose/lib/pkg.class +++ b/var/mongoose/lib/pkg.class @@ -5,7 +5,10 @@ class pkg { name "" latest "" descr "" + changes "" + url "" installed "" + raw {} } set ::pkgmeta {} @@ -15,14 +18,41 @@ pkg method _load {nm} { set name $nm foreach line [split [exec /bin/opkg list $nm] "\n"] { # betaftpd - 0.0.8pre17-1 - Description... - regexp {^[^ ]+ - ([^ ]+) - (.*)$} $line x latest descr + if {[string match { *} $line]} { + append descr $line + } else { + regexp {^[^ ]+ - ([^ ]+) - (.*)$} $line x latest descr + } } + regexp {(.*) \[(.*)\]} $descr x descr changes set info [exec /bin/opkg list-installed $nm] - regexp {^([^ ]+) - ([^ ]+)$} $info full xname installed + regexp {^([^ ]+) - ([^ ]+)$} $info x x installed return $self } +pkg method loadraw {} { + set tag "" + set txt "" + set raw {} + + foreach line [split [exec /bin/opkg info $name] "\n"] { + if {$tag ne "" && [string match { *} $line]} { + append raw($tag) $line + continue + } + regexp {^([^:]+): (.*)$} $line x tag txt + if {![dict exists $raw $tag]} { + set tag [string tolower $tag] + set raw($tag) $txt + } else { + set tag "" + } + } + + if {[dict exists $raw tags]} { set url $raw(tags) } +} + proc {pkg load} {nm} { return [[pkg] _load $nm] } @@ -47,7 +77,9 @@ proc {pkg avail} {} { foreach pkg [split [exec /bin/opkg list] "\n"] { if [regexp {^ } $pkg] { continue } if {[regexp {^([^ ]+)} $pkg name] == 0} { continue } - if {$name ni $inst_pkgs} { lappend avail_pkgs $name } + if {$name ni $inst_pkgs && $name ni $avail_pkgs} { + lappend avail_pkgs $name + } #puts "New: $name
" } return $avail_pkgs @@ -58,7 +90,9 @@ proc {pkg inst} {} { set inst_pkgs {} foreach pkg [split [exec /bin/opkg list-installed] "\n"] { if {[regexp {^([^ ]+)} $pkg name] == 0} { continue } - lappend inst_pkgs $name + if {$name ni $inst_pkgs} { + lappend inst_pkgs $name + } #puts "Inst: $name
" } return $inst_pkgs