#!/mod/bin/jimsh package require cgi source /mod/webif/lib/setup require settings.class pkg.class if {[[settings] pkgdev]} { set filter 0 } else { set filter 1 } pkg loadmeta proc nav {active} { set q "
\n \n
\n" return $q } proc pkgtop {type} { puts "
[_header] [nav $type]
" } proc pkgrow {type pkg} { set name [$pkg get name] puts "
  • $name

    " if {$type eq "avail"} { puts "

    [$pkg get latest]

    " } else { puts "

    [$pkg get installed]

    " } if {$type eq "upgr"} { puts "

    Latest: [$pkg get latest]

    " } if {[dict exists $::pkgmeta $name]} { puts "

    $::pkgmeta($name)

    " } else { puts "

    [$pkg get descr]

    " } if {![$pkg is installed]} { set btype Install } elseif {$type eq "upgr" && [$pkg is upgradable]} { set btype Upgrade } else { set btype Remove } puts "

    $btype

    " puts "
  • " } proc pkglist {type} { set pkgs [pkg $type] puts "" return } foreach pkg $pkgs { if {$type ne "upgr" && $::filter && \ ![dict exists $::pkgmeta $pkg]} { continue } pkgrow $type [pkg load $pkg] } if {$::filter} { puts "
  • This is a filtered package list. To show all packages, enable the Show development and advanced packages in the settings screen.
  • " } puts "" } mheader switch $pageid { pkgi_b { set type installed set qtype inst } pkga_b { set type available set qtype avail } default { set type upgrades set qtype upgr } } pkgtop $type puts { } pkglist $qtype puts {

    Results

    } mfooter