[44645] users/perry/base-select
perry at macports.org
perry at macports.org
Thu Jan 1 12:15:57 PST 2009
Revision: 44645
http://trac.macports.org/changeset/44645
Author: perry at macports.org
Date: 2009-01-01 12:15:56 -0800 (Thu, 01 Jan 2009)
Log Message:
-----------
perry/base-select - Merged in the latest trunk/base changes.
Modified Paths:
--------------
users/perry/base-select/ChangeLog
users/perry/base-select/configure.ac
users/perry/base-select/doc/port.1
users/perry/base-select/doc/portfile.7
users/perry/base-select/portmgr/jobs/GuideRegen.sh
users/perry/base-select/portmgr/jobs/PortIndex2MySQL.tcl
users/perry/base-select/portmgr/jobs/PortIndexRegen.sh
users/perry/base-select/src/macports1.0/macports.tcl
users/perry/base-select/src/port/port-help.tcl
users/perry/base-select/src/port/port.tcl
users/perry/base-select/src/port1.0/portfetch.tcl
users/perry/base-select/src/port1.0/portmain.tcl
users/perry/base-select/src/port1.0/portutil.tcl
users/perry/base-select/src/registry1.0/receipt_flat.tcl
Removed Paths:
-------------
users/perry/base-select/src/pathconf/
Property Changed:
----------------
users/perry/base-select/
Property changes on: users/perry/base-select
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
+ /branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:44044-44644
Modified: users/perry/base-select/ChangeLog
===================================================================
--- users/perry/base-select/ChangeLog 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/ChangeLog 2009-01-01 20:15:56 UTC (rev 44645)
@@ -5,11 +5,21 @@
Release 1.8.0 (unreleased):
+ - Add several new options to port search (#15434, raimue)
+
- Add xpkg archive type, xar-based format with XML. (afb)
- Split portpkg creation out from portsubmit phase. (afb)
+ - Make dependencies displayed in port info respect variants
+ specified in variants.conf; collapse port deps to be an alias
+ for port info with appropriate flags. Note this changes output
+ format of port deps somewhat. (#11891, gwhitney)
+ - Make dependencies in port upgrade respect variants as specified
+ (in order of precedence) on command line, latest installed
+ version, or variants.conf . (#8221, gwhitney)
+
Release 1.7.1 (unreleased):
- Make the postflight procedure a bit smarter about which login files
to update for bash and tcsh (#17588)
Modified: users/perry/base-select/configure.ac
===================================================================
--- users/perry/base-select/configure.ac 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/configure.ac 2009-01-01 20:15:56 UTC (rev 44645)
@@ -331,23 +331,7 @@
AS_HELP_STRING([--with-trace-sdk=SDK],
[SDK for redirection in trace lib (for example MacOSX10.4u.sdk)]),
[test -d /Developer/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
-
-
-# If /etc/paths.d and /etc/manpaths.d then we can install our path configuration
-# (this code is currently disabled since this mechanism implies that MacPorts paths are
-# added after the system's paths, and so MacPorts commands would not override system functions).
-AC_MSG_CHECKING(whether to install MacPorts paths into /etc/paths.d and /etc/manpaths.d)
-mpprefix=$prefix
-test "x$mpprefix" = "xNONE" && mpprefix=$ac_default_prefix
-if false && test -d /etc/paths.d -a -d /etc/manpaths.d -a "$mpprefix" = "$ac_default_prefix"; then
- PATHCONF=pathconf
- AC_CONFIG_FILES([src/pathconf/Makefile src/pathconf/paths src/pathconf/manpaths])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
# Allows building of shared libraries
SC_ENABLE_SHARED
Modified: users/perry/base-select/doc/port.1
===================================================================
--- users/perry/base-select/doc/port.1 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/doc/port.1 2009-01-01 20:15:56 UTC (rev 44645)
@@ -248,13 +248,15 @@
.Dl "port search vim"
.Pp
.Ss info
-Displays all the meta-information available for
+Displays meta-information available for
.Ar portname .
Specific meta-information may be requested through an option such as
.Fl -maintainer
or
.Fl -category
-(recognized field names are those from the PortIndex). If the global option
+(recognized field names are those from the PortIndex, see "port help
+info" for a complete list). If no specific fields are specified, a
+useful default collection of fields will be displayed. If the global option
.Fl q
is in effect, the meta-info fields will not be labeled.
If the option
@@ -262,6 +264,11 @@
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 -pretty
+is provided, the information will be formatted in a somewhat more
+attractive fashion for human readers. This is the default when no
+options at all are specified to info.
+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,
@@ -273,6 +280,7 @@
.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 --pretty --fullname --depends gtk2"
.Dl "port info --index python24"
.Ss variants
Lists the build variants available for
@@ -280,6 +288,7 @@
.Ss deps
Lists the other ports that are required to build and run
.Ar portname .
+This is simply an alias for "info --pretty --fullname --depends".
.Ss dependents
Lists the installed ports that depend on the port
.Ar portname .
@@ -364,6 +373,14 @@
For example:
.Pp
.Dl "port -n upgrade wireshark"
+.Pp
+Note that in selecting the variants to use in the upgraded build of the
+port, any variants specified on the command line take highest precedence,
+then the variants active in the latest installed version of the port, and
+finally the global variants specified in variants.conf, if any. Note that
+upgrade will not normally rebuild a port only to change the selected
+variants; you can either specify -f, or deactivate the port and reinstall it
+with different variants.
.Ss clean
Clean the files used for building
.Ar portname .
Modified: users/perry/base-select/doc/portfile.7
===================================================================
--- users/perry/base-select/doc/portfile.7 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/doc/portfile.7 2009-01-01 20:15:56 UTC (rev 44645)
@@ -833,6 +833,20 @@
.br
.Sy Example:
.Dl extract.cmd bzip2
+.It Ic extract.mkdir
+Create the
+.Ic worksrcdir
+prior to extraction; useful for ports which extract directly into the current
+working directory instead of a subdirectory.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em no
+.br
+.Sy Example:
+.Dl extract.mkdir yes
.El
.Sh CONFIGURE OPTIONS
MacPorts provide special support for configure flags (CFLAGS, LDFLAGS, CPPFLAGS, CXXFLAGS, CC, CXX, CPP, FC, F77, F90). Please note that the previous way to alter these flags (using configure.env) may become deprecated at some point. The following options are defined:
Modified: users/perry/base-select/portmgr/jobs/GuideRegen.sh
===================================================================
--- users/perry/base-select/portmgr/jobs/GuideRegen.sh 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/portmgr/jobs/GuideRegen.sh 2009-01-01 20:15:56 UTC (rev 44645)
@@ -13,7 +13,7 @@
# ROOT directory, where everything is. This needs to exist!
ROOT=/var/tmp/macports/
# e-mail address to spam in case of failure.
-SPAM_LOVERS=macports-dev at lists.macosforge.org,markd at macports.org,wsiegrist at apple.com
+#SPAM_LOVERS=example at hostname.com
# Other settings (probably don't need to be changed).
SVN_CONFIG_DIR=${ROOT}/svnconfig
Modified: users/perry/base-select/portmgr/jobs/PortIndex2MySQL.tcl
===================================================================
--- users/perry/base-select/portmgr/jobs/PortIndex2MySQL.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/portmgr/jobs/PortIndex2MySQL.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -66,7 +66,7 @@
set mailprog "/usr/sbin/sendmail"
set DATE [clock format [clock seconds] -format "%A %Y-%m-%d at %T"]
-set SPAM_LOVERS macports-dev at lists.macosforge.org
+#set SPAM_LOVERS example at hostname.com
set SUBJECT "PortIndex2MySQL run failure on $DATE"
set FROM macports-mgr at lists.macosforge.org
Modified: users/perry/base-select/portmgr/jobs/PortIndexRegen.sh
===================================================================
--- users/perry/base-select/portmgr/jobs/PortIndexRegen.sh 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/portmgr/jobs/PortIndexRegen.sh 2009-01-01 20:15:56 UTC (rev 44645)
@@ -18,7 +18,7 @@
# MP group.
MP_GROUP=mp-user
# e-mail address to spam in case of failure.
-SPAM_LOVERS=macports-dev at lists.macosforge.org,dluke at geeklair.net
+#SPAM_LOVERS=example at hostname.com
# Other settings (probably don't need to be changed).
SVN_CONFIG_DIR=${ROOT}/svnconfig
Modified: users/perry/base-select/src/macports1.0/macports.tcl
===================================================================
--- users/perry/base-select/src/macports1.0/macports.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/macports1.0/macports.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -1907,11 +1907,17 @@
}
# upgrade procedure
-proc macports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
+proc macports::upgrade {portname dspec globalvarlist variationslist optionslist {depscachename ""}} {
global macports::registry.installtype
global macports::portarchivemode
array set options $optionslist
+
+ # Note $variationslist is left alone and so retains the original
+ # requested variations, which should be passed to recursive calls to
+ # upgrade; while variations gets existing variants and global variations
+ # merged in later on, so it applies only to this port's upgrade
array set variations $variationslist
+
if {![string match "" $depscachename]} {
upvar $depscachename depscache
}
@@ -1954,6 +1960,10 @@
# if this is set (not 0) we dont follow the deps
set depflag 0
+ # Sooner or later we may have to open this port to update the portinfo
+ # by evaluating the variants. Keep track of whether this has happened
+ set portwasopened 0
+
# set version_installed and revision_installed
set ilist {}
if { [catch {set ilist [registry::installed $portname ""]} result] } {
@@ -1964,12 +1974,23 @@
if {![info exists porturl]} {
set porturl file://./
}
- if {[catch {set workername [mportopen $porturl [array get options] ]} result]} {
+ # Merge the global variations into the specified
+ foreach { variation value } $globalvarlist {
+ if { ![info exists variations($variation)] } {
+ set variations($variation) $value
+ }
+ }
+
+ if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
global errorInfo
ui_debug "$errorInfo"
ui_error "Unable to open port: $result"
return 1
}
+ # While we're at it, update the portinfo
+ array unset portinfo
+ array set portinfo [mportinfo $workername]
+ set portwasopened 1
if {![_mportispresent $workername $dspec ] } {
# port in not installed - install it!
@@ -1979,8 +2000,16 @@
ui_error "Unable to exec port: $result"
return 1
}
- # we just installed it, so mark it done in the cache
+ if {$result > 0} {
+ ui_error "Problem while installing $portname"
+ return $result
+ }
+ # we just installed it, so mark it done in the cache
+ # and update ilist
set depscache(port:${portname}) 1
+ if {$is_dryrun eq "no"} {
+ set ilist [registry::installed $portname ""]
+ }
} else {
# port installed outside MacPorts
ui_debug "$portname installed outside the MacPorts system"
@@ -2003,6 +2032,13 @@
set epoch_installed 0
if {$ilist == ""} {
# XXX this sets $version_installed to $version_in_tree even if not installed!!
+ # This hack appears to be invoked when a dependency is found that
+ # is installed outside of MacPorts. It would be nice to eliminate it,
+ # but I don't at the moment have time to investigate what would happen in
+ # current Macports code if this hack was simply removed. I have a
+ # hunch that things might be OK... but I'm not sure.
+ # -- gwhitney 2008-12-26
+ ui_debug "Hack forcing version_installed = version_in tree invoked here."
set version_installed $version_in_tree
set revision_installed $revision_in_tree
set iname $portname
@@ -2053,6 +2089,8 @@
return 1
}
}
+ # record the variant of the latest version
+ set variant [lindex $num 3]
if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
# activate the latest installed version
if {$is_dryrun eq "yes"} {
@@ -2069,7 +2107,7 @@
# output version numbers
ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed"
ui_debug "$portname ${version_in_tree}_$revision_in_tree exists in the ports tree"
- ui_debug "$iname ${version_installed}_$revision_installed is installed"
+ ui_debug "$iname ${version_installed}_$revision_installed $variant is installed"
# set the nodeps option
if {![info exists options(ports_nodeps)]} {
@@ -2078,6 +2116,63 @@
set nodeps yes
}
+ # save existing variant for later use
+ set oldvariant $variant
+ if {$portwasopened == 0} {
+ # If the port has not been opened, then before we do
+ # dependencies, we need to figure out the final variants,
+ # open the port, and update the portinfo. (If it was opened,
+ # then the variants must still be the ones we opened it with,
+ # and the portinfo is correct.)
+
+ set porturl $portinfo(porturl)
+ if {![info exists porturl]} {
+ set porturl file://./
+ }
+
+ # check if the variants is present in $version_in_tree
+ set variant [split $variant +]
+ ui_debug "Merging existing variants $variant into variants"
+ if {[info exists portinfo(variants)]} {
+ set avariants $portinfo(variants)
+ } else {
+ set avariants {}
+ }
+ ui_debug "available variants are : $avariants"
+ foreach v $variant {
+ if {[lsearch $avariants $v] == -1} {
+ } else {
+ ui_debug "variant $v is present in $portname $version_in_tree"
+ if { ![info exists variations($v)]} {
+ set variations($v) "+"
+ }
+ }
+ }
+
+ # Now merge in the global (i.e. variants.conf) variations.
+ # We wait until now so that existing variants for this port
+ # override global variations
+ foreach { variation value } $globalvarlist {
+ if { ![info exists variations($variation)] } {
+ set variations($variation) $value
+ }
+ }
+
+ ui_debug "new fully merged portvariants: [array get variations]"
+
+ if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Unable to open port: $result"
+ return 1
+ }
+
+ array unset portinfo
+ array set portinfo [mportinfo $workername]
+ set portwasopened 1
+ }
+
+
if {$nodeps == "yes" || $depflag == 1} {
ui_debug "Not following dependencies"
set depflag 0
@@ -2100,7 +2195,7 @@
foreach i $portinfo($dtype) {
set d [lindex [split $i :] end]
if {![llength [array get depscache port:${d}]] && ![llength [array get depscache $i]]} {
- upgrade $d $i $variationslist [array get options] depscache
+ upgrade $d $i $globalvarlist $variationslist [array get options] depscache
}
}
}
@@ -2118,6 +2213,10 @@
&& [rpm-vercomp $revision_installed $revision_in_tree] >= 0 ))
&& ![info exists options(ports_force)] } {
ui_debug "No need to upgrade! $iname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree"
+ if {[info exists portinfo(canonical_active_variants)]
+ && $portinfo(canonical_active_variants) != $oldvariant} {
+ ui_warn "Skipping upgrade since $iname ${version_installed}_$revision_installed >= $portname ${version_in_tree}_$revision_in_tree, even though installed variant $oldvariant does not match $portinfo(canonical_active_variants). Specify -f to force upgrade."
+ }
if { $epoch_installed >= $epoch_in_tree } {
# Check if we have to do dependents
if {[info exists options(ports_do_dependents)]} {
@@ -2131,7 +2230,7 @@
foreach dep $deplist {
set mpname [lindex $dep 2]
if {![llength [array get depscache port:${mpname}]]} {
- macports::upgrade $mpname port:${mpname} [array get variations] [array get options] depscache
+ macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache
}
}
}
@@ -2144,38 +2243,7 @@
}
}
- # open porthandle
- set porturl $portinfo(porturl)
- if {![info exists porturl]} {
- set porturl file://./
- }
- # check if the variants is present in $version_in_tree
- set oldvariant $variant
- set variant [split $variant +]
- ui_debug "variants to install $variant"
- if {[info exists portinfo(variants)]} {
- set avariants $portinfo(variants)
- } else {
- set avariants {}
- }
- ui_debug "available variants are : $avariants"
- foreach v $variant {
- if {[lsearch $avariants $v] == -1} {
- } else {
- ui_debug "variant $v is present in $portname ${version_in_tree}_$revision_in_tree"
- set variations($v) "+"
- }
- }
- ui_debug "new portvariants: [array get variations]"
-
- if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Unable to open port: $result"
- return 1
- }
-
# install version_in_tree
if {0 == [string compare "yes" ${macports::portarchivemode}]} {
set upgrade_action "archive"
@@ -2258,7 +2326,7 @@
foreach dep $deplist {
set mpname [lindex $dep 2]
if {![llength [array get depscache port:${mpname}]]} {
- macports::upgrade $mpname port:${mpname} [array get variations] [array get options] depscache
+ macports::upgrade $mpname port:${mpname} $globalvarlist $variationslist [array get options] depscache
}
}
}
Modified: users/perry/base-select/src/port/port-help.tcl
===================================================================
--- users/perry/base-select/src/port/port-help.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/port/port-help.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -66,7 +66,7 @@
}
set porthelp(deps) {
-Returns a list of dependencies for each of the given ports
+This action is an alias for 'info --pretty --fullname --depends'
}
set porthelp(destroot) {
@@ -135,7 +135,20 @@
}
set porthelp(info) {
-Returns informations about the given ports
+Returns information about the given ports. Most of the options specify a field
+to be included in the resulting report. Multiple fields may be specified, in
+which case all will be included. If no fields are specified, a useful default
+set will be used. The other options which do not correspond to fields are:
+ --depends An abbreviation for all three depends_* fields
+ --index Do not read the Portfile, instead rely solely on the index
+ information. Note this option will prevent the information
+ reported from reflecting the effects of any variants specified.
+ --line Report on each port on a single line, with fields separated
+ by spaces. Handy for automatically processing the output of
+ info called on a large number of ports.
+ --pretty Format the output in a convenient, human-readable fashion. Note
+ that this option is the default when no options are specified to
+ info.
}
set porthelp(install) {
@@ -249,7 +262,11 @@
set porthelp(unload) $porthelp(load)
set porthelp(upgrade) {
-Upgrades the given ports to the latest version
+Upgrades the given ports to the latest version. Respects global options
+-n, -R, -u, and -f (see the port man page). Note that in selecting variants
+to use in the upgraded build of the port, the order of precedence is variants
+specified on the command line, then variants active in the latest installed
+version of the port, then the variants.conf file.
}
set porthelp(url) {
Modified: users/perry/base-select/src/port/port.tcl
===================================================================
--- users/perry/base-select/src/port/port.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/port/port.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -203,6 +203,28 @@
}
+##
+# Maps friendly field names to their real name
+# Names which do not need mapping are not changed.
+#
+# @param field friendly name
+# @return real name
+proc map_friendly_field_names { field } {
+ switch -- $field {
+ variant -
+ platform -
+ maintainer {
+ set field "${field}s"
+ }
+ category {
+ set field "categories"
+ }
+ }
+
+ return $field
+}
+
+
proc registry_installed {portname {portversion ""}} {
set ilist [registry::installed $portname $portversion]
if { [llength $ilist] > 1 } {
@@ -891,12 +913,8 @@
regexp {^(\w+):(.*)} $token matchvar field pat
# Remap friendly names to actual names
- switch -- $field {
- variant -
- platform -
- maintainer { set field "${field}s" }
- category { set field "categories" }
- }
+ set field [map_friendly_field_names $field]
+
add_multiple_ports reslist [get_matching_ports $pat no regexp $field]
set el 1
}
@@ -1324,6 +1342,7 @@
proc action_info { action portlist opts } {
+ global global_variations
set status 0
if {[require_portlist portlist]} {
return 1
@@ -1372,7 +1391,17 @@
}
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]} {
+ # Add any global_variations to the variations
+ # specified for the port (so we get e.g. dependencies right)
+ array unset merged_variations
+ array set merged_variations [array get variations]
+ foreach { variation value } [array get global_variations] {
+ if { ![info exists merged_variations($variation)] } {
+ set merged_variations($variation) $value
+ }
+ }
+
+ if {[catch {set mport [mportopen $porturl [array get options] [array get merged_variations]]} result]} {
ui_debug "$::errorInfo"
break_softcontinue "Unable to open port: $result" 1 status
}
@@ -1386,15 +1415,8 @@
ui_warn "port info --index does not work with 'current' pseudo-port"
continue
}
-
- # Map from friendly to less-friendly but real names
- array set name_map "
- category categories
- maintainer maintainers
- platform platforms
- variant variants
- "
-
+ array unset options ports_info_index
+
# Understand which info items are actually lists
# (this could be overloaded to provide a generic formatting code to
# allow us to, say, split off the prefix on libs)
@@ -1408,6 +1430,36 @@
variants 1
"
+ # Label map for pretty printing
+ array set pretty_label {
+ heading ""
+ variants Variants
+ depends_build "Build Dependencies"
+ depends_run "Runtime Dependencies"
+ depends_lib "Library Dependencies"
+ description "Brief Description"
+ long_description ""
+ fullname "Full Name: "
+ homepage Homepage
+ platforms Platforms
+ maintainers Maintainers
+ }
+
+ # Wrap-length map for pretty printing
+ array set pretty_wrap {
+ heading 0
+ variants 13
+ depends_build 22
+ depends_run 22
+ depends_lib 22
+ description 22
+ long_description 0
+ homepage 13
+ platforms 22
+ maintainers 22
+ }
+
+ # Interpret a convenient field abbreviation
if {[info exists options(ports_info_depends)] && $options(ports_info_depends) == "yes"} {
array unset options ports_info_depends
set options(ports_info_depends_build) yes
@@ -1419,7 +1471,16 @@
set show_label 1
set field_sep "\n"
set subfield_sep ", "
+ set pretty_print 0
+ # For human-readable summary, which is the default with no options
+ if {![array size options]} {
+ set pretty_print 1
+ } elseif {[info exists options(ports_info_pretty)]} {
+ set pretty_print 1
+ array unset options ports_info_pretty
+ }
+
# Tune for sort(1)
if {[info exists options(ports_info_line)]} {
array unset options ports_info_line
@@ -1433,34 +1494,70 @@
if {$quiet} {
set show_label 0
}
-
+ # In pretty-print mode we also suppress messages, even though we show
+ # most of the labels:
+ if {$pretty_print} {
+ set quiet 1
+ }
+
# Spin through action options, emitting information for any found
set fields {}
- foreach { option } [array names options ports_info_*] {
+ set opts_todo [array names options ports_info_*]
+ set fields_tried {}
+ if {![llength $opts_todo]} {
+ set opts_todo {ports_info_heading ports_info_variants
+ ports_info_description ports_info_skip_line
+ ports_info_long_description ports_info_homepage
+ ports_info_skip_line ports_info_depends_build
+ ports_info_depends_lib ports_info_depends_run
+ ports_info_platforms ports_info_maintainers
+ }
+ }
+ foreach { option } $opts_todo {
set opt [string range $option 11 end]
- if {$opt eq "index"} {
+ # Artificial field name for formatting
+ if {$pretty_print && $opt eq "skip_line"} {
+ lappend fields ""
continue
}
-
- # Map from friendly name
- set ropt $opt
- if {[info exists name_map($opt)]} {
- set ropt $name_map($opt)
- }
-
- # If there's no such info, move on
- if {![info exists portinfo($ropt)]} {
- if {!$quiet} {
- puts stderr "no info for '$opt'"
+ # Artificial field names to reproduce prettyprinted summary
+ if {$opt eq "heading"} {
+ set inf "$portinfo(name) @$portinfo(version)"
+ set ropt "heading"
+ if {[info exists portinfo(revision)] && $portinfo(revision) > 0} {
+ append inf ", Revision $portinfo(revision)"
}
- set inf ""
+ if {[info exists portinfo(categories)]} {
+ append inf " ([join $portinfo(categories) ", "])"
+ }
+ } elseif {$opt eq "fullname"} {
+ set inf "$portinfo(name) @"
+ append inf [composite_version $portinfo(version) $portinfo(active_variants)]
+ set ropt "fullname"
} else {
- set inf $portinfo($ropt)
+ # Map from friendly name
+ set ropt [map_friendly_field_names $opt]
+
+ # If there's no such info, move on
+ if {![info exists portinfo($ropt)]} {
+ if {!$quiet} {
+ puts stderr "no info for '$opt'"
+ }
+ set inf ""
+ } else {
+ set inf $portinfo($ropt)
+ }
}
-
+
# Calculate field label
set label ""
- if {$show_label} {
+ if {$pretty_print} {
+ if {[info exists pretty_label($ropt)]} {
+ set label $pretty_label($ropt)
+ } else {
+ set label $opt
+ }
+ } elseif {$show_label} {
set label "$opt: "
}
@@ -1468,103 +1565,90 @@
if { $ropt eq "maintainers" } {
set inf [unobscure_maintainers $inf]
}
+ # ... special formatting for certain fields when prettyprinting
+ if {$pretty_print} {
+ if {$ropt eq "variants"} {
+ # Only use the new key for variants if it exists in PortInfo.
+ # Note that this key does not currently exist outside of trunk.
+ array unset variants
+ if {[info exists portinfo(_variants)]} {
+ array set variants $portinfo(_variants)
+ }
+
+ set pi_vars $inf
+ set inf {}
+ foreach v [lsort $pi_vars] {
+ set mod ""
+ if {[info exists variations($v)]} {
+ # selected by command line, prefixed with +/-
+ set mod $variations($v)
+ } elseif {[info exists global_variations($v)]} {
+ # selected by variants.conf, prefixed with (+)/(-)
+ set mod "($global_variations($v))"
+ # Retrieve additional information from the new key.
+ } elseif {[info exists variants]} {
+ array unset variant
+ array set variant $variants($v)
+ if {$variant(is_default) eq "+"} {
+ set mod "\[+\]"
+ }
+ }
+ lappend inf "$mod$v"
+ }
+ } elseif {[string match "depend*" $ropt]
+ && ![macports::ui_isset ports_verbose]} {
+ set pi_deps $inf
+ set inf {}
+ foreach d $pi_deps {
+ lappend inf [lindex [split $d :] end]
+ }
+ }
+ }
+ #End of special pretty-print formatting for certain fields
if [info exists list_map($ropt)] {
set field [join $inf $subfield_sep]
} else {
set field $inf
}
- lappend fields "$label$field"
- }
-
- if {[llength $fields]} {
- # Show specific fields
- puts [join $fields $field_sep]
- } else {
- # If we weren't asked to show any specific fields, then show general information
- puts -nonewline "$portinfo(name) @$portinfo(version)"
- if {[info exists portinfo(revision)] && $portinfo(revision) > 0} {
- puts -nonewline ", Revision $portinfo(revision)"
- }
- if {[info exists portinfo(categories)]} {
- puts -nonewline " ([join $portinfo(categories) ", "])"
- }
- puts ""
- if {[info exists portinfo(variants)]} {
- global global_variations
-
- # Only use the new key for variants if it exists in PortInfo.
- # Note that this key does not currently exist outside of trunk.
- array unset variants
- if {[info exists portinfo(_variants)]} {
- array set variants $portinfo(_variants)
+ # Assemble the entry
+ if {$pretty_print} {
+ # The two special fields are considered headings and are
+ # emitted immediately, rather than waiting. Also they are not
+ # recorded on the list of fields tried
+ if {$ropt eq "heading" || $ropt eq "fullname"} {
+ puts "$label$field"
+ continue
}
-
- set joiner ""
- set vars ""
- foreach v [lsort $portinfo(variants)] {
- set mod ""
- if {[info exists variations($v)]} {
- # selected by command line, prefixed with +/-
- set mod $variations($v)
- } elseif {[info exists global_variations($v)]} {
- # selected by variants.conf, prefixed with (+)/(-)
- set mod "($global_variations($v))"
- # Retrieve additional information from the new key.
- } elseif {[info exists variants]} {
- array unset variant
- array set variant $variants($v)
- if {$variant(is_default) eq "+"} {
- set mod "\[+\]"
- }
- }
- append vars "$joiner$mod$v"
- set joiner ", "
- }
- puts [wraplabel "Variants" $vars 0 [string repeat " " 13]]
}
- puts ""
- if {[info exists portinfo(long_description)]} {
- puts [wrap [join $portinfo(long_description)] 0]
- } else {
- if {[info exists portinfo(description)]} {
- puts [wrap [join $portinfo(description)] 0]
+ lappend fields_tried $label
+ if {$pretty_print} {
+ if {![string length $field]} {
+ continue
}
- }
- if {[info exists portinfo(homepage)]} {
- puts [wraplabel "Homepage" $portinfo(homepage) 0 [string repeat " " 13]]
- }
- puts ""
- # Emit build, library, and runtime dependencies
- # For wrapping, indent output at 22 chars
- set label_len 22
- foreach {key title} {
- depends_build "Build Dependencies"
- depends_lib "Library Dependencies"
- depends_run "Runtime Dependencies"
- } {
- if {[info exists portinfo($key)]} {
- set depstr ""
- set joiner ""
- foreach d $portinfo($key) {
- if {[macports::ui_isset ports_verbose]} {
- append depstr "$joiner$d"
- } else {
- append depstr "$joiner[lindex [split $d :] end]"
- }
- set joiner ", "
+ if {![string length $label]} {
+ lappend fields [wrap $field 0]
+ } else {
+ set wrap_len [string length $label]
+ if {[info exists pretty_wrap($ropt)]} {
+ set wrap_len $pretty_wrap($ropt)
}
- set nodeps false
- puts [wraplabel $title $depstr 0 [string repeat " " $label_len]]
+ lappend fields [wraplabel $label $field 0 [string repeat " " $wrap_len]]
}
+
+ } else { # Not pretty print
+ lappend fields "$label$field"
}
-
- if {[info exists portinfo(platforms)]} {
- puts [wraplabel "Platforms" [join $portinfo(platforms) ", "] 0 [string repeat " " $label_len]]
+ }
+
+ # Now output all that information:
+ if {[llength $fields]} {
+ puts [join $fields $field_sep]
+ } else {
+ if {$pretty_print && [llength $fields_tried]} {
+ puts -nonewline "$portinfo(name) has no "
+ puts [join $fields_tried ", "]
}
- if {[info exists portinfo(maintainers)]} {
- puts [wraplabel "Maintainers" [unobscure_maintainers $portinfo(maintainers)] 0 [string repeat " " $label_len]]
- }
}
set separator "--\n"
}
@@ -1790,16 +1874,12 @@
return 1
}
foreachport $portlist {
- # Merge global variations into the variations specified for this port
- foreach { variation value } [array get global_variations] {
- if { ![info exists variations($variation)] } {
- set variations($variation) $value
+ # Global variations will have to be merged into the specified
+ # variations, but perhaps after the installed variations are
+ # merged. So we pass them into upgrade:
+ macports::upgrade $portname "port:$portname" [array get global_variations] [array get variations] [array get options]
}
- }
- macports::upgrade $portname "port:$portname" [array get variations] [array get options]
- }
-
return 0
}
@@ -2128,65 +2208,6 @@
return $status
}
-
-proc action_deps { action portlist opts } {
- set status 0
- if {[require_portlist portlist]} {
- return 1
- }
- foreachport $portlist {
- # Get info about the port
- if {[catch {mportsearch $portname no exact} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- break_softcontinue "search for portname $portname failed: $result" 1 status
- }
-
- if {$result == ""} {
- break_softcontinue "No port $portname found." 1 status
- }
-
- array unset portinfo
- array set portinfo [lindex $result 1]
- if {[catch {set mport [mportopen $portinfo(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
- # set portname again since the one we were passed may not have had the correct case
- set portname $portinfo(name)
-
- set depstypes {depends_build depends_lib depends_run}
- set depstypes_descr {"build" "library" "runtime"}
-
- set nodeps true
- foreach depstype $depstypes depsdecr $depstypes_descr {
- if {[info exists portinfo($depstype)] &&
- $portinfo($depstype) != ""} {
- puts "$portname has $depsdecr dependencies on:"
- foreach i $portinfo($depstype) {
- if {[macports::ui_isset ports_verbose]} {
- puts "\t$i"
- } else {
- puts "\t[lindex [split [lindex $i 0] :] end]"
- }
- }
- set nodeps false
- }
- }
-
- # no dependencies found
- if {$nodeps == "true"} {
- puts "$portname has no dependencies"
- }
- }
-
- return $status
-}
-
-
proc action_variants { action portlist opts } {
set status 0
if {[require_portlist portlist]} {
@@ -2239,14 +2260,16 @@
array unset vinfo
array set vinfo $variants($vname)
- puts -nonewline "\t$vname"
+ if { [ info exists vinfo(is_default) ] \
+ && $vinfo(is_default) == "+" } {
+ set mod "\[+] "
+ } else {
+ set mod {}
+ }
+ puts -nonewline "\t$mod$vname"
if { [ info exists vinfo(description) ] } {
puts -nonewline ": [ string trim $vinfo(description) ]"
}
- if { [ info exists vinfo(is_default) ] \
- && $vinfo(is_default) == "+" } {
- puts -nonewline "\n\t * is a default variant"
- }
if { [ info exists vinfo(conflicts) ] \
&& $vinfo(conflicts) != "" } {
puts -nonewline "\n\t * conflicts with [ string trim $vinfo(conflicts) ]"
@@ -2271,49 +2294,83 @@
ui_error "You must specify a search pattern"
return 1
}
-
+
+ # Copy global options as we are going to modify the array
+ array set options [array get global_options]
+
+ if {[info exists options(ports_search_depends)] && $options(ports_search_depends) == "yes"} {
+ array unset options ports_search_depends
+ set options(ports_search_depends_build) yes
+ set options(ports_search_depends_lib) yes
+ set options(ports_search_depends_run) yes
+ }
+
+ # Array to hold given filters
+ array set filters {}
+ # Default matchstyle
+ set filter_matchstyle "none"
+ set filter_case no
+ foreach { option } [array names options ports_search_*] {
+ set opt [string range $option 13 end]
+
+ if { $options($option) != "yes" } {
+ continue
+ }
+ switch -- $opt {
+ exact -
+ glob -
+ regex {
+ set filter_matchstyle $opt
+ continue
+ }
+ case-sensitive {
+ set filter_case yes
+ continue
+ }
+ line {
+ continue
+ }
+ }
+
+ set filters($opt) "yes"
+ }
+ # Set default search filter if none was given
+ if { [array size filters] == 0 } {
+ set filters(name) "yes"
+ }
+
set separator ""
foreach portname $portlist {
puts -nonewline $separator
- if {[string first "*" $portname] == -1} {
- set searchstring "*$portname*"
- } else {
- set searchstring $portname
+ set searchstring $portname
+ set matchstyle $filter_matchstyle
+ if {$matchstyle == "none"} {
+ # Guess if the given string was a glob expression, if not do a substring search
+ if {[string first "*" $portname] == -1 && [string first "?" $portname] == -1} {
+ set searchstring "*$portname*"
+ }
+ set matchstyle glob
}
+ set res {}
set portfound 0
- set res {}
- if {[catch {set matches [mportsearch $searchstring no glob name]} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- break_softcontinue "search for name $portname failed: $result" 1 status
+ foreach { opt } [array get filters] {
+ # Map from friendly name
+ set opt [map_friendly_field_names $opt]
+
+ if {[catch {eval set matches \[mportsearch \$searchstring $filter_case $matchstyle $opt\]} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ 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]
}
- 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 $searchstring 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 $searchstring 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 ""
@@ -2338,8 +2395,8 @@
if {[macports::ui_isset ports_quiet]} {
puts $portinfo(name)
} else {
- if {[info exists global_options(ports_search_line)]
- && $global_options(ports_search_line) == "yes"} {
+ if {[info exists options(ports_search_line)]
+ && $options(ports_search_line) == "yes"} {
puts "$portinfo(name)\t$portinfo(version)\t$portinfo(categories)\t$portinfo(description)"
} else {
puts -nonewline $joiner
@@ -2367,7 +2424,10 @@
set separator "--\n"
}
-
+
+ array unset options
+ array unset filters
+
return $status
}
@@ -2746,7 +2806,7 @@
outdated [list action_outdated [action_args_const ports]] \
contents [list action_contents [action_args_const ports]] \
dependents [list action_dependents [action_args_const ports]] \
- deps [list action_deps [action_args_const ports]] \
+ deps [list action_info [action_args_const ports]] \
variants [list action_variants [action_args_const ports]] \
\
search [list action_search [action_args_const strings]] \
@@ -2836,10 +2896,14 @@
edit {{editor 1}}
ed {{editor 1}}
info {category categories depends_build depends_lib depends_run
- depends description epoch homepage index line long_description
- maintainer maintainers name platform platforms portdir
+ depends description epoch fullname heading homepage index line
+ long_description
+ maintainer maintainers name platform platforms portdir pretty
revision variant variants version}
- search {line}
+ search {case-sensitive category categories depends_build depends_lib depends_run
+ depends description epoch exact glob homepage line
+ long_description maintainer maintainers name platform
+ platforms portdir regex revision variant variants version}
selfupdate {nosync pretend}
uninstall {follow-dependents}
variants {index}
@@ -2849,6 +2913,12 @@
select {list set show}
}
+global cmd_implied_options
+array set cmd_implied_options {
+ deps {ports_info_fullname yes ports_info_depends yes ports_info_pretty yes}
+}
+
+
##
# Checks whether the given option is valid
#
@@ -3025,6 +3095,7 @@
global cmd_argc cmd_argv cmd_argn
global global_options global_options_base private_options ui_options
global current_portdir
+ global cmd_implied_options
set cmd_argv $argv
set cmd_argc [llength $argv]
set cmd_argn 0
@@ -3051,8 +3122,13 @@
cd $current_portdir
# Reset global_options from base before each action, as we munge it just below...
+ array unset global_options
array set global_options $global_options_base
+ if {[info exists cmd_implied_options($action)]} {
+ array set global_options $cmd_implied_options($action)
+ }
+
# Find an action to execute
set action_proc [find_action_proc $action]
if { $action_proc == "" } {
@@ -3265,6 +3341,10 @@
}
}
+ # Create macports user directory if it does not exist yet
+ if {$use_readline && ![file isdirectory $macports::macports_user_dir]} {
+ file mkdir $macports::macports_user_dir
+ }
# Save readine history
if {$use_readline && [file isdirectory $macports::macports_user_dir]} {
rl_history write $history_file
Modified: users/perry/base-select/src/port1.0/portfetch.tcl
===================================================================
--- users/perry/base-select/src/port1.0/portfetch.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/port1.0/portfetch.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -44,8 +44,8 @@
options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_lzma use_dmg dist_subdir \
fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
master_sites.mirror_subdir patch_sites.mirror_subdir portname \
- cvs.module cvs.root cvs.password cvs.date cvs.tag \
- svn.url svn.tag \
+ cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
+ svn.url svn.tag svn.method \
git.url git.branch \
hg.url hg.tag
@@ -61,6 +61,7 @@
default cvs.cmd {$portutil::autoconf::cvs_path}
default cvs.password ""
default cvs.dir {${workpath}}
+default cvs.method {export}
default cvs.module {$distname}
default cvs.tag ""
default cvs.date ""
@@ -71,6 +72,7 @@
default svn.cmd {$portutil::autoconf::svn_path}
default svn.dir {${workpath}}
+default svn.method {export}
default svn.tag ""
default svn.env {}
default svn.pre_args {"--non-interactive"}
@@ -449,10 +451,13 @@
# information in a custom .cvspass file
proc cvsfetch {args} {
global workpath cvs.env cvs.cmd cvs.args cvs.post_args
- global cvs.root cvs.date cvs.tag cvs.password
+ global cvs.root cvs.date cvs.tag cvs.method cvs.password
global patch_sites patchfiles filespath
- set cvs.args "co ${cvs.args}"
+ set cvs.args "${cvs.method} ${cvs.args}"
+ if {${cvs.method} == "export" && ![string length ${cvs.tag}] && ![string length ${cvs.date}]} {
+ set cvs.tag "HEAD"
+ }
if {[string length ${cvs.tag}]} {
set cvs.args "${cvs.args} -r ${cvs.tag}"
}
@@ -491,7 +496,7 @@
# Perform an svn fetch
proc svnfetch {args} {
global workpath prefix_frozen
- global svn.env svn.cmd svn.args svn.post_args svn.tag svn.url
+ global svn.env svn.cmd svn.args svn.post_args svn.tag svn.url svn.method
# Look for the svn command, either in the path or in the prefix
set goodcmd 0
@@ -508,7 +513,7 @@
return -code error [msgcat::mc "Subversion check out failed"]
}
- set svn.args "checkout ${svn.args}"
+ set svn.args "${svn.method} ${svn.args}"
if {[string length ${svn.tag}]} {
set svn.args "${svn.args} -r ${svn.tag}"
}
Modified: users/perry/base-select/src/port1.0/portmain.tcl
===================================================================
--- users/perry/base-select/src/port1.0/portmain.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/port1.0/portmain.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -119,10 +119,7 @@
if {[info exists variations(universal)] && $variations(universal) == "+"} {
# cannot go into the variant, due to the amount of ports overriding it
- global configure.universal_target
- if {[info exists configure.universal_target]} {
- eval macosx_deployment_target ${configure.universal_target}
- }
+ eval macosx_deployment_target ${universal_target}
}
}
Modified: users/perry/base-select/src/port1.0/portutil.tcl
===================================================================
--- users/perry/base-select/src/port1.0/portutil.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/port1.0/portutil.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -1673,6 +1673,10 @@
# Record a canonical variant string, used e.g. in accessing the registry
set portvariants [canonicalize_variants [array get activevariants]]
+ # Make this important information visible in PortInfo
+ set PortInfo(active_variants) [array get activevariants]
+ set PortInfo(canonical_active_variants) $portvariants
+
# XXX: I suspect it would actually work better in the following
# block to record the activevariants in the statefile rather than
# the upvariations, since as far as I can see different sets of
Modified: users/perry/base-select/src/registry1.0/receipt_flat.tcl
===================================================================
--- users/perry/base-select/src/registry1.0/receipt_flat.tcl 2009-01-01 19:52:02 UTC (rev 44644)
+++ users/perry/base-select/src/registry1.0/receipt_flat.tcl 2009-01-01 20:15:56 UTC (rev 44645)
@@ -181,7 +181,11 @@
# Remove any line starting with #
while {[regexp "(^|\n)#.*\n(.*)\$" $receipt_contents match foo receipt_contents]} {}
- array set receipt_$ref $receipt_contents
+ if {[catch {array set receipt_$ref $receipt_contents} rcpterr]} {
+ ui_error "Malformed receipt for ${name} @${version}_${revision}${variants}"
+ ui_error "receipt_contents = '$receipt_contents'"
+ error $rcpterr
+ }
} else {
# This is old Images format
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090101/efce9024/attachment-0001.html>
More information about the macports-changes
mailing list