[107845] trunk/base/src/macports1.0/macports.tcl
larryv at macports.org
larryv at macports.org
Sat Jul 6 21:48:16 PDT 2013
Revision: 107845
https://trac.macports.org/changeset/107845
Author: larryv at macports.org
Date: 2013-07-06 21:48:16 -0700 (Sat, 06 Jul 2013)
Log Message:
-----------
macports.tcl: Replace quotes with braces in expressions.
Also remove unnecessary quoting entirely in a couple of places.
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2013-07-07 04:29:50 UTC (rev 107844)
+++ trunk/base/src/macports1.0/macports.tcl 2013-07-07 04:48:16 UTC (rev 107845)
@@ -100,7 +100,7 @@
# ui_options accessor
proc macports::ui_isset {val} {
if {[info exists macports::ui_options($val)]} {
- if {$macports::ui_options($val) eq "yes"} {
+ if {$macports::ui_options($val) eq {yes}} {
return 1
}
}
@@ -111,7 +111,7 @@
# global_options accessor
proc macports::global_option_isset {val} {
if {[info exists macports::global_options($val)]} {
- if {$macports::global_options($val) eq "yes"} {
+ if {$macports::global_options($val) eq {yes}} {
return 1
}
}
@@ -197,7 +197,7 @@
proc set_phase {phase} {
global macports::current_phase
set macports::current_phase $phase
- if {$phase ne "main"} {
+ if {$phase ne {main}} {
set cur_time [clock format [clock seconds] -format {%+}]
ui_debug "$phase phase started at $cur_time"
}
@@ -206,20 +206,20 @@
proc ui_message {priority prefix phase args} {
global macports::channels ::debuglog macports::current_phase
foreach chan $macports::channels($priority) {
- if {[info exists ::debuglog] && ($chan eq "debuglog")} {
+ if {[info exists ::debuglog] && ($chan eq {debuglog})} {
set chan $::debuglog
if {[info exists macports::current_phase]} {
set phase $macports::current_phase
}
set strprefix ":${priority}:$phase "
- if {[lindex $args 0] eq "-nonewline"} {
+ if {[lindex $args 0] eq {-nonewline}} {
puts -nonewline $chan $strprefix[lindex $args 1]
} else {
puts $chan $strprefix[lindex $args 0]
}
} else {
- if {[lindex $args 0] eq "-nonewline"} {
+ if {[lindex $args 0] eq {-nonewline}} {
puts -nonewline $chan $prefix[lindex $args 1]
} else {
puts $chan $prefix[lindex $args 0]
@@ -376,7 +376,7 @@
if {[catch {set xcodebuildversion [exec -- $xcodebuild -version 2> /dev/null]}] == 0} {
if {[regexp {Xcode ([0-9.]+)} $xcodebuildversion - xcode_v] == 1} {
set macports::xcodeversion $xcode_v
- } elseif {[regexp "DevToolsCore-(.*);" $xcodebuildversion - devtoolscore_v] == 1} {
+ } elseif {[regexp {DevToolsCore-(.*);} $xcodebuildversion - devtoolscore_v] == 1} {
if {$devtoolscore_v >= 1809.0} {
set macports::xcodeversion 3.2.6
} elseif {$devtoolscore_v >= 1204.0} {
@@ -465,7 +465,7 @@
ui_error "Please use xcode-select to select an Xcode installation:"
foreach xcode $installed_xcodes {
set vers [exec $mdls -raw -name kMDItemVersion $xcode]
- if {$vers eq "(null)"} {set vers unknown}
+ if {$vers eq {(null)}} {set vers unknown}
if {[_is_valid_developer_dir ${xcode}/Contents/Developer]} {
# Though xcode-select shipped with xcode 4.3 supports and encourages
# direct use of the app path, older xcode-select does not.
@@ -588,15 +588,15 @@
# set up platform info variables
set os_arch $tcl_platform(machine)
- if {$os_arch eq "Power Macintosh"} {set os_arch "powerpc"}
- if {$os_arch eq "i586" || $os_arch eq "i686" || $os_arch eq "x86_64"} {set os_arch "i386"}
+ if {$os_arch eq {Power Macintosh}} {set os_arch "powerpc"}
+ if {$os_arch eq {i586} || $os_arch eq {i686} || $os_arch eq {x86_64}} {set os_arch "i386"}
set os_version $tcl_platform(osVersion)
set os_major [lindex [split $os_version .] 0]
set os_platform [string tolower $tcl_platform(os)]
# Remove trailing "Endian"
set os_endian [string range $tcl_platform(byteOrder) 0 end-6]
set macosx_version {}
- if {$os_platform eq "darwin"} {
+ if {$os_platform eq {darwin}} {
# This will probably break when Apple changes versioning
set macosx_version [expr {10.0 + ($os_major - 4) / 10.0}]
}
@@ -606,10 +606,10 @@
if {[info exists env(HOME)]} {
set macports::user_home $env(HOME)
set macports::macports_user_dir [file normalize $macports::autoconf::macports_user_dir]
- } elseif {[info exists env(SUDO_USER)] && $os_platform eq "darwin"} {
+ } elseif {[info exists env(SUDO_USER)] && $os_platform eq {darwin}} {
set macports::user_home [exec dscl -q . -read /Users/$env(SUDO_USER) NFSHomeDirectory | cut -d ' ' -f 2]
set macports::macports_user_dir [file join $macports::user_home [string range $macports::autoconf::macports_user_dir 2 end]]
- } elseif {[exec id -u] != 0 && $os_platform eq "darwin"} {
+ } elseif {[exec id -u] != 0 && $os_platform eq {darwin}} {
set macports::user_home [exec dscl -q . -read /Users/[exec id -un] NFSHomeDirectory | cut -d ' ' -f 2]
set macports::macports_user_dir [file join $macports::user_home [string range $macports::autoconf::macports_user_dir 2 end]]
} else {
@@ -674,7 +674,7 @@
if {[lsearch -exact [list nosync default] $flag] == -1} {
ui_warn "$sources_conf source '$line' specifies invalid flag '$flag'"
}
- if {$flag eq "default"} {
+ if {$flag eq {default}} {
if {[info exists sources_default]} {
ui_warn "More than one default port source is defined."
}
@@ -762,7 +762,7 @@
# Format for receipts; currently only "sqlite" is allowed
# could previously be "flat", so we switch that to sqlite
- if {![info exists portdbformat] || $portdbformat eq "flat" || $portdbformat eq "sqlite"} {
+ if {![info exists portdbformat] || $portdbformat eq {flat} || $portdbformat eq {sqlite}} {
set registry.format receipt_sqlite
} else {
return -code error "unknown registry format '$portdbformat' set in macports.conf"
@@ -800,13 +800,13 @@
if {![info exists macports::global_options(ports_binary_only)]
&& ![info exists macports::global_options(ports_source_only)]
&& [info exists macports::buildfromsource]} {
- if {$macports::buildfromsource eq "never"} {
+ if {$macports::buildfromsource eq {never}} {
set macports::global_options(ports_binary_only) yes
set temp_options(ports_binary_only) yes
- } elseif {$macports::buildfromsource eq "always"} {
+ } elseif {$macports::buildfromsource eq {always}} {
set macports::global_options(ports_source_only) yes
set temp_options(ports_source_only) yes
- } elseif {$macports::buildfromsource ne "ifneeded"} {
+ } elseif {$macports::buildfromsource ne {ifneeded}} {
ui_warn "'buildfromsource' set to unknown value '$macports::buildfromsource', using 'ifneeded' instead"
}
}
@@ -926,7 +926,7 @@
# Default arch to build for
if {![info exists macports::build_arch]} {
- if {$os_platform eq "darwin"} {
+ if {$os_platform eq {darwin}} {
if {$os_major >= 10} {
if {[sysctl hw.cpu64bit_capable] == 1} {
set macports::build_arch x86_64
@@ -934,7 +934,7 @@
set macports::build_arch i386
}
} else {
- if {$os_arch eq "powerpc"} {
+ if {$os_arch eq {powerpc}} {
set macports::build_arch ppc
} else {
set macports::build_arch i386
@@ -1010,7 +1010,7 @@
# don't keep unusable TMPDIR/TMP values
foreach var {TMP TMPDIR} {
if {[info exists env($var)] && [file writable $env($var)] &&
- ([getuid] != 0 || $macportsuser eq "root" ||
+ ([getuid] != 0 || $macportsuser eq {root} ||
[file attributes $env($var) -owner] eq $macportsuser)} {
lappend keepenvkeys $var
}
@@ -1024,7 +1024,7 @@
}
# unset environment an extra time, to work around bugs in Leopard Tcl
- if {$macosx_version eq "10.5"} {
+ if {$macosx_version eq {10.5}} {
foreach envkey $env_names {
if {[lsearch -exact $keepenvkeys $envkey] == -1} {
unsetenv $envkey
@@ -1039,20 +1039,20 @@
}
if {![info exists developer_dir]} {
- if {$os_platform eq "darwin"} {
+ if {$os_platform eq {darwin}} {
trace add variable macports::developer_dir read macports::set_developer_dir
} else {
set macports::developer_dir {}
}
} else {
- if {$os_platform eq "darwin" && ![file isdirectory $developer_dir]} {
+ if {$os_platform eq {darwin} && ![file isdirectory $developer_dir]} {
ui_warn "Your developer_dir setting in macports.conf points to a non-existing directory.\
Since this is known to cause problems, please correct the setting or comment it and let\
macports auto-discover the correct path."
}
}
- if {[getuid] == 0 && $os_major >= 11 && $os_platform eq "darwin" &&
+ if {[getuid] == 0 && $os_major >= 11 && $os_platform eq {darwin} &&
[file isfile "${macports::user_home}/Library/Preferences/com.apple.dt.Xcode.plist"]} {
macports::copy_xcode_plist $env(HOME)
}
@@ -1079,33 +1079,33 @@
if {[catch {array set sysConfProxies [get_systemconfiguration_proxies]} result]} {
return -code error "Unable to get proxy configuration from system: $result"
}
- if {![info exists env(http_proxy)] || $proxy_override_env eq "yes"} {
+ if {![info exists env(http_proxy)] || $proxy_override_env eq {yes}} {
if {[info exists proxy_http]} {
set env(http_proxy) $proxy_http
} elseif {[info exists sysConfProxies(proxy_http)]} {
set env(http_proxy) $sysConfProxies(proxy_http)
}
}
- if {![info exists env(HTTPS_PROXY)] || $proxy_override_env eq "yes"} {
+ if {![info exists env(HTTPS_PROXY)] || $proxy_override_env eq {yes}} {
if {[info exists proxy_https]} {
set env(HTTPS_PROXY) $proxy_https
} elseif {[info exists sysConfProxies(proxy_https)]} {
set env(HTTPS_PROXY) $sysConfProxies(proxy_https)
}
}
- if {![info exists env(FTP_PROXY)] || $proxy_override_env eq "yes"} {
+ if {![info exists env(FTP_PROXY)] || $proxy_override_env eq {yes}} {
if {[info exists proxy_ftp]} {
set env(FTP_PROXY) $proxy_ftp
} elseif {[info exists sysConfProxies(proxy_ftp)]} {
set env(FTP_PROXY) $sysConfProxies(proxy_ftp)
}
}
- if {![info exists env(RSYNC_PROXY)] || $proxy_override_env eq "yes"} {
+ if {![info exists env(RSYNC_PROXY)] || $proxy_override_env eq {yes}} {
if {[info exists proxy_rsync]} {
set env(RSYNC_PROXY) $proxy_rsync
}
}
- if {![info exists env(NO_PROXY)] || $proxy_override_env eq "yes"} {
+ if {![info exists env(NO_PROXY)] || $proxy_override_env eq {yes}} {
if {[info exists proxy_skip]} {
set env(NO_PROXY) $proxy_skip
} elseif {[info exists sysConfProxies(proxy_skip)]} {
@@ -1139,7 +1139,7 @@
if {![info exists macports::ui_options(ports_no_old_index_warning)]} {
set default_source_url [lindex $sources_default 0]
- if {[macports::getprotocol $default_source_url] eq "file" || [macports::getprotocol $default_source_url] eq "rsync"} {
+ if {[macports::getprotocol $default_source_url] eq {file} || [macports::getprotocol $default_source_url] eq {rsync}} {
set default_portindex [macports::getindex $default_source_url]
if {[file exists $default_portindex] && [clock seconds] - [file mtime $default_portindex] > 1209600} {
ui_warn "port definitions are more than two weeks old, consider updating them by running 'port selfupdate'."
@@ -1324,7 +1324,7 @@
# next access will actually define the variable.
$workername eval "trace add variable ::$opt read ::trace_$opt"
# define some value now
- $workername eval set $opt "?"
+ $workername eval set $opt ?
}
foreach {opt val} $options {
@@ -1422,7 +1422,7 @@
ui_debug "getting port name from binary archive"
# get the portname from the contents file
foreach line [split $contents \n] {
- if {[lindex $line 0] eq "@name"} {
+ if {[lindex $line 0] eq {@name}} {
# actually ${name}-${version}_$revision
set portname [lindex $line 1]
}
@@ -1523,7 +1523,7 @@
# append requested path
set proposedpath [file join $proposedpath _resources $path]
- if {$fallback eq "yes" && ![file exists $proposedpath]} {
+ if {$fallback eq {yes} && ![file exists $proposedpath]} {
return [getdefaultportresourcepath $path]
}
@@ -1539,7 +1539,7 @@
global macports::sources_default
set default_source_url [lindex $sources_default 0]
- if {[getprotocol $default_source_url] eq "file"} {
+ if {[getprotocol $default_source_url] eq {file}} {
set proposedpath [getportdir $default_source_url]
} else {
set proposedpath [getsourcepath $default_source_url]
@@ -1686,7 +1686,7 @@
foreach category [lsort -increasing -unique [readdir $root]] {
set pathToCategory [file join $root $category]
# process the category dirs but not _resources
- if {[file isdirectory $pathToCategory] && [string index [file tail $pathToCategory] 0] ne "_"} {
+ if {[file isdirectory $pathToCategory] && [string index [file tail $pathToCategory] 0] ne {_}} {
# Iterate on port directories.
foreach port [lsort -increasing -unique [readdir $pathToCategory]] {
set pathToPort [file join $pathToCategory $port]
@@ -1863,7 +1863,7 @@
![catch {$workername eval check_supported_archs} result] && $result == 0 &&
![catch {$workername eval eval_targets $target} result] && $result == 0} {
# If auto-clean mode, clean-up after dependency install
- if {$macports::portautoclean eq "yes"} {
+ if {$macports::portautoclean eq {yes}} {
# Make sure we are back in the port path before clean
# otherwise if the current directory had been changed to
# inside the port, the next port may fail when trying to
@@ -1902,7 +1902,7 @@
return 1
}
set portname [_mportkey $mport subport]
- if {$target ne "clean"} {
+ if {$target ne {clean}} {
macports::push_log $mport
}
@@ -1925,7 +1925,7 @@
if {[macports::_target_needs_deps $target] && [macports::_mport_has_deptypes $mport [macports::_deptypes_for_target $target $workername]]} {
registry::exclusive_lock
# see if we actually need to build this port
- if {($target ne "activate" && $target ne "install") ||
+ if {($target ne {activate} && $target ne {install}) ||
![$workername eval registry_exists \$subport \$version \$revision \$portvariants]} {
# upgrade dependencies that are already installed
@@ -1984,13 +1984,13 @@
}
} else {
# No dependencies, but we still need to check for conflicts.
- if {$target eq {} || $target eq "install" || $target eq "activate"} {
+ if {$target eq {} || $target eq {install} || $target eq {activate}} {
_mporterrorifconflictsinstalled $mport
}
}
set clean 0
- if {$macports::portautoclean eq "yes" && ($target eq "install" || $target eq "activate")} {
+ if {$macports::portautoclean eq {yes} && ($target eq {install} || $target eq {activate})} {
# If we're doing an install, check if we should clean after
set clean 1
}
@@ -2041,8 +2041,8 @@
# check that the dep has the required archs
set active_archs [_get_registry_archs $dep_portname]
- if {$deptype ne "depends_fetch" && $deptype ne "depends_extract"
- && $active_archs ne {} && $active_archs ne "noarch" && $required_archs ne "noarch"
+ if {$deptype ne {depends_fetch} && $deptype ne {depends_extract}
+ && $active_archs ne {} && $active_archs ne {noarch} && $required_archs ne {noarch}
&& [lsearch -exact $depends_skip_archcheck $dep_portname] == -1} {
set missing {}
foreach arch $required_archs {
@@ -2174,7 +2174,7 @@
proc macports::getindex {source} {
# Special case file:// sources
- if {[macports::getprotocol $source] eq "file"} {
+ if {[macports::getprotocol $source] eq {file}} {
return [file join [macports::getportdir $source] PortIndex]
}
@@ -2276,7 +2276,7 @@
set destdir [file dirname $destdir]
} else {
# Keep rsync happy with a trailing slash
- if {[string index $source end] ne "/"} {
+ if {[string index $source end] ne {/}} {
append source /
}
# don't sync PortIndex yet; we grab the platform specific one afterwards
@@ -2410,7 +2410,7 @@
}
}
- if {(![info exists options(ports_force)] || $options(ports_force) ne "yes") && $updated <= 0} {
+ if {(![info exists options(ports_force)] || $options(ports_force) ne {yes}) && $updated <= 0} {
ui_info "No updates for $source"
continue
}
@@ -2418,7 +2418,7 @@
file mkdir $destdir
set verboseflag {}
- if {$macports::portverbose eq "yes"} {
+ if {$macports::portverbose eq {yes}} {
set verboseflag -v
}
@@ -2493,13 +2493,13 @@
proc mportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
global macports::portdbpath macports::sources
set matches [list]
- set easy [expr {$field eq "name"}]
+ set easy [expr {$field eq {name}}]
set found 0
foreach source $sources {
set source [lindex $source 0]
set protocol [macports::getprotocol $source]
- if {$protocol eq "mports"} {
+ if {$protocol eq {mports}} {
set res [macports::index::search $macports::portdbpath $source [list name $pattern]]
eval lappend matches $res
} else {
@@ -2524,14 +2524,14 @@
switch -- $matchstyle {
exact {
- set matchres [expr {0 == ($case_sensitive eq "yes" ? [string compare $pattern $target] : [string compare -nocase $pattern $target])}]
+ set matchres [expr {0 == ($case_sensitive eq {yes} ? [string compare $pattern $target] : [string compare -nocase $pattern $target])}]
}
glob {
- set matchres [expr {$case_sensitive eq "yes" ? [string match $pattern $target] : [string match -nocase $pattern $target]}]
+ set matchres [expr {$case_sensitive eq {yes} ? [string match $pattern $target] : [string match -nocase $pattern $target]}]
}
regexp -
default {
- set matchres [expr {$case_sensitive eq "yes" ? [regexp -- $pattern $target] : [regexp -nocase -- $pattern $target]}]
+ set matchres [expr {$case_sensitive eq {yes} ? [regexp -- $pattern $target] : [regexp -nocase -- $pattern $target]}]
}
}
@@ -2603,7 +2603,7 @@
foreach source $sources {
set source [lindex $source 0]
set protocol [macports::getprotocol $source]
- if {$protocol ne "mports"} {
+ if {$protocol ne {mports}} {
global macports::quick_index
if {![info exists quick_index(${sourceno},[string tolower $name])]} {
incr sourceno 1
@@ -2687,7 +2687,7 @@
foreach source $sources {
set source [lindex $source 0]
set protocol [macports::getprotocol $source]
- if {$protocol ne "mports"} {
+ if {$protocol ne {mports}} {
if {![catch {set fd [open [macports::getindex $source] r]} result]} {
try {
incr found 1
@@ -2892,7 +2892,7 @@
flush stdout
}
- if {$target eq {} || $target eq "install" || $target eq "activate"} {
+ if {$target eq {} || $target eq {install} || $target eq {activate}} {
_mporterrorifconflictsinstalled $mport
}
@@ -2930,7 +2930,7 @@
set nrequired [llength $required_archs]
foreach key $prev_seenkeys {
set key_archs [lrange [split $key ,] 1 end]
- if {$key_archs eq "noarch" || $required_archs eq "noarch" || [llength $key_archs] > $nrequired} {
+ if {$key_archs eq {noarch} || $required_archs eq {noarch} || [llength $key_archs] > $nrequired} {
set seen 1
set seenkey $key
break
@@ -2954,7 +2954,7 @@
}
set check_archs 0
- if {$dep_portname ne {} && $deptype ne "depends_fetch" && $deptype ne "depends_extract" && [lsearch -exact $depends_skip_archcheck $dep_portname] == -1} {
+ if {$dep_portname ne {} && $deptype ne {depends_fetch} && $deptype ne {depends_extract} && [lsearch -exact $depends_skip_archcheck $dep_portname] == -1} {
set check_archs 1
}
@@ -3010,7 +3010,7 @@
if {[info exists dep_portinfo(variants)] && [lsearch -exact $dep_portinfo(variants) universal] != -1} {
# a universal variant is offered
set has_universal 1
- if {![info exists variation_array(universal)] || $variation_array(universal) ne "+"} {
+ if {![info exists variation_array(universal)] || $variation_array(universal) ne {+}} {
set variation_array(universal) +
# try again with +universal
set depport [mportopen $dep_portinfo(porturl) $dep_options [array get variation_array]]
@@ -3059,11 +3059,11 @@
# check if the given mport can support dependents with the given archs
proc macports::_mport_supports_archs {mport required_archs} {
- if {$required_archs eq "noarch"} {
+ if {$required_archs eq {noarch}} {
return 1
}
set provided_archs [_mport_archs $mport]
- if {$provided_archs eq "noarch"} {
+ if {$provided_archs eq {noarch}} {
return 1
}
foreach arch $required_archs {
@@ -3082,14 +3082,14 @@
# check if the active version of a port supports the given archs
proc macports::_active_supports_archs {portname required_archs} {
- if {$required_archs eq "noarch"} {
+ if {$required_archs eq {noarch}} {
return 1
}
if {[catch {registry::active $portname}]} {
return 0
}
set provided_archs [_active_archs $portname]
- if {$provided_archs eq "noarch" || $provided_archs eq {} || $provided_archs == 0} {
+ if {$provided_archs eq {noarch} || $provided_archs eq {} || $provided_archs == 0} {
return 1
}
foreach arch $required_archs {
@@ -3232,11 +3232,11 @@
# are we syncing a tarball? (implies detached signature)
set is_tarball 0
- if {[string range $rsync_dir end-3 end] eq ".tar"} {
+ if {[string range $rsync_dir end-3 end] eq {.tar}} {
set is_tarball 1
set mp_source_path [file join $portdbpath sources $rsync_server [file dirname $rsync_dir]]
} else {
- if {[string index $rsync_dir end] ne "/"} {
+ if {[string index $rsync_dir end] ne {/}} {
append rsync_dir /
}
set mp_source_path [file join $portdbpath sources $rsync_server $rsync_dir]
@@ -3295,7 +3295,7 @@
# echo current MacPorts version
ui_msg "MacPorts base version $macports::autoconf::macports_version installed,"
- if {[info exists options(ports_force)] && $options(ports_force) eq "yes"} {
+ if {[info exists options(ports_force)] && $options(ports_force) eq {yes}} {
set use_the_force_luke yes
ui_debug "Forcing a rebuild and reinstallation of MacPorts"
} else {
@@ -3320,7 +3320,7 @@
set comp [vercmp $macports_version_new $macports::autoconf::macports_version]
# syncing ports tree.
- if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne "yes"} {
+ if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne {yes}} {
if {$comp > 0} {
# updated portfiles potentially need new base to parse - tell sync to try to
# use prefabricated PortIndex files and signal if it couldn't
@@ -3331,8 +3331,8 @@
}
}
- if {$use_the_force_luke eq "yes" || $comp > 0} {
- if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} {
+ if {$use_the_force_luke eq {yes} || $comp > 0} {
+ if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq {yes}} {
ui_msg "$macports::ui_prefix MacPorts base is outdated, selfupdate would install $macports_version_new (dry run)"
} else {
ui_msg "$macports::ui_prefix MacPorts base is outdated, installing new version $macports_version_new"
@@ -3341,7 +3341,7 @@
set owner [file attributes $prefix -owner]
set group [file attributes $prefix -group]
set perms [string range [file attributes $prefix -permissions] end-3 end]
- if {$tcl_platform(user) ne "root" && $tcl_platform(user) ne $owner} {
+ if {$tcl_platform(user) ne {root} && $tcl_platform(user) ne $owner} {
return -code error "User $tcl_platform(user) does not own $prefix - try using sudo"
}
ui_debug "Permissions OK"
@@ -3358,20 +3358,20 @@
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) ne "Darwin" || $prefix eq "/usr/local"
+ if {$tcl_platform(os) ne {Darwin} || $prefix eq {/usr/local}
|| ([glob -nocomplain /usr/local/lib/lib{readline,history}*] eq {} && [glob -nocomplain /usr/local/include/readline/*.h] eq {})} {
append configure_args " --enable-readline"
} else {
ui_warn "Disabling readline support due to readline in /usr/local"
}
- if {$prefix eq "/usr/local" || $prefix eq "/usr"} {
+ if {$prefix eq {/usr/local} || $prefix eq {/usr}} {
append configure_args " --with-unsupported-prefix"
}
# Choose a sane compiler
set cc_arg {}
- if {$::macports::os_platform eq "darwin"} {
+ if {$::macports::os_platform eq {darwin}} {
set cc_arg "CC=/usr/bin/cc OBJC=/usr/bin/cc "
}
@@ -3397,7 +3397,7 @@
return -code error "Couldn't change permissions of the MacPorts sources at $mp_source_path to ${sources_owner}: $result"
}
- if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne "yes"} {
+ if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne {yes}} {
if {[info exists needed_portindex]} {
ui_msg "Not all sources could be fully synced using the old version of MacPorts."
ui_msg "Please run selfupdate again now that MacPorts base has been updated."
@@ -3455,7 +3455,7 @@
# Is this a dry run?
set is_dryrun no
- if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} {
+ if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq {yes}} {
set is_dryrun yes
}
@@ -3716,12 +3716,12 @@
} elseif {$epoch_installed < $epoch_in_tree && $version_installed != $version_in_tree} {
set build_override 1
ui_debug "epoch override ... upgrading!"
- } elseif {[info exists options(ports_upgrade_enforce-variants)] && $options(ports_upgrade_enforce-variants) eq "yes"
+ } elseif {[info exists options(ports_upgrade_enforce-variants)] && $options(ports_upgrade_enforce-variants) eq {yes}
&& [info exists portinfo(canonical_active_variants)] && $portinfo(canonical_active_variants) != $oldvariant} {
ui_debug "variant override ... upgrading!"
} elseif {$os_platform_installed ne {} && $os_major_installed ne {} && $os_platform_installed != 0
- && ([_mportkey $mport "{os.platform}"] != $os_platform_installed
- || [_mportkey $mport "{os.major}"] != $os_major_installed)} {
+ && ([_mportkey $mport {{os.platform}}] != $os_platform_installed
+ || [_mportkey $mport {{os.major}}] != $os_major_installed)} {
ui_debug "platform mismatch ... upgrading!"
set build_override 1
} elseif {$is_revupgrade_second_run} {
@@ -3851,7 +3851,7 @@
set options(ports_force) yes
set existing_epoch [lindex [lindex [registry::installed $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)] 0] 5]
set newregref [registry::open_entry $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) $existing_epoch]
- if {$is_dryrun eq "yes"} {
+ if {$is_dryrun eq {yes}} {
ui_msg "Skipping uninstall $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)"
} elseif {![registry::run_target $newregref uninstall [array get options]]
&& [catch {registry_uninstall::uninstall $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) [array get options]} result]} {
@@ -3874,7 +3874,7 @@
# we have to force the deactivate in case of dependents
set force_cur [info exists options(ports_force)]
set options(ports_force) yes
- if {$is_dryrun eq "yes"} {
+ if {$is_dryrun eq {yes}} {
ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}$variant_active (dry run)"
} elseif {![catch {registry::active $portname}] &&
![registry::run_target $regref deactivate [array get options]]
@@ -3896,7 +3896,7 @@
set uninstall_later yes
}
- if {$is_dryrun eq "yes"} {
+ if {$is_dryrun eq {yes}} {
if {$anyactive} {
ui_msg "Skipping deactivate $portname @${version_active}_${revision_active}$variant_active (dry run)"
}
@@ -3951,7 +3951,7 @@
set epoch [lindex $i 5]
ui_debug "Uninstalling $portname ${version}_${revision}$variant"
set regref [registry::open_entry $portname $version $revision $variant $epoch]
- if {$is_dryrun eq "yes"} {
+ if {$is_dryrun eq {yes}} {
ui_msg "Skipping uninstall $portname @${version}_${revision}$variant (dry run)"
} elseif {![registry::run_target $regref uninstall $optionslist]
&& [catch {registry_uninstall::uninstall $portname $version $revision $variant $optionslist} result]} {
@@ -4055,7 +4055,7 @@
foreach v $versions {
# Only the file name corresponds to the version name.
set v [file tail $v]
- if {$v eq "base" || $v eq "current"} {
+ if {$v eq {base} || $v eq {current}} {
continue
}
lappend lversions [file tail $v]
@@ -4064,13 +4064,13 @@
}
set {
# Use ${conf_path}/$version to read in sources.
- if {$version eq {} || $version eq "base" || $version eq "current"
+ if {$version eq {} || $version eq {base} || $version eq {current}
|| [catch {set src_file [open "${conf_path}/$version"]} result]} {
global errorInfo
ui_debug "${result}: $errorInfo"
return -code error "The specified version '$version' is not valid."
}
- set srcs [split [read -nonewline $src_file] "\n"]
+ set srcs [split [read -nonewline $src_file] \n]
close $src_file
# Use ${conf_path}/base to read in targets.
@@ -4152,12 +4152,12 @@
# check if the system we're on can run code of the given architecture
proc macports::arch_runnable {arch} {
global macports::os_major macports::os_arch macports::os_platform
- if {$macports::os_platform eq "darwin"} {
- if {$macports::os_major >= 11 && [string first "ppc" $arch] == 0} {
+ if {$macports::os_platform eq {darwin}} {
+ if {$macports::os_major >= 11 && [string first ppc $arch] == 0} {
return no
- } elseif {$macports::os_arch eq "i386" && $arch eq "ppc64"} {
+ } elseif {$macports::os_arch eq {i386} && $arch eq {ppc64}} {
return no
- } elseif {$macports::os_major <= 8 && $arch eq "x86_64"} {
+ } elseif {$macports::os_major <= 8 && $arch eq {x86_64}} {
return no
}
}
@@ -4220,7 +4220,7 @@
if {$binary_count > 0} {
ui_msg -nonewline "$macports::ui_prefix Scanning binaries for linking errors"
set handle [machista::create_handle]
- if {$handle eq "NULL"} {
+ if {$handle eq {NULL}} {
error "Error creating libmachista handle"
}
array unset files_warned_about
@@ -4257,13 +4257,13 @@
}
set architecture [$result cget -mt_archs]
- while {$architecture ne "NULL"} {
- if {[info exists options(ports_rev-upgrade_id-loadcmd-check)] && $options(ports_rev-upgrade_id-loadcmd-check) eq "yes"} {
- if {[$architecture cget -mat_install_name] ne "NULL" && [$architecture cget -mat_install_name] ne {}} {
+ while {$architecture ne {NULL}} {
+ if {[info exists options(ports_rev-upgrade_id-loadcmd-check)] && $options(ports_rev-upgrade_id-loadcmd-check) eq {yes}} {
+ if {[$architecture cget -mat_install_name] ne {NULL} && [$architecture cget -mat_install_name] ne {}} {
# check if this lib's install name actually refers to this file itself
# if this is not the case software linking against this library might have erroneous load commands
if {0 == [catch {set idloadcmdpath [revupgrade_handle_special_paths $bpath [$architecture cget -mat_install_name]]}]} {
- if {[string index $idloadcmdpath 0] ne "/"} {
+ if {[string index $idloadcmdpath 0] ne {/}} {
set port [registry::entry owner $bpath]
if {$port ne {}} {
set portname [$port name]
@@ -4318,7 +4318,7 @@
set loadcommand [$architecture cget -mat_loadcmds]
- while {$loadcommand ne "NULL"} {
+ while {$loadcommand ne {NULL}} {
if {0 != [catch {set filepath [revupgrade_handle_special_paths $bpath [$loadcommand cget -mlt_install_name]]}]} {
set loadcommand [$loadcommand cget -next]
continue;
@@ -4346,7 +4346,7 @@
set libarchitecture [$libresult cget -mt_archs]
set libarch_found false;
- while {$libarchitecture ne "NULL"} {
+ while {$libarchitecture ne {NULL}} {
if {[$architecture cget -mat_arch] ne [$libarchitecture cget -mat_arch]} {
set libarchitecture [$libarchitecture cget -next]
continue;
@@ -4403,7 +4403,7 @@
}
set broken_ports [lsort -unique $broken_ports]
- if {$macports::revupgrade_mode eq "rebuild"} {
+ if {$macports::revupgrade_mode eq {rebuild}} {
# don't try to rebuild ports that don't exist in the tree
set temp_broken_ports {}
foreach port $broken_ports {
@@ -4449,7 +4449,7 @@
}
unset temp_broken_ports
- if {$macports::revupgrade_mode ne "rebuild"} {
+ if {$macports::revupgrade_mode ne {rebuild}} {
ui_msg "$macports::ui_prefix Found [llength $broken_ports] broken port(s):"
foreach port $broken_ports {
ui_msg " [$port name] @[$port version] [$port variants][$port negated_variants]"
@@ -4561,7 +4561,7 @@
}
}
- if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq "yes"} {
+ if {[info exists options(ports_dryrun)] && $options(ports_dryrun) eq {yes}} {
ui_warn "If this was no dry run, rev-upgrade would now run the checks again to find unresolved and newly created problems"
return 0
}
@@ -4688,12 +4688,12 @@
while {[gets $fd line] >= 0} {
if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
if {[lsearch -exact $conf_options $option] >= 0} {
- if {$option eq "name"} {
+ if {$option eq {name}} {
set cur_name $val
lappend all_names $val
} elseif {[info exists cur_name]} {
set trimmedval [string trim $val]
- if {$option eq "urls"} {
+ if {$option eq {urls}} {
set processed_urls {}
foreach url $trimmedval {
lappend processed_urls ${url}:nosubdir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130706/5792df1b/attachment-0001.html>
More information about the macports-changes
mailing list