[78962] branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl

cal at macports.org cal at macports.org
Fri May 27 17:58:15 PDT 2011


Revision: 78962
          http://trac.macports.org/changeset/78962
Author:   cal at macports.org
Date:     2011-05-27 17:58:13 -0700 (Fri, 27 May 2011)
Log Message:
-----------
rev-upgrade: more naming conflicts

Modified Paths:
--------------
    branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl

Modified: branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl	2011-05-28 00:34:00 UTC (rev 78961)
+++ branches/gsoc11-rev-upgrade/base/src/registry2.0/portimage.tcl	2011-05-28 00:58:13 UTC (rev 78962)
@@ -375,22 +375,22 @@
             ui_debug "activating directory: $dstfile"
             # Don't do anything if the directory already exists.
             if { ![::file isdirectory $dstfile] } {
-                file mkdir $dstfile
+                ::file mkdir $dstfile
                 # fix attributes on the directory.
                 if {[getuid] == 0} {
-                    eval file attributes {$dstfile} [::file attributes $srcfile]
+                    eval ::file attributes {$dstfile} [::file attributes $srcfile]
                 } else {
                     # not root, so can't set owner/group
-                    eval file attributes {$dstfile} -permissions [::file attributes -permissions $srcfile]
+                    eval ::file attributes {$dstfile} -permissions [::file attributes $srcfile -permissions]
                 }
                 # set mtime on installed element
-                file mtime $dstfile [::file mtime $srcfile]
+                ::file mtime $dstfile [::file mtime $srcfile]
             }
             return 0
         }
         default {
             ui_debug "activating file: $dstfile"
-            file rename $srcfile $dstfile
+            ::file rename $srcfile $dstfile
             return 1
         }
     }
@@ -522,7 +522,7 @@
         }
         system $cmdstring
     } catch {*} {
-        file delete -force $extractdir
+        ::file delete -force $extractdir
         throw
     } finally {
         cd $startpwd
@@ -566,7 +566,7 @@
                     # To be able to install links, we test if we can lstat the file to
                     # figure out if the source file exists (file exists will return
                     # false for symlinks on files that do not exist)
-                    if { [catch {file lstat $srcfile dummystatvar}] } {
+                    if { [catch {::file lstat $srcfile dummystatvar}] } {
                         throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port [$port name]."
                     }
 
@@ -592,7 +592,7 @@
                             if { [::file exists $file] } {
                                 set bakfile "${file}${baksuffix}"
                                 ui_warn "File $file already exists.  Moving to: $bakfile."
-                                file rename -force -- $file $bakfile
+                                ::file rename -force -- $file $bakfile
                                 lappend backups $file
                             }
                             if { $owner != {} } {
@@ -605,7 +605,7 @@
                             # the registry
                             if { $owner != {} && $owner != $port } {
                                 throw registry::image-error "Image error: $file is being used by the active [$owner name] port.  Please deactivate this port first, or use 'port -f activate [$port name]' to force the activation."
-                            } elseif { $owner == {} && ![catch {file type $file}] } {
+                            } elseif { $owner == {} && ![catch {::file type $file}] } {
                                 throw registry::image-error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port [$port name]. Use 'port -f activate [$port name]' to force the activation."
                             }
                         }
@@ -670,7 +670,7 @@
             # locations, then rethrow the error. Transaction rollback will take care
             # of this in the registry.
             foreach file $backups {
-                file rename -force -- "${file}${baksuffix}" $file
+                ::file rename -force -- "${file}${baksuffix}" $file
             }
             # reactivate deactivated ports
             foreach entry [array names todeactivate] {
@@ -680,7 +680,7 @@
                 }
             }
             # remove temp image dir
-            file delete -force $extracted_dir
+            ::file delete -force $extracted_dir
             throw
         }
     } else {
@@ -692,8 +692,8 @@
             # To be able to install links, we test if we can lstat the file to
             # figure out if the source file exists (file exists will return
             # false for symlinks on files that do not exist)
-            if { [catch {file lstat $srcfile dummystatvar}] } {
-                file delete -force $extracted_dir
+            if { [catch {::file lstat $srcfile dummystatvar}] } {
+                ::file delete -force $extracted_dir
                 return -code error "Image error: Source file $srcfile does not appear to exist (cannot lstat it).  Unable to activate port $name."
             }
 
@@ -704,7 +704,7 @@
                 if {[catch {mportlookup $port} result]} {
                     global errorInfo
                     ui_debug "$errorInfo"
-                    file delete -force $extracted_dir
+                    ::file delete -force $extracted_dir
                     return -code error "port lookup failed: $result"
                 }
                 array unset portinfo
@@ -717,17 +717,17 @@
             }
     
             if { $port != 0  && $force != 1 && $port != $name } {
-                file delete -force $extracted_dir
+                ::file delete -force $extracted_dir
                 return -code error "Image error: $file is being used by the active $port port.  Please deactivate this port first, or use 'port -f activate $name' to force the activation."
             } elseif { [::file exists $file] && $force != 1 } {
-                file delete -force $extracted_dir
+                ::file delete -force $extracted_dir
                 return -code error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port $name. Use 'port -f activate $name' to force the activation."
             } elseif { $force == 1 && [::file exists $file] || $port != 0 } {
                 set bakfile "${file}${baksuffix}"
 
                 if {[::file exists $file]} {
                     ui_warn "File $file already exists.  Moving to: $bakfile."
-                    file rename -force -- $file $bakfile
+                    ::file rename -force -- $file $bakfile
                     lappend backups $file
                 }
 
@@ -781,7 +781,7 @@
                     registry::unregister_file $bakfile
                     registry::register_file $f $bakport
                 }
-                file rename -force -- $bakfile $file
+                ::file rename -force -- $bakfile $file
             }
             # reactivate deactivated ports
             foreach entry $deactivated {
@@ -791,28 +791,28 @@
             }
             registry::write_file_map
 
-            file delete -force $extracted_dir
+            ::file delete -force $extracted_dir
             return -code error $result
         }
     }
-    file delete -force $extracted_dir
+    ::file delete -force $extracted_dir
 }
 
 proc _deactivate_file {dstfile} {
     if { [::file type $dstfile] == "link" } {
         ui_debug "deactivating link: $dstfile"
-        file delete -- $dstfile
+        ::file delete -- $dstfile
     } elseif { [::file isdirectory $dstfile] } {
         # 0 item means empty.
         if { [llength [readdir $dstfile]] == 0 } {
             ui_debug "deactivating directory: $dstfile"
-            file delete -- $dstfile
+            ::file delete -- $dstfile
         } else {
             ui_debug "$dstfile is not empty"
         }
     } else {
         ui_debug "deactivating file: $dstfile"
-        file delete -- $dstfile
+        ::file delete -- $dstfile
     }
 }
 
@@ -821,7 +821,7 @@
     set files [list]
 
     foreach file $imagefiles {
-        if { [::file exists $file] || (![catch {file type $file}] && [::file type $file] == "link") } {
+        if { [::file exists $file] || (![catch {::file type $file}] && [::file type $file] == "link") } {
             # Normalize the file path to avoid removing the intermediate
             # symlinks (remove the empty directories instead)
             # Remark: paths in the registry may be not normalized.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110527/302e0aa4/attachment-0001.html>


More information about the macports-changes mailing list