<!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>[116450] trunk/base/src/registry2.0</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/116450">116450</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2014-01-25 08:59:12 -0800 (Sat, 25 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>registry2.0: Tcl cleanup, from a patch by Gustaf Neumann
 - removed numeric comparisons where not necessary
 - braced expressions to allow for bytecode compilation
 - removed unneeded calls to expr</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasesrcregistry20portimagetcl">trunk/base/src/registry2.0/portimage.tcl</a></li>
<li><a href="#trunkbasesrcregistry20portuninstalltcl">trunk/base/src/registry2.0/portuninstall.tcl</a></li>
<li><a href="#trunkbasesrcregistry20receipt_flattcl">trunk/base/src/registry2.0/receipt_flat.tcl</a></li>
<li><a href="#trunkbasesrcregistry20receipt_sqlitetcl">trunk/base/src/registry2.0/receipt_sqlite.tcl</a></li>
<li><a href="#trunkbasesrcregistry20registrytcl">trunk/base/src/registry2.0/registry.tcl</a></li>
<li><a href="#trunkbasesrcregistry20registry_utiltcl">trunk/base/src/registry2.0/registry_util.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbasesrcregistry20portimagetcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/portimage.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/portimage.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/portimage.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> # takes a composite version spec rather than separate version,revision,variants
</span><span class="cx"> proc activate_composite {name {v &quot;&quot;} {optionslist &quot;&quot;}} {
</span><del>-    if {$v == &quot;&quot;} {
</del><ins>+    if {$v eq &quot;&quot;} {
</ins><span class="cx">         return [activate $name &quot;&quot; &quot;&quot; 0 $optionslist]
</span><span class="cx">     } elseif {[registry::decode_spec $v version revision variants]} {
</span><span class="cx">         return [activate $name $version $revision $variants $optionslist]
</span><span class="lines">@@ -107,19 +107,19 @@
</span><span class="cx">         # if another version of this port is active, deactivate it first
</span><span class="cx">         set current [registry::entry installed $name]
</span><span class="cx">         foreach i $current {
</span><del>-            if { ![string equal $specifier &quot;[$i version]_[$i revision][$i variants]&quot;] } {
</del><ins>+            if { $specifier ne &quot;[$i version]_[$i revision][$i variants]&quot; } {
</ins><span class="cx">                 lappend todeactivate $i
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         # this shouldn't be possible
</span><del>-        if { ![string equal [$requested installtype] &quot;image&quot;] } {
</del><ins>+        if { [$requested installtype] ne &quot;image&quot; } {
</ins><span class="cx">             return -code error &quot;Image error: ${name} @${specifier} not installed as an image.&quot;
</span><span class="cx">         }
</span><span class="cx">         if {![::file isfile $location]} {
</span><span class="cx">             return -code error &quot;Image error: Can't find image file $location&quot;
</span><span class="cx">         }
</span><del>-        if { [string equal [$requested state] &quot;installed&quot;] } {
</del><ins>+        if {[$requested state] eq &quot;installed&quot;} {
</ins><span class="cx">             return -code error &quot;Image error: ${name} @${specifier} is already active.&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx"> 
</span><span class="cx"> # takes a composite version spec rather than separate version,revision,variants
</span><span class="cx"> proc deactivate_composite {name {v &quot;&quot;} {optionslist &quot;&quot;}} {
</span><del>-    if {$v == &quot;&quot;} {
</del><ins>+    if {$v eq &quot;&quot;} {
</ins><span class="cx">         return [deactivate $name &quot;&quot; &quot;&quot; 0 $optionslist]
</span><span class="cx">     } elseif {[registry::decode_spec $v version revision variants]} {
</span><span class="cx">         return [deactivate $name $version $revision $variants $optionslist]
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">         set registry_open yes
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if { [string equal $name &quot;&quot;] } {
</del><ins>+    if {$name eq &quot;&quot;} {
</ins><span class="cx">         throw registry::image-error &quot;Registry error: Please specify the name of the port.&quot;
</span><span class="cx">     }
</span><span class="cx">     set ilist [registry::entry installed $name]
</span><span class="lines">@@ -175,10 +175,10 @@
</span><span class="cx">     set name [$requested name]
</span><span class="cx">     set specifier &quot;[$requested version]_[$requested revision][$requested variants]&quot;
</span><span class="cx"> 
</span><del>-    if {$version != &quot;&quot; &amp;&amp; ($version != [$requested version] ||
-        ($revision != &quot;&quot; &amp;&amp; ($revision != [$requested revision] || $variants != [$requested variants])))} {
</del><ins>+    if {$version ne &quot;&quot; &amp;&amp; ($version != [$requested version] ||
+        ($revision ne &quot;&quot; &amp;&amp; ($revision != [$requested revision] || $variants != [$requested variants])))} {
</ins><span class="cx">         set v $version
</span><del>-        if {$revision != &quot;&quot;} {
</del><ins>+        if {$revision ne &quot;&quot;} {
</ins><span class="cx">             append v _${revision}${variants}
</span><span class="cx">         }
</span><span class="cx">         return -code error &quot;Active version of $name is not $v but ${specifier}.&quot;
</span><span class="lines">@@ -186,11 +186,11 @@
</span><span class="cx"> 
</span><span class="cx">     ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Deactivating %s @%s&quot;] $name $specifier]&quot;
</span><span class="cx"> 
</span><del>-    if { ![string equal [$requested installtype] &quot;image&quot;] } {
</del><ins>+    if { [$requested installtype] ne &quot;image&quot; } {
</ins><span class="cx">         return -code error &quot;Image error: ${name} @${specifier} not installed as an image.&quot;
</span><span class="cx">     }
</span><span class="cx">     # this shouldn't be possible
</span><del>-    if { [$requested state] != &quot;installed&quot; } {
</del><ins>+    if { [$requested state] ne &quot;installed&quot; } {
</ins><span class="cx">         return -code error &quot;Image error: ${name} @${specifier} is not active.&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -207,12 +207,12 @@
</span><span class="cx"> 
</span><span class="cx">     set searchkeys $name
</span><span class="cx">     set composite_spec &quot;&quot;
</span><del>-    if {$version != &quot;&quot;} {
</del><ins>+    if {$version ne &quot;&quot;} {
</ins><span class="cx">         lappend searchkeys $version
</span><span class="cx">         set composite_spec $version
</span><span class="cx">         # restriction imposed by underlying registry API (see entry.c):
</span><span class="cx">         # if a revision is specified, so must variants be
</span><del>-        if {$revision != &quot;&quot;} {
</del><ins>+        if {$revision ne &quot;&quot;} {
</ins><span class="cx">             lappend searchkeys $revision $variants
</span><span class="cx">             append composite_spec _${revision}${variants}
</span><span class="cx">         }
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">             set iversion [$i version]
</span><span class="cx">             set irevision [$i revision]
</span><span class="cx">             set ivariants [$i variants]
</span><del>-            if { [$i state] == &quot;installed&quot; } {
</del><ins>+            if { [$i state] eq &quot;installed&quot; } {
</ins><span class="cx">                 ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s (active)&quot;] $iname $iversion $irevision $ivariants]&quot;
</span><span class="cx">             } else {
</span><span class="cx">                 ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s&quot;] $iname $iversion $irevision $ivariants]&quot;
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">     } elseif { [llength $ilist] == 1 } {
</span><span class="cx">         return [lindex $ilist 0]
</span><span class="cx">     }
</span><del>-    if {$composite_spec != &quot;&quot;} {
</del><ins>+    if {$composite_spec ne &quot;&quot;} {
</ins><span class="cx">         set composite_spec &quot; @${composite_spec}&quot;
</span><span class="cx">     }
</span><span class="cx">     throw registry::invalid &quot;Registry error: ${name}${composite_spec} is not installed.&quot;
</span><span class="lines">@@ -469,7 +469,7 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if {$owner != &quot;replaced&quot;} {
</del><ins>+                if {$owner ne &quot;replaced&quot;} {
</ins><span class="cx">                     if { [string is true -strict $force] } {
</span><span class="cx">                         # if we're forcing the activation, then we move any existing
</span><span class="cx">                         # files to a backup file, both in the filesystem and in the
</span><span class="lines">@@ -559,7 +559,7 @@
</span><span class="cx">         }
</span><span class="cx">         # reactivate deactivated ports
</span><span class="cx">         foreach entry [array names todeactivate] {
</span><del>-            if {[$entry state] == &quot;imaged&quot; &amp;&amp; ($noexec || ![registry::run_target $entry activate &quot;&quot;])} {
</del><ins>+            if {[$entry state] eq &quot;imaged&quot; &amp;&amp; ($noexec || ![registry::run_target $entry activate &quot;&quot;])} {
</ins><span class="cx">                 activate [$entry name] [$entry version] [$entry revision] [$entry variants] [list ports_activate_no-exec $noexec]
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -580,10 +580,10 @@
</span><span class="cx">         ui_debug &quot;$dstfile does not exist&quot;
</span><span class="cx">         return
</span><span class="cx">     }
</span><del>-    if { $filetype == &quot;link&quot; } {
</del><ins>+    if { $filetype eq &quot;link&quot; } {
</ins><span class="cx">         ui_debug &quot;deactivating link: $dstfile&quot;
</span><span class="cx">         file delete -- $dstfile
</span><del>-    } elseif { $filetype == &quot;directory&quot; } {
</del><ins>+    } elseif { $filetype eq &quot;directory&quot; } {
</ins><span class="cx">         # 0 item means empty.
</span><span class="cx">         if { [llength [readdir $dstfile]] == 0 } {
</span><span class="cx">             variable precious_dirs
</span><span class="lines">@@ -606,7 +606,7 @@
</span><span class="cx">     set files [list]
</span><span class="cx"> 
</span><span class="cx">     foreach file $imagefiles {
</span><del>-        if { [::file exists $file] || (![catch {::file type $file}] &amp;&amp; [::file type $file] == &quot;link&quot;) } {
</del><ins>+        if { [::file exists $file] || (![catch {::file type $file}] &amp;&amp; [::file type $file] eq &quot;link&quot;) } {
</ins><span class="cx">             # Normalize the file path to avoid removing the intermediate
</span><span class="cx">             # symlinks (remove the empty directories instead)
</span><span class="cx">             # Remark: paths in the registry may be not normalized.
</span></span></pre></div>
<a id="trunkbasesrcregistry20portuninstalltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/portuninstall.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/portuninstall.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/portuninstall.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> # takes a composite version spec rather than separate version,revision,variants
</span><span class="cx"> proc uninstall_composite {portname {v &quot;&quot;} {optionslist &quot;&quot;}} {
</span><del>-    if {$v == &quot;&quot;} {
</del><ins>+    if {$v eq &quot;&quot;} {
</ins><span class="cx">         return [uninstall $portname &quot;&quot; &quot;&quot; 0 $optionslist]
</span><span class="cx">     } elseif {[registry::decode_spec $v version revision variants]} {
</span><span class="cx">         return [uninstall $portname $version $revision $variants $optionslist]
</span><span class="lines">@@ -75,12 +75,12 @@
</span><span class="cx"> 
</span><span class="cx">     set searchkeys $portname
</span><span class="cx">     set composite_spec &quot;&quot;
</span><del>-    if {$version != &quot;&quot;} {
</del><ins>+    if {$version ne &quot;&quot;} {
</ins><span class="cx">         lappend searchkeys $version
</span><span class="cx">         set composite_spec $version
</span><span class="cx">         # restriction imposed by underlying registry API (see entry.c):
</span><span class="cx">         # if a revision is specified, so must variants be
</span><del>-        if {$revision != &quot;&quot;} {
</del><ins>+        if {$revision ne &quot;&quot;} {
</ins><span class="cx">             lappend searchkeys $revision $variants
</span><span class="cx">             append composite_spec _${revision}${variants}
</span><span class="cx">         }
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">         ui_msg &quot;$UI_PREFIX [msgcat::mc &quot;The following versions of $portname are currently installed:&quot;]&quot;
</span><span class="cx">         foreach i [portlist_sortint $ilist] {
</span><span class="cx">             set ispec &quot;[$i version]_[$i revision][$i variants]&quot;
</span><del>-            if { [string equal [$i state] installed] } {
</del><ins>+            if {[$i state] eq &quot;installed&quot;} {
</ins><span class="cx">                 ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s (active)&quot;] [$i name] $ispec]&quot;
</span><span class="cx">             } else {
</span><span class="cx">                 ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s&quot;] [$i name] $ispec]&quot;
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         set variants [$port variants]
</span><span class="cx">         set composite_spec &quot;${version}_${revision}${variants}&quot;
</span><span class="cx">     } else {
</span><del>-        if {$composite_spec != &quot;&quot;} {
</del><ins>+        if {$composite_spec ne &quot;&quot;} {
</ins><span class="cx">             set composite_spec &quot; @${composite_spec}&quot;
</span><span class="cx">         }
</span><span class="cx">         throw registry::invalid &quot;Registry error: ${portname}${composite_spec} not registered as installed&quot;
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">         }
</span><span class="cx">         foreach depport [$port dependents] {
</span><span class="cx">             # make sure it's still installed, since a previous dep uninstall may have removed it
</span><del>-            if {[registry::entry exists $depport] &amp;&amp; ([$depport state] == &quot;imaged&quot; || [$depport state] == &quot;installed&quot;)} {
</del><ins>+            if {[registry::entry exists $depport] &amp;&amp; ([$depport state] eq &quot;imaged&quot; || [$depport state] eq &quot;installed&quot;)} {
</ins><span class="cx">                 if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $depport uninstall $optionslist]} {
</span><span class="cx">                     registry_uninstall::uninstall [$depport name] [$depport version] [$depport revision] [$depport variants] $optionslist
</span><span class="cx">                 }
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">         registry::check_dependents $port ${uninstall.force} &quot;uninstall&quot;
</span><span class="cx">     }
</span><span class="cx">     # if it's active, deactivate it
</span><del>-    if { [string equal [$port state] installed] } {
</del><ins>+    if {[$port state] eq &quot;installed&quot;} {
</ins><span class="cx">         if {[info exists options(ports_dryrun)] &amp;&amp; [string is true -strict $options(ports_dryrun)]} {
</span><span class="cx">             ui_msg &quot;For $portname @${composite_spec}: skipping deactivate (dry run)&quot;
</span><span class="cx">         } else {
</span></span></pre></div>
<a id="trunkbasesrcregistry20receipt_flattcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/receipt_flat.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/receipt_flat.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/receipt_flat.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Might as well bail out early if no file to match
</span><del>-    if {![string length $matchfile]} {
</del><ins>+    if {$matchfile eq &quot;&quot;} {
</ins><span class="cx">                 return &quot;&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -117,8 +117,8 @@
</span><span class="cx">         if { ![::file isdirectory $receipt_path] } {
</span><span class="cx">                 set receipt_file [get_head_entry_receipt_path $name $version]
</span><span class="cx">                 
</span><del>-                if {![string length $receipt_file]} {
-                        if { $version != &quot;&quot; } {
</del><ins>+                if {$receipt_file eq &quot;&quot;} {
+                        if { $version ne &quot;&quot; } {
</ins><span class="cx">                                 return -code error &quot;Registry error: ${name} @${version}_${revision}${variants} not registered as installed.&quot;
</span><span class="cx">                         } else {
</span><span class="cx">                                 return -code error &quot;Registry error: ${name} not registered as installed.&quot;
</span><span class="lines">@@ -126,13 +126,13 @@
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 # Extract the version from the path.
</span><del>-                if { $version == &quot;&quot; } {
</del><ins>+                if { $version eq &quot;&quot; } {
</ins><span class="cx">                         set theFileName [::file tail $receipt_file]
</span><span class="cx">                         regexp &quot;^$name-(.*)\$&quot; $theFileName match version
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 # If version wasn't specified, find out the version number.
</span><del>-                if { $version == &quot;&quot; } {
</del><ins>+                if { $version eq &quot;&quot; } {
</ins><span class="cx">                         # xxx: We really should have had the 
</span><span class="cx">                         # version given to us.  How should we handle this?
</span><span class="cx">                         set x [glob -nocomplain -directory ${receipt_path} *]
</span><span class="lines">@@ -451,9 +451,9 @@
</span><span class="cx"> 
</span><span class="cx">         set query_path [::file join ${macports::registry.path} receipts]
</span><span class="cx">         
</span><del>-        if { $name == &quot;&quot; } {
</del><ins>+        if { $name eq &quot;&quot; } {
</ins><span class="cx">                 set query_path [::file join ${query_path} *]
</span><del>-                if { $version == &quot;&quot; } {
</del><ins>+                if { $version eq &quot;&quot; } {
</ins><span class="cx">                         set query_path [::file join ${query_path} *]
</span><span class="cx">                 }
</span><span class="cx">                 # [PG] Huh?
</span><span class="lines">@@ -472,7 +472,7 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">                 set query_path [::file join ${query_path} ${name}]
</span><del>-                if { $version != &quot;&quot; } {
</del><ins>+                if { $version ne &quot;&quot; } {
</ins><span class="cx">                         set query_path [::file join ${query_path} ${version}]
</span><span class="cx">                 } else {
</span><span class="cx">                         set query_path [::file join ${query_path} *]
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         # append the ports in old HEAD format.
</span><del>-        if { $name == &quot;&quot; } {
</del><ins>+        if { $name eq &quot;&quot; } {
</ins><span class="cx">                 set query_path [::file join ${macports::registry.path} receipts *]
</span><span class="cx">         } else {
</span><span class="cx">                 set query_path [::file join ${macports::registry.path} receipts ${name}-*]
</span><span class="lines">@@ -506,7 +506,7 @@
</span><span class="cx"> 
</span><span class="cx">             # Remark: these regexes do not always work.
</span><span class="cx">                    set theName &quot;&quot;
</span><del>-            if { $name == &quot;&quot; } {
</del><ins>+            if { $name eq &quot;&quot; } {
</ins><span class="cx">                         regexp {^(.*)-(.*)$} $theFileName match theName version
</span><span class="cx">             } else {
</span><span class="cx">                         regexp &quot;^($name)-(.*)\$&quot; $theFileName match theName version
</span><span class="lines">@@ -662,7 +662,7 @@
</span><span class="cx"> 
</span><span class="cx">         open_file_map
</span><span class="cx"> 
</span><del>-        if { [::file type $file] == &quot;link&quot; } {
</del><ins>+        if { [::file type $file] eq &quot;link&quot; } {
</ins><span class="cx">                 ui_debug &quot;Adding link to file_map: $file for: $port&quot;
</span><span class="cx">         } else {
</span><span class="cx">                 ui_debug &quot;Adding file to file_map: $file for: $port&quot;
</span><span class="lines">@@ -684,7 +684,7 @@
</span><span class="cx"> 
</span><span class="cx">         foreach f $files {
</span><span class="cx">                 set file [lindex $f 0]
</span><del>-                if { [::file type $file] == &quot;link&quot; } {
</del><ins>+                if { [::file type $file] eq &quot;link&quot; } {
</ins><span class="cx">                         ui_debug &quot;Adding link to file_map: $file for: $port&quot;
</span><span class="cx">                 } else {
</span><span class="cx">                         ui_debug &quot;Adding file to file_map: $file for: $port&quot;
</span><span class="lines">@@ -828,7 +828,7 @@
</span><span class="cx">     set dep_map $new_map
</span><span class="cx">     
</span><span class="cx">     set newlen [llength $dep_map]
</span><del>-    set diff [expr $oldlen - $newlen]
</del><ins>+    set diff [expr {$oldlen - $newlen}]
</ins><span class="cx">     ui_debug &quot;New dep_map has $newlen entries&quot;
</span><span class="cx">     ui_info &quot;Removed $diff duplicate entries from the dependency map&quot;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbasesrcregistry20receipt_sqlitetcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/receipt_sqlite.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/receipt_sqlite.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/receipt_sqlite.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> # return list of active ports, or active version of port 'name' if specified
</span><span class="cx"> proc active {name} {
</span><del>-    if {$name != &quot;&quot;} {
</del><ins>+    if {$name ne &quot;&quot;} {
</ins><span class="cx">         set ports [registry::entry installed $name]
</span><span class="cx">     } else {
</span><span class="cx">         set ports [registry::entry installed]
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> #
</span><span class="cx"> proc file_registered {file} {
</span><span class="cx">     set port [registry::entry owner $file]
</span><del>-        if {$port != &quot;&quot;} {
</del><ins>+        if {$port ne &quot;&quot;} {
</ins><span class="cx">                 return [$port name]
</span><span class="cx">         } else {
</span><span class="cx">                 return 0
</span><span class="lines">@@ -164,9 +164,9 @@
</span><span class="cx"> # version for example, so we don't attempt to split up the composite version
</span><span class="cx"> # into its components, we just compare the whole thing.
</span><span class="cx"> proc installed {{name &quot;&quot;} {version &quot;&quot;}} {
</span><del>-        if { $name == &quot;&quot; &amp;&amp; $version == &quot;&quot; } {
</del><ins>+        if { $name eq &quot;&quot; &amp;&amp; $version eq &quot;&quot; } {
</ins><span class="cx">             set ports [registry::entry imaged]
</span><del>-        } elseif { $name != &quot;&quot; &amp;&amp; $version == &quot;&quot;} {
</del><ins>+        } elseif { $name ne &quot;&quot; &amp;&amp; $version eq &quot;&quot;} {
</ins><span class="cx">             set ports [registry::entry imaged $name]
</span><span class="cx">         } else {
</span><span class="cx">             set ports {}
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">         set rlist [list]
</span><span class="cx">         set searchcmd &quot;registry::entry search&quot;
</span><span class="cx">     foreach key {name version revision} {
</span><del>-        if {[set $key] != &quot;&quot;} {
</del><ins>+        if {[set $key] ne &quot;&quot;} {
</ins><span class="cx">             append searchcmd &quot; $key [set $key]&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx">         set rlist [list]
</span><span class="cx">         set searchcmd &quot;registry::entry search&quot;
</span><span class="cx">     foreach key {name version revision} {
</span><del>-        if {[set $key] != &quot;&quot;} {
</del><ins>+        if {[set $key] ne &quot;&quot;} {
</ins><span class="cx">             append searchcmd &quot; $key [set $key]&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -251,9 +251,9 @@
</span><span class="cx">         $regref location $props(location)
</span><span class="cx">         $regref state $props(state)
</span><span class="cx">         $regref installtype $props(installtype)
</span><del>-        if {$props(installtype) == &quot;image&quot;} {
</del><ins>+        if {$props(installtype) eq &quot;image&quot;} {
</ins><span class="cx">             $regref map $props(imagefiles)
</span><del>-            if {$props(state) == &quot;installed&quot;} {
</del><ins>+            if {$props(state) eq &quot;installed&quot;} {
</ins><span class="cx">                 if {[llength $props(imagefiles)] != [llength $props(files)]} {
</span><span class="cx">                     # deal with this mess, just drop the extras...
</span><span class="cx">                     set i 0
</span></span></pre></div>
<a id="trunkbasesrcregistry20registrytcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/registry.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/registry.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/registry.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -156,10 +156,10 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if { [llength $rlist] &lt; 1 } {
</span><del>-        if { $name == &quot;&quot; } {
</del><ins>+        if { $name eq &quot;&quot; } {
</ins><span class="cx">             return -code error &quot;Registry error: No ports registered as installed.&quot;
</span><span class="cx">         } else {
</span><del>-            if { $version == &quot;&quot; } {
</del><ins>+            if { $version eq &quot;&quot; } {
</ins><span class="cx">                 return -code error &quot;Registry error: $name not registered as installed.&quot;
</span><span class="cx">             } else {
</span><span class="cx">                 return -code error &quot;Registry error: $name $version not registered as installed.&quot;
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">         if { [llength $rlist] &lt; 1 } {
</span><del>-                if { $name == &quot;&quot; } {
</del><ins>+                if { $name eq &quot;&quot; } {
</ins><span class="cx">                         return -code error &quot;Registry error: No ports registered as active.&quot;
</span><span class="cx">                 } else {
</span><span class="cx">                         return -code error &quot;Registry error: $name not registered as installed &amp; active.&quot;
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">     # (we won't store the md5 of the target of links since it's meaningless
</span><span class="cx">     # and $statvar(mode) tells us that links are links).
</span><span class="cx">     if {![catch {file lstat $fname statvar}]} {
</span><del>-        if {[::file isfile $fname] &amp;&amp; [::file type $fname] != &quot;link&quot;} {
</del><ins>+        if {[::file isfile $fname] &amp;&amp; [::file type $fname] ne &quot;link&quot;} {
</ins><span class="cx">             if {[catch {md5 file $fname} md5sum] == 0} {
</span><span class="cx">                 # Create a line that matches md5(1)'s output
</span><span class="cx">                 # for backwards compatibility
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> 
</span><span class="cx">         set rval [list]
</span><span class="cx">         foreach file $flist {
</span><del>-                if {[string index $file 0] != &quot;/&quot;} {
</del><ins>+                if {[string index $file 0] ne &quot;/&quot;} {
</ins><span class="cx">                         set file [::file join $prefix $file]
</span><span class="cx">                 }
</span><span class="cx">                 lappend rval [fileinfo_for_file $file]
</span><span class="lines">@@ -405,10 +405,10 @@
</span><span class="cx">         set lockfd [::open $lockpath w]
</span><span class="cx">     }
</span><span class="cx">     if {[catch {flock $lockfd -exclusive -noblock} result]} {
</span><del>-        if {$result == &quot;EAGAIN&quot;} {
</del><ins>+        if {$result eq &quot;EAGAIN&quot;} {
</ins><span class="cx">             ui_msg &quot;Waiting for lock on $lockpath&quot;
</span><span class="cx">             flock $lockfd -exclusive
</span><del>-        } elseif {$result == &quot;EOPNOTSUPP&quot;} {
</del><ins>+        } elseif {$result eq &quot;EOPNOTSUPP&quot;} {
</ins><span class="cx">             # Locking not supported, just return
</span><span class="cx">             ui_debug &quot;flock not supported, not locking registry&quot;
</span><span class="cx">         } else {
</span><span class="lines">@@ -466,7 +466,7 @@
</span><span class="cx">         foreach f $contents {
</span><span class="cx">             set fullpath [lindex $f 0]
</span><span class="cx">             # strip image dir from start
</span><del>-            if {[string range $fullpath 0 [expr $idlen - 1]] == $location} {
</del><ins>+            if {[string range $fullpath 0 $idlen-1] == $location} {
</ins><span class="cx">                 set path [string range $fullpath $idlen [string length $fullpath]]
</span><span class="cx">             } else {
</span><span class="cx">                 set path $fullpath
</span></span></pre></div>
<a id="trunkbasesrcregistry20registry_utiltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/registry_util.tcl (116449 => 116450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/registry_util.tcl        2014-01-25 16:57:17 UTC (rev 116449)
+++ trunk/base/src/registry2.0/registry_util.tcl        2014-01-25 16:59:12 UTC (rev 116450)
</span><span class="lines">@@ -63,14 +63,14 @@
</span><span class="cx"> ## @param [in] force if true, continue even if there are dependents
</span><span class="cx"> proc check_dependents {port force {action &quot;uninstall/deactivate&quot;}} {
</span><span class="cx">     global UI_PREFIX
</span><del>-    if {[$port state] == &quot;installed&quot; || [llength [registry::entry imaged [$port name]]] == 1} {
</del><ins>+    if {[$port state] eq &quot;installed&quot; || [llength [registry::entry imaged [$port name]]] == 1} {
</ins><span class="cx">         # Check if any installed ports depend on this one
</span><span class="cx">         set deplist [$port dependents]
</span><del>-        if {$action == &quot;deactivate&quot;} {
</del><ins>+        if {$action eq &quot;deactivate&quot;} {
</ins><span class="cx">             set active_deplist {}
</span><span class="cx">             # Check if any active ports depend on this one
</span><span class="cx">             foreach p $deplist {
</span><del>-                if {[$p state] == &quot;installed&quot;} {
</del><ins>+                if {[$p state] eq &quot;installed&quot;} {
</ins><span class="cx">                     lappend active_deplist $p
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> ## @return   true if successful, false otherwise
</span><span class="cx"> proc run_target {port target options} {
</span><span class="cx">     set portspec &quot;[$port name] @[$port version]_[$port revision][$port variants]&quot;
</span><del>-    if {[$port portfile] == &quot;&quot;} {
</del><ins>+    if {[$port portfile] eq &quot;&quot;} {
</ins><span class="cx">         ui_debug &quot;no portfile in registry for $portspec&quot;
</span><span class="cx">         return 0
</span><span class="cx">     }
</span><span class="lines">@@ -107,12 +107,12 @@
</span><span class="cx">             ui_warn &quot;Failed to execute portfile from registry for $portspec&quot;
</span><span class="cx">             switch $target {
</span><span class="cx">                 activate {
</span><del>-                    if {[$port state] == &quot;installed&quot;} {
</del><ins>+                    if {[$port state] eq &quot;installed&quot;} {
</ins><span class="cx">                         return 1
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">                 deactivate {
</span><del>-                    if {[$port state] == &quot;imaged&quot;} {
</del><ins>+                    if {[$port state] eq &quot;imaged&quot;} {
</ins><span class="cx">                         return 1
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             global macports::keeplogs
</span><del>-            if {(![info exists keeplogs] || !$keeplogs) &amp;&amp; $target != &quot;activate&quot;} {
</del><ins>+            if {(![info exists keeplogs] || !$keeplogs) &amp;&amp; $target ne &quot;activate&quot;} {
</ins><span class="cx">                 catch {mportexec $mport clean}
</span><span class="cx">             }
</span><span class="cx">             mportclose_installed $mport
</span></span></pre>
</div>
</div>

</body>
</html>