[79421] trunk/base

jmr at macports.org jmr at macports.org
Mon Jun 13 00:25:19 PDT 2011


Revision: 79421
          http://trac.macports.org/changeset/79421
Author:   jmr at macports.org
Date:     2011-06-13 00:25:18 -0700 (Mon, 13 Jun 2011)
Log Message:
-----------
add 'actinact' pseudo-portname that expands to ports with both active and inactive versions (#27666)

Modified Paths:
--------------
    trunk/base/doc/port.1
    trunk/base/src/port/port.tcl

Modified: trunk/base/doc/port.1
===================================================================
--- trunk/base/doc/port.1	2011-06-13 07:07:37 UTC (rev 79420)
+++ trunk/base/doc/port.1	2011-06-13 07:25:18 UTC (rev 79421)
@@ -104,6 +104,10 @@
 set of installed but inactive ports.
 .Pp
 .It
+.Ar actinact :
+set of installed ports that have both an active version and one or more inactive versions.
+.Pp
+.It
 .Ar installed :
 set of all installed ports.
 .Pp

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2011-06-13 07:07:37 UTC (rev 79420)
+++ trunk/base/src/port/port.tcl	2011-06-13 07:25:18 UTC (rev 79421)
@@ -87,8 +87,8 @@
 ----------------
 Pseudo-portnames are words that may be used in place of a portname, and
 which expand to some set of ports. The common pseudo-portnames are:
-all, current, active, inactive, installed, uninstalled, outdated, obsolete,
-requested, unrequested and leaves.
+all, current, active, inactive, actinact, installed, uninstalled, outdated,
+obsolete, requested, unrequested and leaves.
 These pseudo-portnames expand to the set of ports named.
 
 Pseudo-portnames starting with variants:, variant:, description:, depends:,
@@ -764,7 +764,35 @@
     return [get_installed_ports no no]
 }
 
+proc get_actinact_ports {} {
+    set inactive_ports [get_inactive_ports]
+    set active_ports [get_active_ports]
+    set results {}
 
+    foreach port $inactive_ports {
+        array set portspec $port
+        set portname $portspec(name)
+        lappend inact($portname) $port
+    }
+
+    foreach port $active_ports {
+        array set portspec $port
+        set portname $portspec(name)
+
+        if {[info exists inact($portname)]} {
+            if {![info exists added_inact($portname)]} {
+                foreach inact_spec $inact($portname) {
+                    lappend results $inact_spec
+                }
+                set added_inact($portname) 1
+            }
+            lappend results $port
+        }
+    }
+    return $results
+}
+
+
 proc get_outdated_ports {} {
     # Get the list of installed ports
     set ilist {}
@@ -1214,6 +1242,7 @@
         ^uninstalled(@.*)?$ -
         ^active(@.*)?$      -
         ^inactive(@.*)?$    -
+        ^actinact(@.*)?$    -
         ^leaves(@.*)?$      -
         ^outdated(@.*)?$    -
         ^obsolete(@.*)?$    -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110613/eeeebd06/attachment.html>


More information about the macports-changes mailing list