No subject


Sun Dec 8 17:39:16 PST 2013


Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/macports1.0/macports_dlist.tcl
    trunk/base/src/macports1.0/macports_util.tcl
    trunk/base/src/macports1.0/tests/test.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/base/src/macports1.0/macports.tcl	2014-01-25 16:44:00 UTC (rev =
116444)
+++ trunk/base/src/macports1.0/macports.tcl	2014-01-25 16:46:33 UTC (rev =
116445)
@@ -1536,7 +1536,7 @@
     set protocol [macports::getprotocol $url]
     switch -- $protocol {
         file {
-            set path [file normalize [string range $url [expr {[string l=
ength $protocol] + 3}] end]]
+            set path [file normalize [string range $url [string length $=
protocol]+3 end]]
             if {![file isfile $path]} {
                 # the URL points to a local directory
                 return $path
@@ -2653,7 +2653,7 @@
                             } else {
                                 set compres [string compare -nocase $pat=
tern $target]
                             }
-                            set matchres [expr 0 =3D=3D $compres]
+                            set matchres [expr {0 =3D=3D $compres}]
                         }
                         glob {
                             if {$case_sensitive eq yes} {
@@ -4012,7 +4012,7 @@
         # we have to force the uninstall in case of dependents
         set force_cur [info exists options(ports_force)]
         set options(ports_force) yes
-        set existing_epoch [lindex [lindex [registry::installed $newname=
 ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variant=
s)] 0] 5]
+        set existing_epoch [lindex [registry::installed $newname ${versi=
on_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)] 0 5]
         set newregref [registry::open_entry $newname $version_in_tree $r=
evision_in_tree $portinfo(canonical_active_variants) $existing_epoch]
         if {$is_dryrun eq {yes}} {
             ui_msg "Skipping uninstall $newname @${version_in_tree}_${re=
vision_in_tree}$portinfo(canonical_active_variants) (dry run)"

Modified: trunk/base/src/macports1.0/macports_dlist.tcl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/base/src/macports1.0/macports_dlist.tcl	2014-01-25 16:44:00 UTC=
 (rev 116444)
+++ trunk/base/src/macports1.0/macports_dlist.tcl	2014-01-25 16:46:33 UTC=
 (rev 116445)
@@ -292,7 +292,7 @@
 =09
 	# Do a pre-run seeing if any items automagically
 	# can evaluate to true.
-	if {$testcond !=3D ""} {
+	if {$testcond ne ""} {
 		foreach ditem $dlist {
 			if {[eval "expr \[\$testcond \$ditem\] =3D=3D 1"]} {
 				foreach token [ditem_key $ditem provides] {
@@ -323,7 +323,7 @@
 			if {$result =3D=3D {}} { set result 0 }
 		=09
 			foreach token [ditem_key $ditem provides] {
-				set statusdict($token) [expr $result =3D=3D 0]
+				set statusdict($token) [expr {$result =3D=3D 0}]
 			}
 		=09
 			# Abort if we're not allowed to fail

Modified: trunk/base/src/macports1.0/macports_util.tcl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/base/src/macports1.0/macports_util.tcl	2014-01-25 16:44:00 UTC =
(rev 116444)
+++ trunk/base/src/macports1.0/macports_util.tcl	2014-01-25 16:46:33 UTC =
(rev 116445)
@@ -98,8 +98,8 @@
             if {$size =3D=3D 0} {
                 set badrange? 1
             }
-        } elseif {[string match end-* $idx] && [string is integer -stric=
t [string range $idx 4 end]]} {
-            set i [expr $size - 1 - [string range $idx 4 end]]
+        } elseif {[string match "end-*" $idx] && [string is integer -str=
ict [string range $idx 4 end]]} {
+            set i [expr {$size - 1 - [string range $idx 4 end]}]
             if {$i < 0 || $i >=3D $size} {
                 set badrange? 1
             }

Modified: trunk/base/src/macports1.0/tests/test.tcl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/base/src/macports1.0/tests/test.tcl	2014-01-25 16:44:00 UTC (re=
v 116444)
+++ trunk/base/src/macports1.0/tests/test.tcl	2014-01-25 16:46:33 UTC (re=
v 116445)
@@ -15,7 +15,7 @@
 }
=20
 proc print_help {arg} {
-    if { $arg =3D=3D "tests" } {
+    if { $arg eq "tests" } {
         puts "The list of available tests is:"
 	cd tests
 	set test_suite [glob *.test]
@@ -34,11 +34,11 @@
=20
 # Process args
 foreach arg $argv {
-    if { $arg =3D=3D "-h" || $arg =3D=3D "-help" } {
+    if { $arg eq "-h" || $arg eq "-help" } {
         print_help ""
         exit 0
-    } elseif { $arg =3D=3D "-debug" } {
-        set index [expr [lsearch $argv $arg] + 1]
+    } elseif { $arg eq "-debug" } {
+        set index [expr {[lsearch $argv $arg] + 1}]
         set level [lindex $argv $index]
         if { $level >=3D 0 && $level <=3D 3 } {
             append arguments "-debug " $level
@@ -46,32 +46,32 @@
             puts "Invalid debug level."
             exit 1
         }
-    } elseif { $arg =3D=3D "-t" } {
-        set index [expr [lsearch $argv $arg] + 1]
+    } elseif { $arg eq "-t" } {
+        set index [expr {[lsearch $argv $arg] + 1}]
         set test_name [lindex $argv $index]
         set no 0
 	cd tests
 	set test_suite [glob *.test]
         foreach test $test_suite {
             if { $test_name !=3D $test } {
-                set no [expr $no + 1]
+                set no [expr {$no + 1}]
             }
         }
         if { $no =3D=3D [llength $test_suite] } {
             print_help tests
             exit 1
         }
-    } elseif { $arg =3D=3D "-l" } {
+    } elseif { $arg eq "-l" } {
         print_help tests
         exit 0
-    } elseif { $arg =3D=3D "-nocolor" } {
+    } elseif { $arg eq "-nocolor" } {
         set color_out "no"
     }
 }
=20
=20
 # Run tests
-if { $test_name !=3D ""} {
+if { $test_name ne ""} {
     set result [eval exec $tcl $test_name $arguments 2>@stderr]
     puts $result
=20
@@ -104,7 +104,7 @@
         if { $fail !=3D 0 } { set err "yes" }
=20
         set out ""
-        if { ($fail !=3D 0 || $skip !=3D 0) && $color_out =3D=3D "" } {
+        if { ($fail !=3D 0 || $skip !=3D 0) && $color_out eq "" } {
             # Color failed tests.
             append out "\x1b\[1;31mTotal:" $total " Passed:" $pass " Fai=
led:" $fail " Skipped:" $skip "  \x1b\[0m" $test
         } else {
@@ -119,13 +119,13 @@
             puts $out
         }
 	if { $fail !=3D 0 } {
-	    set end [expr [string first $test $result 0] - 1]
+	    set end [expr {[string first $test $result 0] - 1}]
 	    puts [string range $result 0 $end]
 	}
     }
 }
=20
 # Return 1 if errors were found.
-if {$err !=3D ""} { exit 1 }
+if {$err ne ""} { exit 1 }
=20
 return 0

--UMW4ssTJ0G7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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

<style type=3D"text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; co=
lor: #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-fami=
ly: 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; fo=
nt-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padd=
ing: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1e=
m; }
#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 { m=
argin-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-ind=
ent: -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; pad=
ding: 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-to=
p: 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; paddin=
g: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa=
0; }
#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:aut=
o;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patc=
h .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=3D"msg">
<dl class=3D"meta">
<dt>Revision</dt> <dd><a href=3D"https://trac.macports.org/changeset/1164=
45">116445</a></dd>
<dt>Author</dt> <dd>cal at macports.org</dd>
<dt>Date</dt> <dd>2014-01-25 08:46:33 -0800 (Sat, 25 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>macports1.0: Tcl cleanup
 - use string comparisons instead of !=3D and =3D=3D where appropriate
 - wrap expressions in braces to allow for bytecode compilation
 - consolidate nested lindex calls



More information about the macports-changes mailing list