[25523] branches/dp2mp-move/base/src/port

source_changes at macosforge.org source_changes at macosforge.org
Wed May 23 21:46:39 PDT 2007


Revision: 25523
          http://trac.macosforge.org/projects/macports/changeset/25523
Author:   jmpp at macports.org
Date:     2007-05-23 21:46:38 -0700 (Wed, 23 May 2007)

Log Message:
-----------
Merging eridius' r25256: Add --index flag to 'port info' to revert to old PortIndex behaviour.

Modified Paths:
--------------
    branches/dp2mp-move/base/src/port/port.1
    branches/dp2mp-move/base/src/port/port.tcl

Modified: branches/dp2mp-move/base/src/port/port.1
===================================================================
--- branches/dp2mp-move/base/src/port/port.1	2007-05-24 04:37:22 UTC (rev 25522)
+++ branches/dp2mp-move/base/src/port/port.1	2007-05-24 04:46:38 UTC (rev 25523)
@@ -254,15 +254,24 @@
 .Fl -category
 (recognized field names are those from the PortIndex). If the global option
 .Fl q
-is in effect, the meta-info fields will not be labeled; if the option
+is in effect, the meta-info fields will not be labeled.
+If the option
 .Fl -line
-is provided, all such data will be consolidated into a single line per port, suitable for processing in a pipe of commands.
+is provided, all such data will be consolidated into a single line per port,
+suitable for processing in a pipe of commands.
+If the option
+.Fl -index
+is provided, the information will be pulled from the PortIndex rather than
+from the Portfile (in this case variant information, such as dependencies,
+will not affect the output).
+.Pp
 For example:
-.Pp
-.Dl "port info vim"
+.br
+.Dl "port info vim +ruby"
 .Dl "port info --category --name apache*"
 .Dl "port -q info --category --name --version category:java"
 .Dl "port info --line --category --name all"
+.Dl "port info --index python24"
 .Ss variants
 Lists the build variants available for
 .Ar portname .

Modified: branches/dp2mp-move/base/src/port/port.tcl
===================================================================
--- branches/dp2mp-move/base/src/port/port.tcl	2007-05-24 04:37:22 UTC (rev 25522)
+++ branches/dp2mp-move/base/src/port/port.tcl	2007-05-24 04:46:38 UTC (rev 25523)
@@ -1156,13 +1156,21 @@
             set porturl $portinfo(porturl)
             set portdir $portinfo(portdir)
         }
-        
-	set mport [mportopen $porturl [array get options] [array get variations]]
-        array unset portinfo
-        array set portinfo [mportinfo $mport]
-        mportclose $mport
-        if {[info exists portdir]} {
-            set portinfo(portdir) $portdir
+
+        if {!([info exists options(ports_info_index)] && $options(ports_info_index) eq "yes")} {
+            if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
+                ui_debug "$::errorInfo"
+                break_softcontinue "Unable to open port: $result" 1 status
+            }
+            array unset portinfo
+            array set portinfo [mportinfo $mport]
+            mportclose $mport
+            if {[info exists portdir]} {
+                set portinfo(portdir) $portdir
+            }
+        } elseif {![info exists portinfo]} {
+            ui_warn "port info --index does not work with 'current' pseudo-port"
+            continue
         }
         
         # Map from friendly to less-friendly but real names
@@ -1208,6 +1216,9 @@
         set fields {}
         foreach { option } [array names options ports_info_*] {
             set opt [string range $option 11 end]
+            if {$opt eq "index"} {
+                continue
+            }
             
             # Map from friendly name
             set ropt $opt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070523/d79b9bb8/attachment.html


More information about the macports-changes mailing list