<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[116448] trunk/base/src/port</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/116448">116448</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2014-01-25 08:52:01 -0800 (Sat, 25 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>port: Tcl cleanup, from a patch by Gustaf Neumann
 - braced expressions to allow for bytecode compilation
 - removed numeric comparisons where not necessary
 - removed unneeded calls to expr
 - consolidated nested lindex invocations
 - added brackets around if conditions</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasesrcportporttcl">trunk/base/src/port/port.tcl</a></li>
<li><a href="#trunkbasesrcportportindextcl">trunk/base/src/port/portindex.tcl</a></li>
<li><a href="#trunkbasesrcportportmirrortcl">trunk/base/src/port/portmirror.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbasesrcportporttcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port/port.tcl (116447 => 116448)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port/port.tcl        2014-01-25 16:49:02 UTC (rev 116447)
+++ trunk/base/src/port/port.tcl        2014-01-25 16:52:01 UTC (rev 116448)
</span><span class="lines">@@ -169,22 +169,22 @@
</span><span class="cx">     }
</span><span class="cx">     switch -- $unit {
</span><span class="cx">         KiB {
</span><del>-            set siz [expr $siz / 1024.0]
</del><ins>+            set siz [expr {$siz / 1024.0}]
</ins><span class="cx">         }
</span><span class="cx">         kB {
</span><del>-            set siz [expr $siz / 1000.0]
</del><ins>+            set siz [expr {$siz / 1000.0}]
</ins><span class="cx">         }
</span><span class="cx">         MiB {
</span><del>-            set siz [expr $siz / 1048576.0]
</del><ins>+            set siz [expr {$siz / 1048576.0}]
</ins><span class="cx">         }
</span><span class="cx">         MB {
</span><del>-            set siz [expr $siz / 1000000.0]
</del><ins>+            set siz [expr {$siz / 1000000.0}]
</ins><span class="cx">         }
</span><span class="cx">         GiB {
</span><del>-            set siz [expr $siz / 1073741824.0]
</del><ins>+            set siz [expr {$siz / 1073741824.0}]
</ins><span class="cx">         }
</span><span class="cx">         GB {
</span><del>-            set siz [expr $siz / 1000000000.0]
</del><ins>+            set siz [expr {$siz / 1000000000.0}]
</ins><span class="cx">         }
</span><span class="cx">         B { }
</span><span class="cx">         default {
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">             set unit &quot;B&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {[expr round($siz)] != $siz} {
</del><ins>+    if {[expr {round($siz)}] != $siz} {
</ins><span class="cx">         set siz [format {%.3f} $siz]
</span><span class="cx">     }
</span><span class="cx">     return &quot;$siz $unit&quot;
</span><span class="lines">@@ -250,16 +250,16 @@
</span><span class="cx">     set pos {}
</span><span class="cx">     set neg {}
</span><span class="cx">     foreach { key val } $variations {
</span><del>-        if {$val == &quot;+&quot;} {
</del><ins>+        if {$val eq &quot;+&quot;} {
</ins><span class="cx">             lappend pos $key
</span><del>-        } elseif {$val == &quot;-&quot;} {
</del><ins>+        } elseif {$val eq &quot;-&quot;} {
</ins><span class="cx">             lappend neg $key
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # If there is no version, we have nothing to do
</span><span class="cx">     set composite_version &quot;&quot;
</span><del>-    if {$version != &quot;&quot; || $emptyVersionOkay} {
</del><ins>+    if {$version ne &quot;&quot; || $emptyVersionOkay} {
</ins><span class="cx">         set pos_str &quot;&quot;
</span><span class="cx">         set neg_str &quot;&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -314,7 +314,7 @@
</span><span class="cx">     set ilist [registry::installed $portname $portversion]
</span><span class="cx">     if { [llength $ilist] &gt; 1 } {
</span><span class="cx">         # set portname again since the one we were passed may not have had the correct case
</span><del>-        set portname [lindex [lindex $ilist 0] 0]
</del><ins>+        set portname [lindex $ilist 0 0]
</ins><span class="cx">         ui_notice &quot;The following versions of $portname are currently installed:&quot;
</span><span class="cx">         foreach i [portlist_sortint $ilist] { 
</span><span class="cx">             set iname [lindex $i 0]
</span><span class="lines">@@ -356,12 +356,12 @@
</span><span class="cx">     if {![info exists port(options)]}   { set port(options) [array get global_options] }
</span><span class="cx"> 
</span><span class="cx">     # If neither portname nor url is specified, then default to the current port
</span><del>-    if { $port(url) == &quot;&quot; &amp;&amp; $port(name) == &quot;&quot; } {
</del><ins>+    if { $port(url) eq &quot;&quot; &amp;&amp; $port(name) eq &quot;&quot; } {
</ins><span class="cx">         set url file://.
</span><span class="cx">         set portname [url_to_portname $url]
</span><span class="cx">         set port(url) $url
</span><span class="cx">         set port(name) $portname
</span><del>-        if {$portname == &quot;&quot;} {
</del><ins>+        if {$portname eq &quot;&quot;} {
</ins><span class="cx">             ui_error &quot;A default port name could not be supplied.&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx">     global private_options
</span><span class="cx">     upvar $nameportlist portlist
</span><span class="cx"> 
</span><del>-    if {[llength $portlist] == 0 &amp;&amp; (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == &quot;no&quot;)} {
</del><ins>+    if {[llength $portlist] == 0 &amp;&amp; (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) eq &quot;no&quot;)} {
</ins><span class="cx">         if {${is_upgrade} == &quot;yes&quot;} {
</span><span class="cx">             # $&gt; port upgrade outdated
</span><span class="cx">             # Error: No ports matched the given expression
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx">     set string [split $line &quot; &quot;]
</span><span class="cx">     if {$indentfirstline == 0} {
</span><span class="cx">         set newline &quot;&quot;
</span><del>-        set maxlen [expr $maxlen - [string length $indent]]
</del><ins>+        set maxlen [expr {$maxlen - [string length $indent]}]
</ins><span class="cx">     } else {
</span><span class="cx">         set newline $indent
</span><span class="cx">     }
</span><span class="lines">@@ -657,7 +657,7 @@
</span><span class="cx">             # If indentfirstline is set to 0, reset maxlen to its
</span><span class="cx">             # original length after appending the first line to lines.
</span><span class="cx">             if {$first == 1 &amp;&amp; $indentfirstline == 0} {
</span><del>-                set maxlen [expr $maxlen + [string length $indent]]
</del><ins>+                set maxlen [expr {$maxlen + [string length $indent]}]
</ins><span class="cx">             }
</span><span class="cx">             set first 0
</span><span class="cx">         }
</span><span class="lines">@@ -678,7 +678,7 @@
</span><span class="cx"> # @param maxlen text width (0 defaults to current terminal width)
</span><span class="cx"> # @return wrapped string
</span><span class="cx"> proc wraplabel {label string maxlen {indent &quot;&quot;}} {
</span><del>-    append label &quot;: [string repeat &quot; &quot; [expr [string length $indent] - [string length &quot;$label: &quot;]]]&quot;
</del><ins>+    append label &quot;: [string repeat &quot; &quot; [expr {[string length $indent] - [string length &quot;$label: &quot;]}]]&quot;
</ins><span class="cx">     return &quot;$label[wrap $string $maxlen $indent 0]&quot;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -761,7 +761,7 @@
</span><span class="cx"> proc get_current_port {} {
</span><span class="cx">     set url file://.
</span><span class="cx">     set portname [url_to_portname $url]
</span><del>-    if {$portname == &quot;&quot;} {
</del><ins>+    if {$portname eq &quot;&quot;} {
</ins><span class="cx">         ui_msg &quot;To use the current port, you must be in a port's directory.&quot;
</span><span class="cx">         return [list]
</span><span class="cx">     }
</span><span class="lines">@@ -775,7 +775,7 @@
</span><span class="cx"> proc get_installed_ports { {ignore_active yes} {active yes} } {
</span><span class="cx">     set ilist {}
</span><span class="cx">     if { [catch {set ilist [registry::installed]} result] } {
</span><del>-        if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+        if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">             global errorInfo
</span><span class="cx">             ui_debug &quot;$errorInfo&quot;
</span><span class="cx">             fatal &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -850,7 +850,7 @@
</span><span class="cx">     # Get the list of installed ports
</span><span class="cx">     set ilist {}
</span><span class="cx">     if { [catch {set ilist [registry::installed]} result] } {
</span><del>-        if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+        if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">             global errorInfo
</span><span class="cx">             ui_debug &quot;$errorInfo&quot;
</span><span class="cx">             fatal &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -904,20 +904,20 @@
</span><span class="cx">             # Compare versions, first checking epoch, then version, then revision
</span><span class="cx">             set comp_result 0
</span><span class="cx">             if {$installed_version != $latest_version} {
</span><del>-                set comp_result [expr $installed_epoch - $latest_epoch]
</del><ins>+                set comp_result [expr {$installed_epoch - $latest_epoch}]
</ins><span class="cx">                 if { $comp_result == 0 } {
</span><span class="cx">                     set comp_result [vercmp $installed_version $latest_version]
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             if { $comp_result == 0 } {
</span><del>-                set comp_result [expr $installed_revision - $latest_revision]
</del><ins>+                set comp_result [expr {$installed_revision - $latest_revision}]
</ins><span class="cx">             }
</span><span class="cx">             if {$comp_result == 0} {
</span><span class="cx">                 set regref [registry::open_entry $portname $installed_version $installed_revision $installed_variants $installed_epoch]
</span><span class="cx">                 set os_platform_installed [registry::property_retrieve $regref os_platform]
</span><span class="cx">                 set os_major_installed [registry::property_retrieve $regref os_major]
</span><del>-                if {$os_platform_installed != &quot;&quot; &amp;&amp; $os_platform_installed != 0
-                    &amp;&amp; $os_major_installed != &quot;&quot; &amp;&amp; $os_major_installed != 0
</del><ins>+                if {$os_platform_installed ne &quot;&quot; &amp;&amp; $os_platform_installed != 0
+                    &amp;&amp; $os_major_installed ne &quot;&quot; &amp;&amp; $os_major_installed != 0
</ins><span class="cx">                     &amp;&amp; ($os_platform_installed != ${macports::os_platform} || $os_major_installed != ${macports::os_major})} {
</span><span class="cx">                     set comp_result -1
</span><span class="cx">                 }
</span><span class="lines">@@ -959,7 +959,7 @@
</span><span class="cx"> proc get_ports_with_prop {propname propval} {
</span><span class="cx">     set ilist {}
</span><span class="cx">     if { [catch {set ilist [registry::installed]} result] } {
</span><del>-        if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+        if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">             global errorInfo
</span><span class="cx">             ui_debug &quot;$errorInfo&quot;
</span><span class="cx">             fatal &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -994,7 +994,7 @@
</span><span class="cx"> proc get_leaves_ports {} {
</span><span class="cx">     set ilist {}
</span><span class="cx">     if { [catch {set ilist [registry::installed]} result] } {
</span><del>-        if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+        if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">             global errorInfo
</span><span class="cx">             ui_debug &quot;$errorInfo&quot;
</span><span class="cx">             fatal &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">     set results {}
</span><span class="cx">     foreach i $ilist {
</span><span class="cx">         set iname [lindex $i 0]
</span><del>-        if {[registry::list_dependents $iname] == &quot;&quot;} {
</del><ins>+        if {[registry::list_dependents $iname] eq &quot;&quot;} {
</ins><span class="cx">             add_to_portlist results [list name $iname version &quot;[lindex $i 1]_[lindex $i 2]&quot; variants [split_variants [lindex $i 3]]]
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1408,7 +1408,7 @@
</span><span class="cx">             # Break up the token, because older Tcl switch doesn't support -matchvar
</span><span class="cx">             regexp {^(\w+):(.*)} $token matchvar selector portname
</span><span class="cx"> 
</span><del>-            set recursive [string equal $selector rdependentof]
</del><ins>+            set recursive [string equal $selector &quot;rdependentof&quot;]
</ins><span class="cx">             add_multiple_ports reslist [get_dependent_ports $portname $recursive]
</span><span class="cx">             
</span><span class="cx">             set el 1
</span><span class="lines">@@ -1421,7 +1421,7 @@
</span><span class="cx">             # Break up the token, because older Tcl switch doesn't support -matchvar
</span><span class="cx">             regexp {^(\w+):(.*)} $token matchvar selector portname
</span><span class="cx"> 
</span><del>-            set recursive [string equal $selector rdepof]
</del><ins>+            set recursive [string equal $selector &quot;rdepof&quot;]
</ins><span class="cx">             add_multiple_ports reslist [get_dep_ports $portname $recursive]
</span><span class="cx">             
</span><span class="cx">             set el 1
</span><span class="lines">@@ -1446,7 +1446,7 @@
</span><span class="cx">         ^\\w+:.+            { # Handle a url by trying to open it as a port and mapping the name
</span><span class="cx">             advance
</span><span class="cx">             set name [url_to_portname $token]
</span><del>-            if {$name != &quot;&quot;} {
</del><ins>+            if {$name ne &quot;&quot;} {
</ins><span class="cx">                 parsePortSpec version requested_variants options
</span><span class="cx">                 add_to_portlist reslist [list url $token \
</span><span class="cx">                   name $name \
</span><span class="lines">@@ -1487,7 +1487,7 @@
</span><span class="cx">     parsePortSpec version variants options $remainder
</span><span class="cx">     
</span><span class="cx">     array unset overrides
</span><del>-    if {$version != &quot;&quot;} { set overrides(version) $version }
</del><ins>+    if {$version ne &quot;&quot;} { set overrides(version) $version }
</ins><span class="cx">     if {[array size variants]} {
</span><span class="cx">         # we always record the requested variants separately,
</span><span class="cx">         # but requested ones always override existing ones
</span><span class="lines">@@ -1645,7 +1645,7 @@
</span><span class="cx">             if {[string match &quot;*/*&quot; $portname]} {
</span><span class="cx">                 set url &quot;file://$portname&quot;
</span><span class="cx">                 set name [url_to_portname $url 1]
</span><del>-                if { $name != &quot;&quot; } {
</del><ins>+                if { $name ne &quot;&quot; } {
</ins><span class="cx">                     # We mapped the url to valid port
</span><span class="cx">                     set porturl $url
</span><span class="cx">                     set portname $name
</span><span class="lines">@@ -1696,10 +1696,10 @@
</span><span class="cx">     set opt $remainder
</span><span class="cx">     set adv 0
</span><span class="cx">     set consumed 0
</span><del>-    for {set firstTime 1} {$opt != &quot;&quot; || [moreargs]} {set firstTime 0} {
</del><ins>+    for {set firstTime 1} {$opt ne &quot;&quot; || [moreargs]} {set firstTime 0} {
</ins><span class="cx">     
</span><span class="cx">         # Refresh opt as needed
</span><del>-        if {$opt == &quot;&quot;} {
</del><ins>+        if {$opt eq &quot;&quot;} {
</ins><span class="cx">             if {$adv} advance
</span><span class="cx">             set opt [lookahead]
</span><span class="cx">             set adv 1
</span><span class="lines">@@ -1717,14 +1717,14 @@
</span><span class="cx">             set sepPos [string first &quot;/&quot; $opt]
</span><span class="cx">             if {$sepPos &gt;= 0} {
</span><span class="cx">                 # Version terminated by &quot;/&quot; to disambiguate -variant from part of version
</span><del>-                set portversion [string range $opt 0 [expr $sepPos-1]]
-                set opt [string range $opt [expr $sepPos+1] end]
</del><ins>+                set portversion [string range $opt 0 $sepPos-1]
+                set opt [string range $opt $sepPos+1 end]
</ins><span class="cx">             } else {
</span><span class="cx">                 # Version terminated by &quot;+&quot;, or else is complete
</span><span class="cx">                 set sepPos [string first &quot;+&quot; $opt]
</span><span class="cx">                 if {$sepPos &gt;= 0} {
</span><span class="cx">                     # Version terminated by &quot;+&quot;
</span><del>-                    set portversion [string range $opt 0 [expr $sepPos-1]]
</del><ins>+                    set portversion [string range $opt 0 $sepPos-1]
</ins><span class="cx">                     set opt [string range $opt $sepPos end]
</span><span class="cx">                 } else {
</span><span class="cx">                     # Unterminated version
</span><span class="lines">@@ -1745,7 +1745,7 @@
</span><span class="cx">             } elseif {[regexp {^([-+])([[:alpha:]_]+[\w\.]*)} $opt match sign variant] == 1} {
</span><span class="cx">                 # It's a variant
</span><span class="cx">                 set portvariants($variant) $sign
</span><del>-                set opt [string range $opt [expr [string length $variant]+1] end]
</del><ins>+                set opt [string range $opt [string length $variant]+1 end]
</ins><span class="cx">                 set consumed 1
</span><span class="cx">             } else {
</span><span class="cx">                 # Not an option we recognize, so break from port option processing
</span><span class="lines">@@ -1793,7 +1793,7 @@
</span><span class="cx"> 
</span><span class="cx">         set ret &quot;Usage: &quot;
</span><span class="cx">         set len [string length $action]
</span><del>-        append ret [wrap &quot;$action$cmds$args&quot; 0 [string repeat &quot; &quot; [expr 8 + $len]] 0]
</del><ins>+        append ret [wrap &quot;$action$cmds$args&quot; 0 [string repeat &quot; &quot; [expr {8 + $len}]] 0]
</ins><span class="cx">         append ret &quot;\n&quot;
</span><span class="cx"> 
</span><span class="cx">         return $ret
</span><span class="lines">@@ -1889,8 +1889,8 @@
</span><span class="cx">             set portdir [file split [macports::getportdir $porturl]]
</span><span class="cx">             set lsize [llength $portdir]
</span><span class="cx">             set portdir \
</span><del>-                [file join [lindex $portdir [expr $lsize - 2]] \
-                           [lindex $portdir [expr $lsize - 1]]]
</del><ins>+                [file join [lindex $portdir $lsize-2] \
+                           [lindex $portdir $lsize-1]]
</ins><span class="cx">             if {[catch {mportsearch $portdir no exact portdir} result]} {
</span><span class="cx">                 ui_debug &quot;$::errorInfo&quot;
</span><span class="cx">                 break_softcontinue &quot;Portdir $portdir not found&quot; 1 status
</span><span class="lines">@@ -1966,7 +1966,7 @@
</span><span class="cx">         array unset portinfo
</span><span class="cx">         # If we have a url, use that, since it's most specific
</span><span class="cx">         # otherwise try to map the portname to a url
</span><del>-        if {$porturl == &quot;&quot; || $index_only} {
</del><ins>+        if {$porturl eq &quot;&quot; || $index_only} {
</ins><span class="cx">         # Verify the portname, getting portinfo to map to a porturl
</span><span class="cx">             if {[catch {mportlookup $portname} result]} {
</span><span class="cx">                 ui_debug &quot;$::errorInfo&quot;
</span><span class="lines">@@ -2074,7 +2074,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         # Interpret a convenient field abbreviation
</span><del>-        if {[info exists options(ports_info_depends)] &amp;&amp; $options(ports_info_depends) == &quot;yes&quot;} {
</del><ins>+        if {[info exists options(ports_info_depends)] &amp;&amp; $options(ports_info_depends) eq &quot;yes&quot;} {
</ins><span class="cx">             array unset options ports_info_depends
</span><span class="cx">             set options(ports_info_depends_fetch) yes
</span><span class="cx">             set options(ports_info_depends_extract) yes
</span><span class="lines">@@ -2226,7 +2226,7 @@
</span><span class="cx">                 }
</span><span class="cx">             } 
</span><span class="cx">             #End of special pretty-print formatting for certain fields
</span><del>-            if [info exists list_map($ropt)] {
</del><ins>+            if {[info exists list_map($ropt)]} {
</ins><span class="cx">                 set field [join $inf $subfield_sep]
</span><span class="cx">             } else {
</span><span class="cx">                 set field $inf
</span><span class="lines">@@ -2244,10 +2244,10 @@
</span><span class="cx">             }
</span><span class="cx">             lappend fields_tried $label
</span><span class="cx">             if {$pretty_print} {
</span><del>-                if {![string length $field]} {
</del><ins>+                if {$field eq &quot;&quot;} {
</ins><span class="cx">                     continue
</span><span class="cx">                 }
</span><del>-                if {![string length $label]} {
</del><ins>+                if {$label eq &quot;&quot;} {
</ins><span class="cx">                     set wrap_len 0
</span><span class="cx">                     if {[info exists pretty_wrap($ropt)]} {
</span><span class="cx">                         set wrap_len $pretty_wrap($ropt)
</span><span class="lines">@@ -2401,7 +2401,7 @@
</span><span class="cx">     foreach filename $portlist {
</span><span class="cx">         set file [file normalize $filename]
</span><span class="cx">         if {[file exists $file] || ![catch {file type $file}]} {
</span><del>-            if {![file isdirectory $file] || [file type $file] == &quot;link&quot;} {
</del><ins>+            if {![file isdirectory $file] || [file type $file] eq &quot;link&quot;} {
</ins><span class="cx">                 set port [registry::file_registered $file]
</span><span class="cx">                 if { $port != 0 } {
</span><span class="cx">                     puts &quot;$file is provided by: $port&quot;
</span><span class="lines">@@ -2434,7 +2434,7 @@
</span><span class="cx"> 
</span><span class="cx">             set i [lindex $ilist 0]
</span><span class="cx">             set regref [registry::entry open $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]
</span><del>-            if {[$regref installtype] == &quot;image&quot; &amp;&amp; [registry::run_target $regref activate [array get options]]} {
</del><ins>+            if {[$regref installtype] eq &quot;image&quot; &amp;&amp; [registry::run_target $regref activate [array get options]]} {
</ins><span class="cx">                 continue
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -2468,9 +2468,9 @@
</span><span class="cx">             set iversion [lindex $i 1]
</span><span class="cx">             set irevision [lindex $i 2]
</span><span class="cx">             set ivariants [lindex $i 3]
</span><del>-            if {$composite_version == &quot;&quot; || $composite_version == &quot;${iversion}_${irevision}${ivariants}&quot;} {
</del><ins>+            if {$composite_version eq &quot;&quot; || $composite_version == &quot;${iversion}_${irevision}${ivariants}&quot;} {
</ins><span class="cx">                 set regref [registry::entry open $portname $iversion $irevision $ivariants [lindex $i 5]]
</span><del>-                if {[$regref installtype] == &quot;image&quot; &amp;&amp; [registry::run_target $regref deactivate [array get options]]} {
</del><ins>+                if {[$regref installtype] eq &quot;image&quot; &amp;&amp; [registry::run_target $regref deactivate [array get options]]} {
</ins><span class="cx">                     continue
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -2629,7 +2629,7 @@
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     # set or unset?
</span><del>-    set val [string equal $action setrequested]
</del><ins>+    set val [string equal $action &quot;setrequested&quot;]
</ins><span class="cx">     foreachport $portlist {
</span><span class="cx">         set composite_version [composite_version $portversion [array get variations]]
</span><span class="cx">         if {![catch {set ilist [registry::installed $portname $composite_version]} result]} {
</span><span class="lines">@@ -2690,7 +2690,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> proc action_version { action portlist opts } {
</span><del>-    if ![macports::ui_isset ports_quiet] {
</del><ins>+    if {![macports::ui_isset ports_quiet]} {
</ins><span class="cx">         puts -nonewline &quot;Version: &quot;
</span><span class="cx">     }
</span><span class="cx">     puts [macports::version]
</span><span class="lines">@@ -2699,7 +2699,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> proc action_platform { action portlist opts } {
</span><del>-    if ![macports::ui_isset ports_quiet] {
</del><ins>+    if {![macports::ui_isset ports_quiet]} {
</ins><span class="cx">         puts -nonewline &quot;Platform: &quot;
</span><span class="cx">     }
</span><span class="cx">     puts &quot;${macports::os_platform} ${macports::os_major} ${macports::os_arch}&quot;
</span><span class="lines">@@ -2736,15 +2736,15 @@
</span><span class="cx">                 set index 0
</span><span class="cx">             }
</span><span class="cx">             # set portname again since the one we were passed may not have had the correct case
</span><del>-            set portname [lindex [lindex $ilist $index] 0]
-            set iversion [lindex [lindex $ilist $index] 1]
-            set irevision [lindex [lindex $ilist $index] 2]
-            set ivariants [lindex [lindex $ilist $index] 3]
</del><ins>+            set portname [lindex $ilist $index 0]
+            set iversion [lindex $ilist $index 1]
+            set irevision [lindex $ilist $index 2]
+            set ivariants [lindex $ilist $index 3]
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         set deplist [registry::list_dependents $portname $iversion $irevision $ivariants]
</span><span class="cx">         if { [llength $deplist] &gt; 0 } {
</span><del>-            if {$action == &quot;rdependents&quot;} {
</del><ins>+            if {$action eq &quot;rdependents&quot;} {
</ins><span class="cx">                 set toplist $deplist
</span><span class="cx">                 while 1 {
</span><span class="cx">                     set newlist {}
</span><span class="lines">@@ -2854,8 +2854,8 @@
</span><span class="cx">             set portdir [file split [macports::getportdir $porturl]]
</span><span class="cx">             set lsize [llength $portdir]
</span><span class="cx">             set portdir \
</span><del>-                [file join [lindex $portdir [expr $lsize - 2]] \
-                           [lindex $portdir [expr $lsize - 1]]]
</del><ins>+                [file join [lindex $portdir $lsize-2] \
+                           [lindex $portdir $lsize-1]]
</ins><span class="cx">             if {[catch {mportsearch $portdir no exact portdir} result]} {
</span><span class="cx">                 ui_debug &quot;$::errorInfo&quot;
</span><span class="cx">                 break_softcontinue &quot;Portdir $portdir not found&quot; 1 status
</span><span class="lines">@@ -2909,7 +2909,7 @@
</span><span class="cx">         # get list of direct deps
</span><span class="cx">         foreach type $deptypes {
</span><span class="cx">             if {[info exists portinfo($type)]} {
</span><del>-                if {$action == &quot;rdeps&quot; || [macports::ui_isset ports_verbose]} {
</del><ins>+                if {$action eq &quot;rdeps&quot; || [macports::ui_isset ports_verbose]} {
</ins><span class="cx">                     foreach dep $portinfo($type) {
</span><span class="cx">                         lappend deplist $dep
</span><span class="cx">                     }
</span><span class="lines">@@ -2918,7 +2918,7 @@
</span><span class="cx">                         lappend deplist [lindex [split $dep :] end]
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><del>-                if {$action == &quot;deps&quot;} {
</del><ins>+                if {$action eq &quot;deps&quot;} {
</ins><span class="cx">                     set label &quot;$labeldict($type) Dependencies&quot;
</span><span class="cx">                     lappend deps_output [wraplabel $label [join $deplist &quot;, &quot;] 0 [string repeat &quot; &quot; 22]]
</span><span class="cx">                     incr ndeps [llength $deplist]
</span><span class="lines">@@ -2936,7 +2936,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         puts -nonewline $separator
</span><del>-        if {$action == &quot;deps&quot;} {
</del><ins>+        if {$action eq &quot;deps&quot;} {
</ins><span class="cx">             if {$ndeps == 0} {
</span><span class="cx">                 ui_notice &quot;$portname @${version}_${revision}${variants} has no dependencies.&quot;
</span><span class="cx">             } else {
</span><span class="lines">@@ -3107,7 +3107,7 @@
</span><span class="cx">     set restrictedList 0
</span><span class="cx">     set ilist {}
</span><span class="cx">     
</span><del>-    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == &quot;no&quot;)} {
</del><ins>+    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) eq &quot;no&quot;)} {
</ins><span class="cx">         set restrictedList 1
</span><span class="cx">         foreachport $portlist {
</span><span class="cx">             set composite_version [composite_version $portversion [array get variations]]
</span><span class="lines">@@ -3121,7 +3121,7 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         if { [catch {set ilist [registry::installed]} result] } {
</span><del>-            if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+            if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;$errorInfo&quot;
</span><span class="cx">                 ui_error &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -3148,10 +3148,10 @@
</span><span class="cx">                 set os_platform [registry::property_retrieve $regref os_platform]
</span><span class="cx">                 set os_major [registry::property_retrieve $regref os_major]
</span><span class="cx">                 set archs [registry::property_retrieve $regref archs]
</span><del>-                if {$os_platform != 0 &amp;&amp; $os_platform != &quot;&quot; &amp;&amp; $os_major != 0 &amp;&amp; $os_major != &quot;&quot;} {
</del><ins>+                if {$os_platform != 0 &amp;&amp; $os_platform ne &quot;&quot; &amp;&amp; $os_major != 0 &amp;&amp; $os_major ne &quot;&quot;} {
</ins><span class="cx">                     append extra &quot; platform='$os_platform $os_major'&quot;
</span><span class="cx">                 }
</span><del>-                if {$archs != 0 &amp;&amp; $archs != &quot;&quot;} {
</del><ins>+                if {$archs != 0 &amp;&amp; $archs ne &quot;&quot;} {
</ins><span class="cx">                     append extra &quot; archs='$archs'&quot;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -3178,7 +3178,7 @@
</span><span class="cx">     # If port names were supplied, limit ourselves to those ports, else check all installed ports
</span><span class="cx">     set ilist {}
</span><span class="cx">     set restrictedList 0
</span><del>-    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) == &quot;no&quot;)} {
</del><ins>+    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) eq &quot;no&quot;)} {
</ins><span class="cx">         set restrictedList 1
</span><span class="cx">         foreach portspec $portlist {
</span><span class="cx">             array set port $portspec
</span><span class="lines">@@ -3194,7 +3194,7 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         if { [catch {set ilist [registry::installed]} result] } {
</span><del>-            if {$result != &quot;Registry error: No ports registered as installed.&quot;} {
</del><ins>+            if {$result ne &quot;Registry error: No ports registered as installed.&quot;} {
</ins><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;$errorInfo&quot;
</span><span class="cx">                 ui_error &quot;port installed failed: $result&quot;
</span><span class="lines">@@ -3251,10 +3251,10 @@
</span><span class="cx">             }
</span><span class="cx">             
</span><span class="cx">             # Compare versions, first checking epoch, then version, then revision
</span><del>-            set epoch_comp_result [expr $installed_epoch - $latest_epoch]
</del><ins>+            set epoch_comp_result [expr {$installed_epoch - $latest_epoch}]
</ins><span class="cx">             set comp_result [vercmp $installed_version $latest_version]
</span><span class="cx">             if { $comp_result == 0 } {
</span><del>-                set comp_result [expr $installed_revision - $latest_revision]
</del><ins>+                set comp_result [expr {$installed_revision - $latest_revision}]
</ins><span class="cx">             }
</span><span class="cx">             set reason &quot;&quot;
</span><span class="cx">             if {$epoch_comp_result != 0 &amp;&amp; $installed_version != $latest_version} {
</span><span class="lines">@@ -3266,8 +3266,8 @@
</span><span class="cx">                 set regref [registry::open_entry $portname $installed_version $installed_revision [lindex $i 3] $installed_epoch]
</span><span class="cx">                 set os_platform_installed [registry::property_retrieve $regref os_platform]
</span><span class="cx">                 set os_major_installed [registry::property_retrieve $regref os_major]
</span><del>-                if {$os_platform_installed != &quot;&quot; &amp;&amp; $os_platform_installed != 0
-                    &amp;&amp; $os_major_installed != &quot;&quot; &amp;&amp; $os_major_installed != 0
</del><ins>+                if {$os_platform_installed ne &quot;&quot; &amp;&amp; $os_platform_installed != 0
+                    &amp;&amp; $os_major_installed ne &quot;&quot; &amp;&amp; $os_major_installed != 0
</ins><span class="cx">                     &amp;&amp; ($os_platform_installed != ${macports::os_platform} || $os_major_installed != ${macports::os_major})} {
</span><span class="cx">                     set comp_result -1
</span><span class="cx">                     set reason { (platform $os_platform_installed $os_major_installed != ${macports::os_platform} ${macports::os_major})}
</span><span class="lines">@@ -3331,7 +3331,7 @@
</span><span class="cx">     foreachport $portlist {
</span><span class="cx">         if { ![catch {set ilist [registry::installed $portname]} result] } {
</span><span class="cx">             # set portname again since the one we were passed may not have had the correct case
</span><del>-            set portname [lindex [lindex $ilist 0] 0]
</del><ins>+            set portname [lindex $ilist 0 0]
</ins><span class="cx">         }
</span><span class="cx">         set files [registry::port_registered $portname]
</span><span class="cx">         if { $files != 0 } {
</span><span class="lines">@@ -3354,17 +3354,17 @@
</span><span class="cx"> 
</span><span class="cx"> # expand abbreviations of size units
</span><span class="cx"> proc complete_size_units {units} {
</span><del>-    if {$units == &quot;K&quot; || $units == &quot;Ki&quot;} {
</del><ins>+    if {$units eq &quot;K&quot; || $units eq &quot;Ki&quot;} {
</ins><span class="cx">         return &quot;KiB&quot;
</span><del>-    } elseif {$units == &quot;k&quot;} {
</del><ins>+    } elseif {$units eq &quot;k&quot;} {
</ins><span class="cx">         return &quot;kB&quot;
</span><del>-    } elseif {$units == &quot;Mi&quot;} {
</del><ins>+    } elseif {$units eq &quot;Mi&quot;} {
</ins><span class="cx">         return &quot;MiB&quot;
</span><del>-    } elseif {$units == &quot;M&quot;} {
</del><ins>+    } elseif {$units eq &quot;M&quot;} {
</ins><span class="cx">         return &quot;MB&quot;
</span><del>-    } elseif {$units == &quot;Gi&quot;} {
</del><ins>+    } elseif {$units eq &quot;Gi&quot;} {
</ins><span class="cx">         return &quot;GiB&quot;
</span><del>-    } elseif {$units == &quot;G&quot;} {
</del><ins>+    } elseif {$units eq &quot;G&quot;} {
</ins><span class="cx">         return &quot;GB&quot;
</span><span class="cx">     } else {
</span><span class="cx">         return $units
</span><span class="lines">@@ -3388,17 +3388,17 @@
</span><span class="cx">             if { [llength $files] &gt; 0 } {
</span><span class="cx">                 foreach file $files {
</span><span class="cx">                     catch {
</span><del>-                        set space [expr $space + [file size $file] ]
</del><ins>+                        set space [expr {$space + [file size $file]}]
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><del>-                if {![info exists options(ports_space_total)] || $options(ports_space_total) != &quot;yes&quot;} {
</del><ins>+                if {![info exists options(ports_space_total)] || $options(ports_space_total) ne &quot;yes&quot;} {
</ins><span class="cx">                     set msg &quot;[bytesize $space $units] $portname&quot;
</span><span class="cx">                     if { $portversion != {} } {
</span><span class="cx">                         append msg &quot; @$portversion&quot;
</span><span class="cx">                     }
</span><span class="cx">                     puts $msg
</span><span class="cx">                 }
</span><del>-                set spaceall [expr $space + $spaceall]
</del><ins>+                set spaceall [expr {$space + $spaceall}]
</ins><span class="cx">             } else {
</span><span class="cx">                 puts stderr &quot;Port $portname does not contain any file or is not active.&quot;
</span><span class="cx">             }
</span><span class="lines">@@ -3406,7 +3406,7 @@
</span><span class="cx">             puts stderr &quot;Port $portname is not installed.&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {[llength $portlist] &gt; 1 || ([info exists options(ports_space_total)] &amp;&amp; $options(ports_space_total) == &quot;yes&quot;)} {
</del><ins>+    if {[llength $portlist] &gt; 1 || ([info exists options(ports_space_total)] &amp;&amp; $options(ports_space_total) eq &quot;yes&quot;)} {
</ins><span class="cx">         puts &quot;[bytesize $spaceall $units] total&quot;
</span><span class="cx">     }
</span><span class="cx">     return 0
</span><span class="lines">@@ -3535,7 +3535,7 @@
</span><span class="cx"> proc action_search { action portlist opts } {
</span><span class="cx">     global private_options global_options
</span><span class="cx">     set status 0
</span><del>-    if {![llength $portlist] &amp;&amp; [info exists private_options(ports_no_args)] &amp;&amp; $private_options(ports_no_args) == &quot;yes&quot;} {
</del><ins>+    if {![llength $portlist] &amp;&amp; [info exists private_options(ports_no_args)] &amp;&amp; $private_options(ports_no_args) eq &quot;yes&quot;} {
</ins><span class="cx">         ui_error &quot;You must specify a search pattern&quot;
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="lines">@@ -3543,7 +3543,7 @@
</span><span class="cx">     # Copy global options as we are going to modify the array
</span><span class="cx">     array set options [array get global_options]
</span><span class="cx"> 
</span><del>-    if {[info exists options(ports_search_depends)] &amp;&amp; $options(ports_search_depends) == &quot;yes&quot;} {
</del><ins>+    if {[info exists options(ports_search_depends)] &amp;&amp; $options(ports_search_depends) eq &quot;yes&quot;} {
</ins><span class="cx">         array unset options ports_search_depends
</span><span class="cx">         set options(ports_search_depends_fetch) yes
</span><span class="cx">         set options(ports_search_depends_extract) yes
</span><span class="lines">@@ -3560,7 +3560,7 @@
</span><span class="cx">     foreach { option } [array names options ports_search_*] {
</span><span class="cx">         set opt [string range $option 13 end]
</span><span class="cx"> 
</span><del>-        if { $options($option) != &quot;yes&quot; } {
</del><ins>+        if { $options($option) ne &quot;yes&quot; } {
</ins><span class="cx">             continue
</span><span class="cx">         }
</span><span class="cx">         switch -- $opt {
</span><span class="lines">@@ -3596,7 +3596,7 @@
</span><span class="cx"> 
</span><span class="cx">         set searchstring $portname
</span><span class="cx">         set matchstyle $filter_matchstyle
</span><del>-        if {$matchstyle == &quot;none&quot;} {
</del><ins>+        if {$matchstyle eq &quot;none&quot;} {
</ins><span class="cx">             # Guess if the given string was a glob expression, if not do a substring search
</span><span class="cx">             if {[string first &quot;*&quot; $portname] == -1 &amp;&amp; [string first &quot;?&quot; $portname] == -1} {
</span><span class="cx">                 set searchstring &quot;*$portname*&quot;
</span><span class="lines">@@ -3647,7 +3647,7 @@
</span><span class="cx">                 puts $portinfo(name)
</span><span class="cx">             } else {
</span><span class="cx">                 if {[info exists options(ports_search_line)]
</span><del>-                        &amp;&amp; $options(ports_search_line) == &quot;yes&quot;} {
</del><ins>+                        &amp;&amp; $options(ports_search_line) eq &quot;yes&quot;} {
</ins><span class="cx">                     # check for ports without category, e.g. replaced_by stubs
</span><span class="cx">                     if {[info exists portinfo(categories)]} {
</span><span class="cx">                         puts &quot;$portinfo(name)\t$portinfo(version)\t$portinfo(categories)\t$portinfo(description)&quot;
</span><span class="lines">@@ -3677,7 +3677,7 @@
</span><span class="cx">             ui_notice &quot;No match for $portname found&quot;
</span><span class="cx">         } elseif {[llength $res] &gt; 1} {
</span><span class="cx">             if {(![info exists global_options(ports_search_line)]
</span><del>-                    || $global_options(ports_search_line) != &quot;yes&quot;)} {
</del><ins>+                    || $global_options(ports_search_line) ne &quot;yes&quot;)} {
</ins><span class="cx">                 ui_notice &quot;\nFound [llength $res] ports.&quot;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -3697,12 +3697,12 @@
</span><span class="cx">     set status 0
</span><span class="cx">     
</span><span class="cx">     # Default to list all ports if no portnames are supplied
</span><del>-    if { ![llength $portlist] &amp;&amp; [info exists private_options(ports_no_args)] &amp;&amp; $private_options(ports_no_args) == &quot;yes&quot;} {
</del><ins>+    if { ![llength $portlist] &amp;&amp; [info exists private_options(ports_no_args)] &amp;&amp; $private_options(ports_no_args) eq &quot;yes&quot;} {
</ins><span class="cx">         add_to_portlist portlist [list name &quot;-all-&quot;]
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     foreachport $portlist {
</span><del>-        if {$portname == &quot;-all-&quot;} {
</del><ins>+        if {$portname eq &quot;-all-&quot;} {
</ins><span class="cx">            if {[catch {set res [mportlistall]} result]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;$errorInfo&quot;
</span><span class="lines">@@ -3740,13 +3740,13 @@
</span><span class="cx">         if {![macports::ui_isset ports_quiet]} {
</span><span class="cx">             set opts {}
</span><span class="cx">             foreach { key value } [array get options] {
</span><del>-                if ![info exists global_options($key)] {
</del><ins>+                if {![info exists global_options($key)]} {
</ins><span class="cx">                     lappend opts &quot;$key=$value&quot;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             set composite_version [composite_version $portversion [array get variations] 1]
</span><del>-            if { $composite_version != &quot;&quot; } {
</del><ins>+            if { $composite_version ne &quot;&quot; } {
</ins><span class="cx">                 set ver_field &quot;@$composite_version&quot;
</span><span class="cx">             } else {
</span><span class="cx">                 set ver_field &quot;&quot;
</span><span class="lines">@@ -3774,7 +3774,7 @@
</span><span class="cx">     foreachport $portlist {
</span><span class="cx">         array unset portinfo
</span><span class="cx">         # If we have a url, use that, since it's most specific, otherwise try to map the portname to a url
</span><del>-        if {$porturl == &quot;&quot;} {
</del><ins>+        if {$porturl eq &quot;&quot;} {
</ins><span class="cx">         
</span><span class="cx">             # Verify the portname, getting portinfo to map to a porturl
</span><span class="cx">             if {[catch {set res [mportlookup $portname]} result]} {
</span><span class="lines">@@ -3836,7 +3836,7 @@
</span><span class="cx">                     }
</span><span class="cx">                     
</span><span class="cx">                     # Use a reasonable canned default if no editor specified or set in env
</span><del>-                    if { $editor == &quot;&quot; } { set editor &quot;/usr/bin/vi&quot; }
</del><ins>+                    if { $editor eq &quot;&quot; } { set editor &quot;/usr/bin/vi&quot; }
</ins><span class="cx">                     
</span><span class="cx">                     # Invoke the editor
</span><span class="cx">                     if {[catch {eval exec &gt;@stdout &lt;@stdin 2&gt;@stderr $editor {$portfile}} result]} {
</span><span class="lines">@@ -3900,7 +3900,7 @@
</span><span class="cx">                     }
</span><span class="cx"> 
</span><span class="cx">                     # If not available, get the homepage for the port by opening the Portfile
</span><del>-                    if {$homepage == &quot;&quot; &amp;&amp; ![catch {set ctx [mportopen $porturl]} result]} {
</del><ins>+                    if {$homepage eq &quot;&quot; &amp;&amp; ![catch {set ctx [mportopen $porturl]} result]} {
</ins><span class="cx">                         array set portinfo [mportinfo $ctx]
</span><span class="cx">                         if {[info exists portinfo(homepage)]} {
</span><span class="cx">                             set homepage $portinfo(homepage)
</span><span class="lines">@@ -3909,7 +3909,7 @@
</span><span class="cx">                     }
</span><span class="cx"> 
</span><span class="cx">                     # Try to open a browser to the homepage for the given port
</span><del>-                    if { $homepage != &quot;&quot; } {
</del><ins>+                    if { $homepage ne &quot;&quot; } {
</ins><span class="cx">                         if {[catch {system &quot;${macports::autoconf::open_path} '$homepage'&quot;} result]} {
</span><span class="cx">                             global errorInfo
</span><span class="cx">                             ui_debug &quot;$errorInfo&quot;
</span><span class="lines">@@ -3950,14 +3950,14 @@
</span><span class="cx">     if {[require_portlist portlist]} {
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><del>-    if {($action == &quot;install&quot; || $action == &quot;archive&quot;) &amp;&amp; [prefix_unwritable] &amp;&amp; ![macports::global_option_isset ports_dryrun]} {
</del><ins>+    if {($action eq &quot;install&quot; || $action eq &quot;archive&quot;) &amp;&amp; [prefix_unwritable] &amp;&amp; ![macports::global_option_isset ports_dryrun]} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     foreachport $portlist {
</span><span class="cx">         array unset portinfo
</span><span class="cx">         # If we have a url, use that, since it's most specific
</span><span class="cx">         # otherwise try to map the portname to a url
</span><del>-        if {$porturl == &quot;&quot;} {
</del><ins>+        if {$porturl eq &quot;&quot;} {
</ins><span class="cx">             # Verify the portname, getting portinfo to map to a porturl
</span><span class="cx">             if {[catch {set res [mportlookup $portname]} result]} {
</span><span class="cx">                 global errorInfo
</span><span class="lines">@@ -3978,7 +3978,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         # use existing variants iff none were explicitly requested
</span><del>-        if {[array get requested_variations] == &quot;&quot; &amp;&amp; [array get variations] != &quot;&quot;} {
</del><ins>+        if {[array get requested_variations] eq &quot;&quot; &amp;&amp; [array get variations] ne &quot;&quot;} {
</ins><span class="cx">             array unset requested_variations
</span><span class="cx">             array set requested_variations [array get variations]
</span><span class="cx">         }
</span><span class="lines">@@ -3997,13 +3997,13 @@
</span><span class="cx">             set options(ports_version_glob) $portversion
</span><span class="cx">         }
</span><span class="cx">         # if installing, mark the port as explicitly requested
</span><del>-        if {$action == &quot;install&quot;} {
</del><ins>+        if {$action eq &quot;install&quot;} {
</ins><span class="cx">             if {![info exists options(ports_install_unrequested)]} {
</span><span class="cx">                 set options(ports_requested) 1
</span><span class="cx">             }
</span><span class="cx">             # we actually activate as well
</span><span class="cx">             set target activate
</span><del>-        } elseif {$action == &quot;archive&quot;} {
</del><ins>+        } elseif {$action eq &quot;archive&quot;} {
</ins><span class="cx">             set target install
</span><span class="cx">         } else {
</span><span class="cx">             set target $action
</span><span class="lines">@@ -4036,7 +4036,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if {$status == 0 &amp;&amp; $action == &quot;install&quot; &amp;&amp; ![macports::global_option_isset ports_dryrun]} {
</del><ins>+    if {$status == 0 &amp;&amp; $action eq &quot;install&quot; &amp;&amp; ![macports::global_option_isset ports_dryrun]} {
</ins><span class="cx">         array set options $opts
</span><span class="cx">         if {![info exists options(ports_nodeps)] &amp;&amp; ![info exists options(ports_install_no-rev-upgrade)] &amp;&amp; ${macports::revupgrade_autorun}} {
</span><span class="cx">             set status [action_revupgrade $action $portlist $opts]
</span><span class="lines">@@ -4343,9 +4343,9 @@
</span><span class="cx">     while {[moreargs]} {
</span><span class="cx">         set arg [lookahead]
</span><span class="cx">         
</span><del>-        if {[string index $arg 0] != &quot;-&quot;} {
</del><ins>+        if {[string index $arg 0] ne &quot;-&quot;} {
</ins><span class="cx">             break
</span><del>-        } elseif {[string index $arg 1] == &quot;-&quot;} {
</del><ins>+        } elseif {[string index $arg 1] eq &quot;-&quot;} {
</ins><span class="cx">             # Process long arguments
</span><span class="cx">             switch -- $arg {
</span><span class="cx">                 -- { # This is the options terminator; do no further option processing
</span><span class="lines">@@ -4363,8 +4363,8 @@
</span><span class="cx">                         }
</span><span class="cx">                         return -code error &quot;\&quot;port ${action} --${key}\&quot; is ambiguous: \n  port ${action} [join $errlst &quot;\n  port ${action} &quot;]&quot;
</span><span class="cx">                     }
</span><del>-                    set key   [lindex [lindex $kopts 0] 0]
-                    set kargc [lindex [lindex $kopts 0] 1]
</del><ins>+                    set key   [lindex $kopts 0 0]
+                    set kargc [lindex $kopts 0 1]
</ins><span class="cx">                     if {$kargc == 0} {
</span><span class="cx">                         set global_options(ports_${action}_${key}) yes
</span><span class="cx">                     } else {
</span><span class="lines">@@ -4372,10 +4372,10 @@
</span><span class="cx">                         while {[moreargs] &amp;&amp; $kargc &gt; 0} {
</span><span class="cx">                             advance
</span><span class="cx">                             lappend args [lookahead]
</span><del>-                            set kargc [expr $kargc - 1]
</del><ins>+                            set kargc [expr {$kargc - 1}]
</ins><span class="cx">                         }
</span><span class="cx">                         if {$kargc &gt; 0} {
</span><del>-                            return -code error &quot;--${key} expects [expr $kargc + [llength $args]] parameters!&quot;
</del><ins>+                            return -code error &quot;--${key} expects [expr {$kargc + [llength $args]}] parameters!&quot;
</ins><span class="cx">                         }
</span><span class="cx">                         set global_options(ports_${action}_${key}) $args
</span><span class="cx">                     }
</span><span class="lines">@@ -4647,7 +4647,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Decide how to do completion based on where we are in the string
</span><del>-    set prefix [string range $text 0 [expr $start - 1]]
</del><ins>+    set prefix [string range $text 0 $start-1]
</ins><span class="cx">     
</span><span class="cx">     # If only whitespace characters preceed us, or if the
</span><span class="cx">     # previous non-whitespace character was a ;, then we're
</span><span class="lines">@@ -4665,7 +4665,7 @@
</span><span class="cx">     upvar $linename line
</span><span class="cx">     
</span><span class="cx">     set line &quot;&quot;
</span><del>-    while { $line == &quot;&quot; } {
</del><ins>+    while { $line eq &quot;&quot; } {
</ins><span class="cx"> 
</span><span class="cx">         if {$use_readline} {
</span><span class="cx">             set len [readline read -attempted_completion attempt_completion line $prompt]
</span><span class="lines">@@ -4681,7 +4681,7 @@
</span><span class="cx">         
</span><span class="cx">         set line [string trim $line]
</span><span class="cx"> 
</span><del>-        if { $use_readline &amp;&amp; $line != &quot;&quot; } {
</del><ins>+        if { $use_readline &amp;&amp; $line ne &quot;&quot; } {
</ins><span class="cx">             rl_history add $line
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -4696,7 +4696,7 @@
</span><span class="cx">     # Initialize readline
</span><span class="cx">     set isstdin [string match $in &quot;stdin&quot;]
</span><span class="cx">     set name &quot;port&quot;
</span><del>-    set use_readline [expr $isstdin &amp;&amp; [readline init $name]]
</del><ins>+    set use_readline [expr {$isstdin &amp;&amp; [readline init $name]}]
</ins><span class="cx">     set history_file [file normalize &quot;${macports::macports_user_dir}/history&quot;]
</span><span class="cx"> 
</span><span class="cx">     # Read readline history
</span><span class="lines">@@ -4764,7 +4764,7 @@
</span><span class="cx">     # For each file in the command list, process commands
</span><span class="cx">     # in the file
</span><span class="cx">     foreach file $filelist {
</span><del>-        if {$file == &quot;-&quot;} {
</del><ins>+        if {$file eq &quot;-&quot;} {
</ins><span class="cx">             set in stdin
</span><span class="cx">         } else {
</span><span class="cx">             if {[catch {set in [open $file]} result]} {
</span><span class="lines">@@ -4774,7 +4774,7 @@
</span><span class="cx"> 
</span><span class="cx">         set exit_status [process_command_file $in]
</span><span class="cx"> 
</span><del>-        if {$in != &quot;stdin&quot;} {
</del><ins>+        if {$in ne &quot;stdin&quot;} {
</ins><span class="cx">             close $in
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -4823,7 +4823,7 @@
</span><span class="cx"> # If we've been invoked as portf, then the first argument is assumed
</span><span class="cx"> # to be the name of a command file (i.e., there is an implicit -F
</span><span class="cx"> # before any arguments).
</span><del>-if {[moreargs] &amp;&amp; $cmdname == &quot;portf&quot;} {
</del><ins>+if {[moreargs] &amp;&amp; $cmdname eq &quot;portf&quot;} {
</ins><span class="cx">     lappend ui_options(ports_commandfiles) [lookahead]
</span><span class="cx">     advance
</span><span class="cx"> }
</span><span class="lines">@@ -4842,7 +4842,7 @@
</span><span class="cx"> # interactive mode
</span><span class="cx"> if { [llength $remaining_args] == 0 &amp;&amp; ![info exists ui_options(ports_commandfiles)] } {
</span><span class="cx">     lappend ui_options(ports_commandfiles) -
</span><del>-} elseif {[lookahead] == &quot;selfupdate&quot; || [lookahead] == &quot;sync&quot;} {
</del><ins>+} elseif {[lookahead] eq &quot;selfupdate&quot; || [lookahead] eq &quot;sync&quot;} {
</ins><span class="cx">     # tell mportinit not to tell the user they should selfupdate
</span><span class="cx">     set ui_options(ports_no_old_index_warning) 1
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbasesrcportportindextcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port/portindex.tcl (116447 => 116448)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port/portindex.tcl        2014-01-25 16:49:02 UTC (rev 116447)
+++ trunk/base/src/port/portindex.tcl        2014-01-25 16:52:01 UTC (rev 116448)
</span><span class="lines">@@ -102,12 +102,12 @@
</span><span class="cx"> 
</span><span class="cx">         foreach availkey [array names portinfo] {
</span><span class="cx">             # store list of subports for top-level ports only
</span><del>-            if {![info exists keepkeys($availkey)] &amp;&amp; $availkey != &quot;subports&quot;} {
</del><ins>+            if {![info exists keepkeys($availkey)] &amp;&amp; $availkey ne &quot;subports&quot;} {
</ins><span class="cx">                 unset portinfo($availkey)
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         set output [array get portinfo]
</span><del>-        set len [expr [string length $output] + 1]
</del><ins>+        set len [expr {[string length $output] + 1}]
</ins><span class="cx">         puts $fd [list $portinfo(name) $len]
</span><span class="cx">         puts $fd $output
</span><span class="cx">         set mtime [file mtime [file join $directory $portdir Portfile]]
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">                 set output [array get portinfo]
</span><del>-                set len [expr [string length $output] + 1]
</del><ins>+                set len [expr {[string length $output] + 1}]
</ins><span class="cx">                 puts $fd [list $portinfo(name) $len]
</span><span class="cx">                 puts $fd $output
</span><span class="cx">             }
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if {[expr $argc &gt; 8]} {
</del><ins>+if {[expr {$argc &gt; 8}]} {
</ins><span class="cx">     print_usage
</span><span class="cx">     exit 1
</span><span class="cx"> }
</span><span class="lines">@@ -155,23 +155,23 @@
</span><span class="cx">     set arg [lindex $argv $i]
</span><span class="cx">     switch -regex -- $arg {
</span><span class="cx">         {^-.+} {
</span><del>-            if {$arg == &quot;-d&quot;} { # Turn on debug output
</del><ins>+            if {$arg eq &quot;-d&quot;} { # Turn on debug output
</ins><span class="cx">                 set ui_options(ports_debug) yes
</span><del>-            } elseif {$arg == &quot;-o&quot;} { # Set output directory
</del><ins>+            } elseif {$arg eq &quot;-o&quot;} { # Set output directory
</ins><span class="cx">                 incr i
</span><span class="cx">                 set outdir [file join [pwd] [lindex $argv $i]]
</span><del>-            } elseif {$arg == &quot;-p&quot;} { # Set platform
</del><ins>+            } elseif {$arg eq &quot;-p&quot;} { # Set platform
</ins><span class="cx">                 incr i
</span><span class="cx">                 set platlist [split [lindex $argv $i] _]
</span><span class="cx">                 set os_platform [lindex $platlist 0]
</span><span class="cx">                 set os_major [lindex $platlist 1]
</span><span class="cx">                 set os_arch [lindex $platlist 2]
</span><del>-                if {$os_platform == &quot;macosx&quot;} {
</del><ins>+                if {$os_platform eq &quot;macosx&quot;} {
</ins><span class="cx">                     lappend port_options os.subplatform $os_platform os.universal_supported yes
</span><span class="cx">                     set os_platform darwin
</span><span class="cx">                 }
</span><span class="cx">                 lappend port_options os.platform $os_platform os.major $os_major os.arch $os_arch
</span><del>-            } elseif {$arg == &quot;-f&quot;} { # Completely rebuild index
</del><ins>+            } elseif {$arg eq &quot;-f&quot;} { # Completely rebuild index
</ins><span class="cx">                 set full_reindex 1
</span><span class="cx">             } else {
</span><span class="cx">                 puts stderr &quot;Unknown option: $arg&quot;
</span><span class="lines">@@ -249,6 +249,6 @@
</span><span class="cx"> file mtime $outpath $newest
</span><span class="cx"> mports_generate_quickindex $outpath
</span><span class="cx"> puts &quot;\nTotal number of ports parsed:\t$stats(total)\
</span><del>-      \nPorts successfully parsed:\t[expr $stats(total) - $stats(failed)]\
</del><ins>+      \nPorts successfully parsed:\t[expr {$stats(total) - $stats(failed)}]\
</ins><span class="cx">       \nPorts failed:\t\t\t$stats(failed)\
</span><span class="cx">       \nUp-to-date ports skipped:\t$stats(skipped)\n&quot;
</span></span></pre></div>
<a id="trunkbasesrcportportmirrortcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port/portmirror.tcl (116447 => 116448)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port/portmirror.tcl        2014-01-25 16:49:02 UTC (rev 116447)
+++ trunk/base/src/port/portmirror.tcl        2014-01-25 16:52:01 UTC (rev 116448)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">     puts &quot;Usage: $argv0&quot;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if {[expr $argc &gt; 0]} {
</del><ins>+if {[expr {$argc &gt; 0}]} {
</ins><span class="cx">     print_usage
</span><span class="cx">     exit 1
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>