package management improvements

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1778 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-02-03 21:42:20 +00:00
parent ea2f231ad8
commit 0cfc8f233a
5 changed files with 65 additions and 10 deletions

View File

@ -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/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -30,11 +30,28 @@ proc pkgrow {pkg} {
puts "<td nowrap>[$pkg get latest]</td>"
}
puts "<td>"
if {[dict exists $::pkgmeta $name]} {
puts "<td>$::pkgmeta($name)</td>"
puts "$::pkgmeta($name)"
} else {
puts "<td>[$pkg get descr]</td>"
puts "[$pkg get descr]"
}
if {$::type eq "upgr"} {
$pkg loadraw
set url [$pkg get url]
set changes [$pkg get changes]
if {$changes ne ""} {
puts "<br>&nbsp;&nbsp;-&nbsp;<i>$changes</i>"
}
if {$url ne ""} {
puts "
<br>
<a class=va href=\"$url\" target=_blank style=\"color: darkblue\">
<img class=va height=18 width=18 src=/img/info.png> $url
</a>"
}
}
puts "</td>"
if {![$pkg is installed]} {
set type Install
@ -82,7 +99,7 @@ if {[llength $pkgs] > 0} {
pkgrow [pkg load $pkg]
}
puts "</table>"
if {$filter} {
if {$type ne "upgr" && $filter} {
puts "<font class=footnote>This is a filtered package list. To show all packages, enable the <i>Show development and advanced packages</i> in the settings screen.</font>"
}
} else {

View File

@ -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);
});

View File

@ -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<br>"
}
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<br>"
}
return $inst_pkgs