[51289] trunk/base/src/macports1.0/macports.tcl
toby at macports.org
toby at macports.org
Fri May 22 01:44:30 PDT 2009
Revision: 51289
http://trac.macports.org/changeset/51289
Author: toby at macports.org
Date: 2009-05-22 01:44:30 -0700 (Fri, 22 May 2009)
Log Message:
-----------
whitespace
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2009-05-22 08:39:58 UTC (rev 51288)
+++ trunk/base/src/macports1.0/macports.tcl 2009-05-22 08:44:30 UTC (rev 51289)
@@ -19,7 +19,7 @@
# 3. Neither the name of Apple Computer, Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -55,14 +55,14 @@
rsync_options rsync_dir startupitem_type place_worksymlink \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
applications_dir frameworks_dir universal_target universal_sysroot universal_archs $user_options"
-
+
# deferred options are only computed when needed.
# they are not exported to the trace thread.
# they are not exported to the interpreter in system_options array.
variable portinterp_deferred_options "xcodeversion xcodebuildcmd"
-
+
variable open_mports {}
-
+
variable ui_priorities "debug info msg error warn"
}
@@ -170,7 +170,7 @@
}
default {
return ""
- }
+ }
}
}
@@ -197,7 +197,7 @@
msg {
if {[ui_isset ports_quiet]} {
return {}
- } else {
+ } else {
return {stdout}
}
}
@@ -257,7 +257,7 @@
proc macports::setxcodeinfo {name1 name2 op} {
global macports::xcodeversion
global macports::xcodebuildcmd
-
+
trace remove variable macports::xcodeversion read macports::setxcodeinfo
trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
@@ -279,7 +279,7 @@
set macports::xcodeversion "2.0orlower"
}
}
-
+
if {![info exists xcodebuildcmd]} {
set macports::xcodebuildcmd "xcodebuild"
}
@@ -318,7 +318,7 @@
} else {
upvar $up_variations variations
}
-
+
global auto_path env
global macports::autoconf::macports_conf_path
global macports::macports_user_dir
@@ -364,7 +364,7 @@
# Otherwise define the user directory as a direcotory that will never exist
set macports::macports_user_dir "/dev/null/NO_HOME_DIR"
}
-
+
# Configure the search path for configuration files
set conf_files ""
lappend conf_files "${macports_conf_path}/macports.conf"
@@ -375,7 +375,7 @@
set PORTSRC $env(PORTSRC)
lappend conf_files ${PORTSRC}
}
-
+
# Process the first configuration file we find on conf_files list
foreach file $conf_files {
if [file exists $file] {
@@ -392,7 +392,7 @@
close $fd
}
}
-
+
# Process per-user only settings
set per_user "${macports_user_dir}/user.conf"
if [file exists $per_user] {
@@ -407,7 +407,7 @@
}
close $fd
}
-
+
if {![info exists sources_conf]} {
return -code error "sources_conf must be set in ${macports_conf_path}/macports.conf or in your ${macports_user_dir}/macports.conf file"
}
@@ -493,7 +493,7 @@
if {[info exists portdbformat]} {
if { $portdbformat == "sqlite" } {
return -code error "SQLite is not yet supported for registry storage."
- }
+ }
set registry.format receipt_${portdbformat}
} else {
set registry.format receipt_flat
@@ -505,7 +505,7 @@
} else {
set registry.installtype image
}
-
+
# Autoclean mode, whether to automatically call clean after "install"
if {![info exists portautoclean]} {
set macports::portautoclean "yes"
@@ -597,7 +597,7 @@
if {![file isdirectory $portsharepath]} {
return -code error "Data files directory '$portsharepath' must exist"
}
-
+
if {![info exists libpath]} {
set libpath "${prefix}/share/macports/Tcl"
}
@@ -607,7 +607,7 @@
} else {
set env(PATH) "$binpath"
}
-
+
# Set startupitem default type (can be overridden by portfile)
if {![info exists macports::startupitem_type]} {
set macports::startupitem_type "default"
@@ -625,7 +625,7 @@
if {![info exists macports::mp_remote_submit_url]} {
set macports::mp_remote_submit_url "${macports::mp_remote_url}/submit"
}
-
+
# Default mp configure options
if {![info exists macports::configureccache]} {
set macports::configureccache no
@@ -663,7 +663,7 @@
if {![info exists macports::universal_archs]} {
set macports::universal_archs {ppc i386}
}
-
+
# ENV cleanup.
set keepenvkeys {
DISPLAY DYLD_FALLBACK_FRAMEWORK_PATH
@@ -678,7 +678,7 @@
if {[info exists extra_env]} {
set keepenvkeys [concat ${keepenvkeys} ${extra_env}]
}
-
+
foreach envkey [array names env] {
if {[lsearch $keepenvkeys $envkey] == -1} {
array unset env $envkey
@@ -719,7 +719,7 @@
unsetenv $envkey
}
}
-
+
# Proxy handling (done this late since Pextlib is needed)
if {![info exists proxy_override_env] } {
set proxy_override_env "no"
@@ -798,7 +798,7 @@
}
$workername alias ui_prefix ui_prefix
$workername alias ui_channels ui_channels
-
+
# Export some utility functions defined here.
$workername alias macports_create_thread macports::create_thread
$workername alias getportworkpath_from_buildpath macports::getportworkpath_from_buildpath
@@ -836,7 +836,7 @@
$workername eval set $opt \{[set $opt]\}
}
}
-
+
foreach opt $portinterp_deferred_options {
global macports::$opt
# define the trace hook.
@@ -850,7 +850,7 @@
$workername eval "trace add variable ::$opt read ::trace_$opt"
# define some value now
$workername eval set $opt "?"
- }
+ }
foreach {opt val} $options {
$workername eval set user_options($opt) $val
@@ -898,7 +898,7 @@
thread::send -async $result "set macports::$opt \"$val\""
}
}
-
+
return $result
}
@@ -1083,7 +1083,7 @@
macports::worker_init $workername $portpath $porturl [macports::getportbuildpath $portpath] $options $filteredvariations
$workername eval source Portfile
-
+
# add the default universal variant, but only if
# it will work and another one isn't already present
if {[$workername eval default_universal_variant_allowed]} {
@@ -1113,7 +1113,7 @@
proc mporttraverse {func {root .}} {
# Save the current directory
set pwd [pwd]
-
+
# Join the root.
set pathToRoot [file join $pwd $root]
@@ -1131,7 +1131,7 @@
[file exists [file join $pathToPort "Portfile"]]} {
# Call the function.
$func [file join $category $port]
-
+
# Restore the current directory because some
# functions changes it.
cd $pathToRoot
@@ -1139,7 +1139,7 @@
}
}
}
-
+
# Restore the current directory.
cd $pwd
}
@@ -1189,7 +1189,7 @@
set depline [lindex [split $depspec :] 1]
set prefix [_mportkey $mport prefix]
set frameworks_dir [_mportkey $mport frameworks_dir]
-
+
if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
lappend search_path $env(DYLD_FRAMEWORK_PATH)
} else {
@@ -1225,12 +1225,12 @@
proc _bintest {mport depspec} {
global env
set depregex [lindex [split $depspec :] 1]
- set prefix [_mportkey $mport prefix]
-
+ set prefix [_mportkey $mport prefix]
+
set search_path [split $env(PATH) :]
-
+
set depregex \^$depregex\$
-
+
return [_mportsearchpath $depregex $search_path 1]
}
@@ -1239,8 +1239,8 @@
proc _pathtest {mport depspec} {
global env
set depregex [lindex [split $depspec :] 1]
- set prefix [_mportkey $mport prefix]
-
+ set prefix [_mportkey $mport prefix]
+
# separate directory from regex
set fullname $depregex
@@ -1352,7 +1352,7 @@
if {[$workername eval check_variants variations $target] != 0} {
return 1
}
-
+
# Before we build the port, we must build its dependencies.
# XXX: need a more general way of comparing against targets
set dlist {}
@@ -1362,7 +1362,7 @@
|| $target == "archive"
|| $target == "dmg" || $target == "mdmg"
|| $target == "pkg" || $target == "mpkg"
- || $target == "rpm" || $target == "dpkg"
+ || $target == "rpm" || $target == "dpkg"
|| $target == "srpm"|| $target == "portpkg" } {
ui_msg -nonewline "---> Computing dependencies for [_mportkey $mport name]"
@@ -1374,11 +1374,11 @@
return 1
}
ui_msg ""
-
+
# Select out the dependents along the critical path,
# but exclude this mport, we might not be installing it.
set dlist [dlist_append_dependents $macports::open_mports $mport {}]
-
+
dlist_delete dlist $mport
# install them
@@ -1389,7 +1389,7 @@
} else {
set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
}
-
+
if {$result != {}} {
set errstring "The following dependencies failed to build:"
foreach ditem $result {
@@ -1398,7 +1398,7 @@
ui_error $errstring
return 1
}
-
+
# Close the dependencies, we're done installing them.
foreach ditem $dlist {
mportclose $ditem
@@ -1416,7 +1416,7 @@
if { [string equal ${macports::registry.installtype} "image"] && [string equal $target "install"] } {
set target activate
}
-
+
# Build this port with the specified target
set result [$workername eval eval_targets $target]
@@ -1629,7 +1629,7 @@
global macports::portdbpath macports::sources
set matches [list]
set easy [expr { $field == "name" }]
-
+
set found 0
foreach source $sources {
set flags [lrange $source 1 end]
@@ -1649,7 +1649,7 @@
set name [lindex $line 0]
set len [lindex $line 1]
set line [read $fd $len]
-
+
if {$easy} {
set target $name
} else {
@@ -1657,7 +1657,7 @@
if {![info exists portinfo($field)]} continue
set target $portinfo($field)
}
-
+
switch $matchstyle {
exact {
set matchres [expr 0 == ( {$case_sensitive == "yes"} ? [string compare $pattern $target] : [string compare -nocase $pattern $target] )]
@@ -1670,7 +1670,7 @@
set matchres [expr {$case_sensitive == "yes"} ? [regexp -- $pattern $target] : [regexp -nocase -- $pattern $target]]
}
}
-
+
if {$matchres == 1} {
if {$easy} {
array set portinfo $line
@@ -1731,7 +1731,7 @@
# the use of the quick index.
proc mportlookup {name} {
global macports::portdbpath macports::sources
-
+
set sourceno 0
set matches [list]
foreach source $sources {
@@ -1756,7 +1756,7 @@
set name [lindex $line 0]
set len [lindex $line 1]
set line [read $fd $len]
-
+
array set portinfo $line
switch -regexp -- [macports::getprotocol ${source}] {
@@ -1816,7 +1816,7 @@
# it first if necessary.
proc _mports_load_quickindex {args} {
global macports::sources macports::quick_index
-
+
set sourceno 0
foreach source $sources {
unset -nocomplain quicklist
@@ -1943,18 +1943,18 @@
} else {
upvar accDeps accDeps
}
-
+
# progress indicator
if {![macports::ui_isset ports_debug]} {
ui_info -nonewline "."
flush stdout
}
-
+
# Determine deptypes to look for based on target
switch $target {
configure -
build { set deptypes "depends_lib depends_build" }
-
+
test -
destroot -
install -
@@ -1969,7 +1969,7 @@
dpkg -
"" { set deptypes "depends_lib depends_build depends_run" }
}
-
+
# Gather the dependencies for deptypes
foreach deptype $deptypes {
# Add to the list of dependencies if the option exists and isn't empty.
@@ -1979,11 +1979,11 @@
}
set subPorts {}
-
+
foreach depspec $depends {
# grab the portname portion of the depspec
set dep_portname [lindex [split $depspec :] end]
-
+
# Find the porturl
if {[catch {set res [mportlookup $dep_portname]} error]} {
global errorInfo
@@ -1991,7 +1991,7 @@
ui_error "Internal error: port lookup failed: $error"
return 1
}
-
+
array unset portinfo
array set portinfo [lindex $res 1]
if {[info exists portinfo(porturl)]} {
@@ -2004,7 +2004,7 @@
set options [ditem_key $mport options]
set variations [ditem_key $mport variations]
- # Figure out the subport.
+ # Figure out the subport.
set subport [mportopen $porturl $options $variations]
# Is that dependency satisfied or this port installed?
@@ -2012,7 +2012,7 @@
if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {
# Append the sub-port's provides to the port's requirements list.
ditem_append_unique $mport requires "[ditem_key $subport provides]"
-
+
if {$recurseDeps} {
# Skip the port if it's already in the accumulated list.
if {![info exists accDeps($dep_portname)]} {
@@ -2036,7 +2036,7 @@
}
}
}
-
+
return 0
}
@@ -2045,7 +2045,7 @@
global macports::prefix macports::portdbpath macports::libpath macports::rsync_server macports::rsync_dir macports::rsync_options
global macports::autoconf::macports_version macports::autoconf::rsync_path
array set options $optionslist
-
+
# syncing ports tree.
if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) != "yes"} {
ui_msg "---> Updating the ports tree"
@@ -2053,14 +2053,14 @@
return -code error "Couldn't sync the ports tree: $result"
}
}
-
+
# create the path to the to be downloaded sources if it doesn't exist
set mp_source_path [file join $portdbpath sources ${rsync_server} ${rsync_dir}/]
if {![file exists $mp_source_path]} {
file mkdir $mp_source_path
}
ui_debug "MacPorts sources location: $mp_source_path"
-
+
# sync the MacPorts sources
ui_msg "---> Updating MacPorts base sources using rsync"
if { [catch { system "$rsync_path $rsync_options rsync://${rsync_server}/${rsync_dir} $mp_source_path" } result ] } {
@@ -2118,7 +2118,7 @@
} else {
set tclpackage $libpath
}
-
+
set configure_args "--prefix=$prefix --with-tclpackage=$tclpackage --with-install-user=$owner --with-install-group=$group --with-directory-mode=$perms"
# too many users have an incompatible readline in /usr/local, see ticket #10651
if {$tcl_platform(os) != "Darwin" || $prefix == "/usr/local"
@@ -2127,7 +2127,7 @@
} else {
ui_warn "Disabling readline support due to readline in /usr/local"
}
-
+
# do the actual configure, build and installation of new base
ui_msg "Installing new MacPorts release in $prefix as $owner:$group; permissions $perms; Tcl-Package in $tclpackage\n"
if { [catch { system "cd $mp_source_path && ./configure $configure_args && make && make install" } result] } {
@@ -2496,7 +2496,7 @@
ui_error "Couldn't activate $portname ${version_in_tree}_${revision_in_tree}: $result"
return 1
}
-
+
if {[info exists uninstall_later] && $uninstall_later == yes} {
foreach i $ilist {
set version [lindex $i 1]
@@ -2535,7 +2535,7 @@
}
}
-
+
# close the port handle
mportclose $workername
}
@@ -2547,19 +2547,19 @@
upvar $portinfoname portinfo $depscachename depscache \
$globalvarlistname globalvarlist $variationslistname variationslist \
$optionsname options
-
+
# If we're following dependents, we only want to follow this port's
# dependents, not those of all its dependencies. Otherwise, we would
# end up processing this port's dependents n+1 times (recursively!),
# where n is the number of dependencies this port has, since this port
# is of course a dependent of each of its dependencies. Plus the
# dependencies could have any number of unrelated dependents.
-
+
# So we save whether we're following dependents, unset the option
# while doing the dependencies, and restore it afterwards.
set saved_do_dependents [info exists options(ports_do_dependents)]
unset -nocomplain options(ports_do_dependents)
-
+
# each dep type is upgraded
foreach dtype {depends_build depends_lib depends_run} {
if {[info exists portinfo($dtype)]} {
@@ -2567,7 +2567,7 @@
set d [lindex [split $i :] end]
if {![llength [array get depscache port:${d}]] && ![llength [array get depscache $i]]} {
upgrade $d $i $globalvarlist $variationslist [array get options] depscache
- }
+ }
}
}
}
@@ -2667,7 +2667,7 @@
if {[file exists $selected_version]} {
file delete $selected_version
}
- symlink $version $selected_version
+ symlink $version $selected_version
return
}
show {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090522/ff5bc83d/attachment-0001.html>
More information about the macports-changes
mailing list