diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2018-01-18 20:58:19 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2018-01-18 20:58:19 +0000 |
commit | 949dccdf5b9c6fd15e98466a88b160228f89e7c8 (patch) | |
tree | b012043fc09dc942faa8e319a306274ed283e0d5 /Master/texmf-dist/scripts/tlshell | |
parent | 6499520bc98c0b3ddd4a6558c2b331343a07d300 (diff) |
Added package version information
git-svn-id: svn://tug.org/texlive/trunk@46369 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/tlshell')
-rwxr-xr-x | Master/texmf-dist/scripts/tlshell/tlshell.tcl | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/Master/texmf-dist/scripts/tlshell/tlshell.tcl b/Master/texmf-dist/scripts/tlshell/tlshell.tcl index dbc3ea73ed3..2dc4f28341d 100755 --- a/Master/texmf-dist/scripts/tlshell/tlshell.tcl +++ b/Master/texmf-dist/scripts/tlshell/tlshell.tcl @@ -697,10 +697,20 @@ proc collect_filtered {} { dict lappend ::filtered $nm $mrk dict lappend ::filtered $nm $nm set v [dict get $pk localrev] - if {$v eq "0" || $v == 0} {set v ""} + set lv [dict get $pk lcatv] + if {$v eq "0" || $v == 0} { + set v "" + } elseif {$lv != 0 && $lv ne ""} { + set v "$v ($lv)" + } dict lappend ::filtered $nm $v set v [dict get $pk remoterev] - if {$v eq "0" || $v == 0} {set v ""} + set rv [dict get $pk rcatv] + if {$v eq "0" || $v == 0} { + set v "" + } elseif {$rv != 0 && $rv ne ""} { + set v "$v ($rv)" + } dict lappend ::filtered $nm $v dict lappend ::filtered $nm [dict get $pk shortdesc] } @@ -723,18 +733,18 @@ proc get_packages_info_local {} { set ::tlshell_updatable 0 run_cmd_waiting \ - "info --only-installed --data name,localrev,category,shortdesc" - set re {^([^,]+),([0-9]+),([^,]*),(.*)$} + "info --only-installed --data name,localrev,cat-version,category,shortdesc" + set re {^([^,]+),([0-9]+),([^,]*),([^,]*),(.*)$} foreach l $::out_log { - if [regexp $re $l m nm lrev catg pdescr] { + if [regexp $re $l m nm lrev lcatv catg pdescr] { # double-quotes in short description: remove outer, unescape inner if {[string index $pdescr 0] eq "\""} { set pdescr [string range $pdescr 1 end-1] } set pdescr [string map {\\\" \"} $pdescr] dict set ::pkgs $nm \ - [list "marked" 0 "localrev" $lrev "remoterev" 0 \ - "category" $catg shortdesc $pdescr] + [list "marked" 0 "localrev" $lrev "lcatv" $lcatv "remoterev" 0 \ + "rcatv" 0 "category" $catg shortdesc $pdescr] } } } ; # get_packages_info_local @@ -752,25 +762,26 @@ proc get_packages_info_remote {} { set ::tlshell_updatable 0 if [catch {run_cmd_waiting \ - "info --data name,localrev,remoterev,category,shortdesc"}] { + "info --data name,localrev,remoterev,cat-version,category,shortdesc"}] { do_debug [get_stacktrace] tk_messageBox -message \ "Repository $::repo unavailable. Please choose another one." return 0 } - set re {^([^,]+),([0-9]+),([0-9]+),([^,]*),(.*)$} + set re {^([^,]+),([0-9]+),([0-9]+),([^,]*),([^,]*),(.*)$} foreach l $::out_log { - if [regexp $re $l m nm lrev rrev catg pdescr] { + if [regexp $re $l m nm lrev rrev rcatv catg pdescr] { # double-quotes in short description: remove outer, unescape inner if {[string index $pdescr 0] eq "\""} { set pdescr [string range $pdescr 1 end-1] } set pdescr [string map {\\\" \"} $pdescr] if [catch {dict get $::pkgs $nm} pk] { - # package entry does not exist - dict set ::pkgs $nm [dict create "marked" 0 "localrev" 0] + # package entry does not yet exist, create it + dict set ::pkgs $nm [list "marked" 0 "localrev" 0 "lcatv" 0] } dict set ::pkgs $nm "remoterev" $rrev + dict set ::pkgs $nm "rcatv" $rcatv dict set ::pkgs $nm "category" $catg dict set ::pkgs $nm "shortdesc" $pdescr } @@ -783,16 +794,20 @@ proc get_packages_info_remote {} { ## update ::pkgs after installing packages without going online again. proc update_local_revnumbers {} { - run_cmd_waiting "info --only-installed --data name,localrev" - set re {^([^,]+),([0-9]+)$} + do_debug "update_local_revnumbers" + run_cmd_waiting "info --only-installed --data name,localrev,cat-version" + set re {^([^,]+),([0-9]+),(.*)$} dict for {pk pk_dict} $::pkgs { + do_debug "zeroing local data for $pk" dict set pk_dict "localrev" 0 + dict set pk_dict "lcatv" 0 dict set ::pkgs $pk $pk_dict } foreach l $::out_log { - if [regexp $re $l m pk lr] { + if [regexp $re $l m pk lr lv] { set pk_dict [dict get $::pkgs $pk] dict set pk_dict "localrev" $lr + dict set pk_dict "lcatv" $lv dict set ::pkgs $pk $pk_dict } } @@ -1991,13 +2006,13 @@ proc make_widgets {} { -xscrollcommand {.pkhsb set} -yscrollcommand {.pkvsb set} foreach \ col {mk name localrev remoterev shortdesc} \ - nm {"" Name "Local Rev." "Remote Rev." Description} { + nm {"" Name "Local Rev. (ver.)" "Remote Rev. (ver.)" Description} { .pkglist heading $col -text $nm -anchor w } .pkglist column mk -width [expr {$::cw * 3}] .pkglist column name -width [expr {$::cw * 25}] - .pkglist column localrev -width [expr {$::cw * 12}] - .pkglist column remoterev -width [expr {$::cw * 12}] + .pkglist column localrev -width [expr {$::cw * 18}] + .pkglist column remoterev -width [expr {$::cw * 18}] .pkglist column shortdesc -width [expr {$::cw * 50}] ttk::scrollbar .pkhsb -orient horizontal -command {.pkglist xview} |