[47253] trunk/base

raimue at macports.org raimue at macports.org
Mon Feb 23 21:26:11 PST 2009


Revision: 47253
          http://trac.macports.org/changeset/47253
Author:   raimue at macports.org
Date:     2009-02-23 21:26:10 -0800 (Mon, 23 Feb 2009)
Log Message:
-----------
src/port, doc/port.1:
Add new pseudo-port obsolete to identify ports which are installed but do not
exist in the PortIndex anymore.

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

Modified: trunk/base/doc/port.1
===================================================================
--- trunk/base/doc/port.1	2009-02-24 03:53:50 UTC (rev 47252)
+++ trunk/base/doc/port.1	2009-02-24 05:26:10 UTC (rev 47253)
@@ -115,6 +115,10 @@
 .Ar outdated :
 installed ports that are out of date with respect to their current version/revision in the ports tree(s)
 .Pp
+.It
+.Ar obsolete :
+set of ports that are installed but no longer exist in any port tree
+.Pp
 .El
 Other options, also known as
 .Ar pseudo-portname selectors ,

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2009-02-24 03:53:50 UTC (rev 47252)
+++ trunk/base/src/port/port.tcl	2009-02-24 05:26:10 UTC (rev 47253)
@@ -89,7 +89,7 @@
 ----------------
 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, and outdated.
+all, current, active, inactive, installed, uninstalled, outdated and obsolete.
 These pseudo-portnames expand to the set of ports named.
 
 Additional pseudo-portnames start with...
@@ -736,7 +736,28 @@
 }
 
 
+proc get_obsolete_ports {} {
+    set ilist [get_installed_ports]
+    set results {}
 
+    foreach i $ilist {
+        array set port $i
+
+        if {[catch {mportlookup $port(name)} result]} {
+            ui_debug "$::errorInfo"
+            break_softcontinue "lookup of portname $portname failed: $result" 1 status
+        }
+
+        if {[llength $result] < 2} {
+            lappend results $i
+        }
+    }
+
+    # Return the list of ports, already sorted
+    return [portlist_sort $results]
+}
+
+
 ##########################################
 # Port expressions
 ##########################################
@@ -882,6 +903,7 @@
         ^active(@.*)?$      -
         ^inactive(@.*)?$    -
         ^outdated(@.*)?$    -
+        ^obsolete(@.*)?$    -
         ^current(@.*)?$     {
             # A simple pseudo-port name
             advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090223/248c066d/attachment.html>


More information about the macports-changes mailing list