Skip to content
Permalink
Browse files

mpstats: include requested port information

  • Loading branch information
mojca committed Mar 17, 2018
1 parent 5f327c8 commit 1a661632cdbcbb9fde167ab75c25e66a615dc3cc
Showing with 16 additions and 6 deletions.
  1. +1 −1 sysutils/mpstats/Portfile
  2. +15 −5 sysutils/mpstats/files/mpstats.tcl
@@ -1,7 +1,7 @@
PortSystem 1.0

name mpstats
version 0.1.6
version 0.1.7
categories sysutils macports
license BSD
platforms darwin
@@ -204,7 +204,7 @@ proc json_encode_port {port_info {indent ""}} {
set first true

set json "\{"
foreach name {name version variants} {
foreach name {name version requested variants} {
# Skip empty strings
if {$port($name) eq ""} {
continue
@@ -319,8 +319,8 @@ proc split_variants {variants} {
# collection of inactive ports
# @returns
# a list of installed ports chosen according to the \a active parameter, where each entry is
# the list representation of a Tcl array with the keys name, version and variants. The
# variants value is encoded using \c split_variants, the version entry has the form
# the list representation of a Tcl array with the keys name, version, requested and variants.
# The variants value is encoded using \c split_variants, the version entry has the form
# "$version_$revision".
proc get_installed_ports {active} {
set ilist {}
@@ -339,8 +339,18 @@ proc get_installed_ports {active} {
set iname [lindex $i 0]
set iversion [lindex $i 1]
set irevision [lindex $i 2]
set ivariants [split_variants [lindex $i 3]]
lappend results [list name $iname version "${iversion}_${irevision}" variants $ivariants]
set ivariants [lindex $i 3]
set iepoch [lindex $i 5]

set regref [registry::open_entry $iname $iversion $irevision $ivariants $iepoch]
if {[registry::property_retrieve $regref "requested"]} {
set irequested "true"
} else {
set irequested ""
}
set ivariantlist [split_variants $ivariants]

lappend results [list name $iname version "${iversion}_${irevision}" requested $irequested variants $ivariantlist]
}
}

0 comments on commit 1a66163

Please sign in to comment.
You can’t perform that action at this time.