#!/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 "" #
    puts "

    $btype

    " puts "
  • " } proc pkglist {type} { set pkgs [pkg $type] if {[llength $pkgs] <= 0} { 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 below." } avail { puts "are available for installation." } } puts "" return } 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 pkglist $qtype mfooter