[116514] trunk/base/src

cal at macports.org cal at macports.org
Mon Jan 27 07:23:40 PST 2014


Revision: 116514
          https://trac.macports.org/changeset/116514
Author:   cal at macports.org
Date:     2014-01-27 07:23:40 -0800 (Mon, 27 Jan 2014)
Log Message:
-----------
base/src: further Tcl cleanup, by courtesy of Gustaf Neumann, Tcl8.4-clean

Modified Paths:
--------------
    trunk/base/src/package1.0/portmpkg.tcl
    trunk/base/src/package1.0/portpkg.tcl
    trunk/base/src/port/port.tcl
    trunk/base/src/port/portindex.tcl
    trunk/base/src/port1.0/portlint.tcl
    trunk/base/src/port1.0/portstartupitem.tcl
    trunk/base/src/port1.0/porttrace.tcl
    trunk/base/src/port1.0/portutil.tcl
    trunk/base/src/registry2.0/registry.tcl

Modified: trunk/base/src/package1.0/portmpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portmpkg.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/package1.0/portmpkg.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -122,7 +122,7 @@
 
 proc portmpkg::epoch_namestr {portepoch} {
     set portepoch_namestr ""
-    if {${portepoch} != "0"} {
+    if {${portepoch} != 0} {
         set portepoch_namestr "${portepoch}_"
     }
     return ${portepoch_namestr}
@@ -130,7 +130,7 @@
 
 proc portmpkg::revision_namestr {portrevision} {
     set portrevision_namestr ""
-    if {${portrevision} != "0"} {
+    if {${portrevision} != 0} {
         set portrevision_namestr "_${portrevision}"
     }
     return ${portrevision_namestr}
@@ -171,13 +171,13 @@
         set name [lindex $dep 0]
         set epoch [lindex $dep 1]
         set epoch_namestr ""
-        if {$epoch != "0"} {
+        if {$epoch != 0} {
             set epoch_namestr "${epoch}_"
         }
         set vers [lindex $dep 2]
         set rev [lindex $dep 3]
         set rev_namestr ""
-        if {$rev != "0"} {
+        if {$rev != 0} {
             set rev_namestr "_${rev}"
         }
         set mport [lindex $dep 4]

Modified: trunk/base/src/package1.0/portpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portpkg.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/package1.0/portpkg.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -113,11 +113,11 @@
     pkg_post_unarchive_deletions portpkg::language
 
     set portepoch_namestr ""
-    if {${portepoch} != "0"} {
+    if {${portepoch} != 0} {
         set portepoch_namestr "${portepoch}_"
     }
     set portrevision_namestr ""
-    if {${portrevision} != "0"} {
+    if {${portrevision} != 0} {
         set portrevision_namestr "_${portrevision}"
     }
 
@@ -319,7 +319,7 @@
     }
 
     set portname [xml_escape $portname]
-    if {$portepoch != "0"} {
+    if {$portepoch != 0} {
         set portepoch [xml_escape $portepoch]
         set portepoch_str "${portepoch}_"
     } else {
@@ -327,7 +327,7 @@
         set portepoch_str ""
     }
     set portversion [xml_escape $portversion]
-    if {$portrevision != "0"} {
+    if {$portrevision != 0} {
         set portrevision [xml_escape $portrevision]
         set portrevision_str "_${portrevision}"
     } else {
@@ -399,7 +399,7 @@
 proc portpkg::write_distribution {dfile portname portepoch portversion portrevision} {
     global macosx_deployment_target
     set portname [xml_escape $portname]
-    if {$portepoch != "0"} {
+    if {$portepoch != 0} {
         set portepoch [xml_escape $portepoch]
         set portepoch_str "${portepoch}_"
     } else {
@@ -407,7 +407,7 @@
         set portepoch_str ""
     }
     set portversion [xml_escape $portversion]
-    if {$portrevision != "0"} {
+    if {$portrevision != 0} {
         set portrevision [xml_escape $portrevision]
         set portrevision_str "_${portrevision}"
     } else {

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port/port.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -142,7 +142,7 @@
 # @param name variable name
 # @param value constant variable value
 proc const {name args} {
-    interp alias {} $name {} _const [expr $args]
+    interp alias {} $name {} _const [expr {$args}]
 }
 
 ##
@@ -3816,7 +3816,7 @@
                     # may want stuff from it as well, like TERM.
                     array unset env_save; array set env_save [array get env]
                     array unset env *
-                    if {${macports::macosx_version} == "10.5"} {
+                    if {${macports::macosx_version} == 10.5} {
                         unsetenv *
                     }
                     array set env [array get boot_env]
@@ -3847,7 +3847,7 @@
                     
                     # Restore internal MacPorts environment
                     array unset env *
-                    if {${macports::macosx_version} == "10.5"} {
+                    if {${macports::macosx_version} == 10.5} {
                         unsetenv *
                     }
                     array set env [array get env_save]

Modified: trunk/base/src/port/portindex.tcl
===================================================================
--- trunk/base/src/port/portindex.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port/portindex.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -39,7 +39,7 @@
            ui_options port_options save_prefix keepkeys
 
     # try to reuse the existing entry if it's still valid
-    if {$full_reindex != "1" && [info exists qindex([string tolower [file tail $portdir]])]} {
+    if {$full_reindex != 1 && [info exists qindex([string tolower [file tail $portdir]])]} {
         try {
             set mtime [file mtime [file join $directory $portdir Portfile]]
             if {$oldmtime >= $mtime} {

Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port1.0/portlint.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -288,7 +288,7 @@
 
         # Check for hardcoded paths
         if {!$hashline
-                && $name != "MacPorts"
+                && $name ne "MacPorts"
                 && [string match "*/opt/local*" $line]
                 && ![regexp {^\s*reinplace} $line]
                 && ![regexp {^\s*system.*\Wsed\W} $line]} {

Modified: trunk/base/src/port1.0/portstartupitem.tcl
===================================================================
--- trunk/base/src/port1.0/portstartupitem.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port1.0/portstartupitem.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -600,7 +600,7 @@
     
     puts ${plist} "<key>Debug</key><false/>"
     puts ${plist} "<key>Disabled</key><true/>"
-    if {$macosx_deployment_target != "10.4"} {
+    if {$macosx_deployment_target != 10.4} {
         puts ${plist} "<key>KeepAlive</key><true/>"
     } else {
         puts ${plist} "<key>OnDemand</key><false/>"

Modified: trunk/base/src/port1.0/porttrace.tcl
===================================================================
--- trunk/base/src/port1.0/porttrace.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port1.0/porttrace.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -172,7 +172,7 @@
         global env trace_fifo macosx_version
         foreach var {DYLD_INSERT_LIBRARIES DYLD_FORCE_FLAT_NAMESPACE DARWINTRACE_LOG DARWINTRACE_SANDBOX_BOUNDS} {
             array unset env $var
-            if {$macosx_version == "10.5"} {
+            if {$macosx_version == 10.5} {
                 unsetenv $var
             }
         }

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/port1.0/portutil.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -461,7 +461,7 @@
 
     # Restore the environment.
     array unset env *
-    if {$macosx_version == "10.5"} {
+    if {$macosx_version == 10.5} {
         unsetenv *
     }
     array set env [array get saved_env]
@@ -1015,7 +1015,7 @@
                     set env(LC_CTYPE) $oldlocale
                 } else {
                     unset env(LC_CTYPE)
-                    if {$macosx_version == "10.5"} {
+                    if {$macosx_version == 10.5} {
                         unsetenv LC_CTYPE
                     }
                 }
@@ -1029,7 +1029,7 @@
                 set env(LC_CTYPE) $oldlocale
             } else {
                 unset env(LC_CTYPE)
-                if {$macosx_version == "10.5"} {
+                if {$macosx_version == 10.5} {
                     unsetenv LC_CTYPE
                 }
             }
@@ -1174,7 +1174,7 @@
 # Wrapper for file rename that handles case-only renames
 proc move {args} {
     set options {}
-    while {[string match -* [lindex $args 0]]} {
+    while {[string match "-*" [lindex $args 0]]} {
         set arg [string range [lindex $args 0] 1 end]
         set args [lreplace $args 0 0]
         switch -- $arg {
@@ -1603,7 +1603,7 @@
     set env(HOME) $savedhome
     if {[info exists env(TMPDIR)]} {
         unset env(TMPDIR)
-        if {$macosx_version == "10.5"} {
+        if {$macosx_version == 10.5} {
             unsetenv TMPDIR
         }
     }

Modified: trunk/base/src/registry2.0/registry.tcl
===================================================================
--- trunk/base/src/registry2.0/registry.tcl	2014-01-27 15:18:28 UTC (rev 116513)
+++ trunk/base/src/registry2.0/registry.tcl	2014-01-27 15:23:40 UTC (rev 116514)
@@ -457,7 +457,7 @@
         set installtype [receipt_flat::property_retrieve $iref installtype]
         lappend proplist installtype $installtype
         set location [receipt_flat::property_retrieve $iref location]
-        if {$location == "0"} {
+        if {$location == 0} {
             set location [receipt_flat::property_retrieve $iref imagedir]
         }
         set contents [receipt_flat::property_retrieve $iref contents]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140127/57466aa7/attachment-0001.html>


More information about the macports-changes mailing list