#!/mod/bin/jimsh package require cgi source /mod/webif/lib/setup require settings.class pkg.class altrow if {[[settings] pkgdev]} { set filter 0 } else { set filter 1 } httpheader proc pkgrow {pkg} { set name [$pkg get name] altrow "pkg=\"$name\"" puts "$name" if {$::type eq "inst"} { puts "
   Info" } puts "" if {$::type eq "avail"} { puts "[$pkg get latest]" } else { puts "[$pkg get installed]" } if {$::type eq "upgr"} { puts "[$pkg get latest]" } if {[dict exists $::pkgmeta $name]} { puts "$::pkgmeta($name)" } else { puts "[$pkg get descr]" } if {![$pkg is installed]} { set type Install } elseif {$::type eq "upgr" && [$pkg is upgradable]} { set type Upgrade } else { set type Remove } puts "" puts "" } pkg loadmeta set type [cgi_get type "avail"] set pkgs [pkg $type] if {[llength $pkgs] > 0} { puts "" if {$type eq "avail"} { puts "" } else { puts "" } if {$type eq "upgr"} { puts "" } puts " " foreach pkg $pkgs { if {$type ne "upgr" && $filter && \ ![dict exists $::pkgmeta $pkg]} { continue } pkgrow [pkg load $pkg] } puts "
PackageAvailableInstalledAvailDescription   Action  
" if {$filter} { puts "This is a filtered package list. To show all packages, enable the Show development and advanced packages in the settings screen." } } else { puts "No packages " switch $type { inst { puts "are installed." } upgr { puts "are available for upgrade; try updating the package list from the Internet using the button above." } avail { puts "are available for installation." } } puts "" }