[25256] trunk/base
source_changes at macosforge.org
source_changes at macosforge.org
Wed May 16 14:26:46 PDT 2007
Revision: 25256
http://trac.macosforge.org/projects/macports/changeset/25256
Author: eridius at macports.org
Date: 2007-05-16 14:26:46 -0700 (Wed, 16 May 2007)
Log Message:
-----------
Add --index flag to `port info` to revert to old PortIndex behaviour
Modified Paths:
--------------
trunk/base/ChangeLog
trunk/base/src/port/port.1
trunk/base/src/port/port.tcl
Modified: trunk/base/ChangeLog
===================================================================
--- trunk/base/ChangeLog 2007-05-16 20:55:31 UTC (rev 25255)
+++ trunk/base/ChangeLog 2007-05-16 21:26:46 UTC (rev 25256)
@@ -6,6 +6,8 @@
(unreleased):
+ - `port info` now supports new --index flag for using old behaviour (eridius r25256).
+
- `port info` now opens the Portfile and displays up-to-date information.
This allows information about variants to be displayed (eg. dependencies).
Also allow `port info` to default to current directory if no name is provided
Modified: trunk/base/src/port/port.1
===================================================================
--- trunk/base/src/port/port.1 2007-05-16 20:55:31 UTC (rev 25255)
+++ trunk/base/src/port/port.1 2007-05-16 21:26:46 UTC (rev 25256)
@@ -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: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2007-05-16 20:55:31 UTC (rev 25255)
+++ trunk/base/src/port/port.tcl 2007-05-16 21:26:46 UTC (rev 25256)
@@ -1157,12 +1157,20 @@
set portdir $portinfo(portdir)
}
- set dport [dportopen $porturl [array get options] [array get variations]]
- array unset portinfo
- array set portinfo [dportinfo $dport]
- dportclose $dport
- if {[info exists portdir]} {
- set portinfo(portdir) $portdir
+ if {!([info exists options(ports_info_index)] && $options(ports_info_index) eq "yes")} {
+ if {[catch {set dport [dportopen $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 [dportinfo $dport]
+ dportclose $dport
+ 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/20070516/1d4d7edd/attachment.html
More information about the macports-changes
mailing list