[37119] trunk/base/src/port/port.tcl

raimue at macports.org raimue at macports.org
Mon May 26 16:59:57 PDT 2008


Revision: 37119
          http://trac.macosforge.org/projects/macports/changeset/37119
Author:   raimue at macports.org
Date:     2008-05-26 16:59:56 -0700 (Mon, 26 May 2008)

Log Message:
-----------
port/port.tcl:
port search looks now in name, description and long_description for the search
pattern and prints the list sorted.
Fixes #15434.

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

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2008-05-26 22:37:25 UTC (rev 37118)
+++ trunk/base/src/port/port.tcl	2008-05-26 23:59:56 UTC (rev 37119)
@@ -1954,15 +1954,43 @@
         puts -nonewline $separator
 
         set portfound 0
-        if {[catch {set res [mportsearch $portname no]} result]} {
+        set res {}
+        if {[catch {set matches [mportsearch "*$portname*" no glob name]} result]} {
             global errorInfo
             ui_debug "$errorInfo"
-            break_softcontinue "search for portname $portname failed: $result" 1 status
+            break_softcontinue "search for name $portname failed: $result" 1 status
         }
+        set tmp {}
+        foreach {name info} $matches {
+            add_to_portlist tmp [concat [list name $name] $info]
+        }
+        set res [opUnion $res $tmp]
+        if {[catch {set matches [mportsearch "*$portname*" no glob description]} result]} {
+            global errorInfo
+            ui_debug "$errorInfo"
+            break_softcontinue "search for description $portname failed: $result" 1 status
+        }
+        set tmp {}
+        foreach {name info} $matches {
+            add_to_portlist tmp [concat [list name $name] $info]
+        }
+        set res [opUnion $res $tmp]
+        if {[catch {set matches [mportsearch "*$portname*" no glob long_description]} result]} {
+            global errorInfo
+            ui_debug "$errorInfo"
+            break_softcontinue "search for long_description $portname failed: $result" 1 status
+        }
+        set tmp {}
+        foreach {name info} $matches {
+            add_to_portlist tmp [concat [list name $name] $info]
+        }
+        set res [opUnion $res $tmp]
+        set res [portlist_sort $res]
+
         set joiner ""
-        foreach {name array} $res {
+        foreach info $res {
             array unset portinfo
-            array set portinfo $array
+            array set portinfo $info
 
             # XXX is this the right place to verify an entry?
             if {![info exists portinfo(name)]} {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080526/23ad13f3/attachment-0001.htm 


More information about the macports-changes mailing list