[68865] branches/release_1_9/base/src/registry2.0
jmr at macports.org
jmr at macports.org
Wed Jun 16 07:26:32 PDT 2010
Revision: 68865
http://trac.macports.org/changeset/68865
Author: jmr at macports.org
Date: 2010-06-16 07:26:25 -0700 (Wed, 16 Jun 2010)
Log Message:
-----------
merge r68864 from trunk:
normalize paths to files as well as their parent directories when deactivating and uninstalling (#25268)
don't keep unsorted file lists around unnecessarily
Revision Links:
--------------
http://trac.macports.org/changeset/68864
Modified Paths:
--------------
branches/release_1_9/base/src/registry2.0/portimage.tcl
branches/release_1_9/base/src/registry2.0/portuninstall.tcl
Property Changed:
----------------
branches/release_1_9/base/src/registry2.0/receipt_sqlite.tcl
Modified: branches/release_1_9/base/src/registry2.0/portimage.tcl
===================================================================
--- branches/release_1_9/base/src/registry2.0/portimage.tcl 2010-06-16 14:22:45 UTC (rev 68864)
+++ branches/release_1_9/base/src/registry2.0/portimage.tcl 2010-06-16 14:26:25 UTC (rev 68865)
@@ -524,14 +524,14 @@
# directories are before their elements.
# We don't have to do this as mentioned above, but it makes the
# debug output of activate make more sense.
- set theList [lsort -increasing -unique $files]
+ set files [lsort -increasing -unique $files]
set rollback_filelist {}
registry::write {
# Activate it, and catch errors so we can roll-back
try {
$port activate $imagefiles
- foreach file $theList {
+ foreach file $files {
if {[_activate_file "${imagedir}${file}" $file] == 1} {
lappend rollback_filelist $file
}
@@ -638,11 +638,11 @@
# are before their elements.
# We don't have to do this as mentioned above, but it makes the
# debug output of activate make more sense.
- set theList [lsort -increasing -unique $files]
+ set files [lsort -increasing -unique $files]
set rollback_filelist {}
# Activate it, and catch errors so we can roll-back
- if { [catch { foreach file $theList {
+ if { [catch { foreach file $files {
if {[_activate_file "${imagedir}${file}" $file] == 1} {
lappend rollback_filelist $file
}
@@ -704,14 +704,14 @@
# instead of the paths we currently have, users' registry won't
# match and activate will say that some file exists but doesn't
# belong to any port.
- set theFile [file normalize $file]
- lappend files $theFile
+ # The custom realpath proc is necessary because file normalize
+ # does not resolve symlinks on OS X < 10.6
+ set directory [realpath [file dirname $file]]
+ lappend files [file join $directory [file tail $file]]
- # Split out the filename's subpaths and add them to the image list as
- # well. The realpath call is necessary because file normalize
- # does not resolve symlinks on OS X < 10.6
- set directory [realpath [file dirname $theFile]]
- while { [lsearch -exact $files $directory] == -1 } {
+ # Split out the filename's subpaths and add them to the image list
+ # as well.
+ while { [lsearch -exact $files $directory] == -1 } {
lappend files $directory
set directory [file dirname $directory]
}
@@ -723,18 +723,18 @@
# Sort the list in reverse order, removing duplicates.
# Since the list is sorted in reverse order, we're sure that directories
# are after their elements.
- set theList [lsort -decreasing -unique $files]
+ set files [lsort -decreasing -unique $files]
# Remove all elements.
if {$use_reg2 && !$rollback} {
registry::write {
$port deactivate $imagefiles
- foreach file $theList {
+ foreach file $files {
_deactivate_file $file
}
}
} else {
- foreach file $theList {
+ foreach file $files {
_deactivate_file $file
}
}
Modified: branches/release_1_9/base/src/registry2.0/portuninstall.tcl
===================================================================
--- branches/release_1_9/base/src/registry2.0/portuninstall.tcl 2010-06-16 14:22:45 UTC (rev 68864)
+++ branches/release_1_9/base/src/registry2.0/portuninstall.tcl 2010-06-16 14:26:25 UTC (rev 68865)
@@ -340,17 +340,17 @@
catch {file copy $fname "${fname}${bak_suffix}"}
}
}
-
- set theFile [file normalize $fname]
- if { [file exists $theFile] || (![catch {file type $theFile}] && [file type $theFile] == "link") } {
+
+ if { [file exists $fname] || (![catch {file type $fname}] && [file type $fname] == "link") } {
# Normalize the file path to avoid removing the intermediate
# symlinks (remove the empty directories instead)
- lappend files $theFile
+ # The custom realpath proc is necessary because file normalize
+ # does not resolve symlinks on OS X < 10.6
+ set directory [realpath [file dirname $fname]]
+ lappend files [file join $directory [file tail $fname]]
# Split out the filename's subpaths and add them to the
- # list as well. The realpath call is necessary because file normalize
- # does not resolve symlinks on OS X < 10.6
- set directory [realpath [file dirname $theFile]]
+ # list as well.
while { [lsearch -exact $files $directory] == -1 } {
lappend files $directory
set directory [file dirname $directory]
@@ -361,10 +361,10 @@
# Sort the list in reverse order, removing duplicates.
# Since the list is sorted in reverse order, we're sure that directories
# are after their elements.
- set theList [lsort -decreasing -unique $files]
+ set files [lsort -decreasing -unique $files]
# Remove all elements.
- _uninstall_list $theList
+ _uninstall_list $files
if {$use_reg2} {
registry::entry delete $port
Property changes on: branches/release_1_9/base/src/registry2.0/receipt_sqlite.tcl
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base/src/registry1.0/receipt_sqlite.tcl:37343-46937
/branches/gsoc09-logging/base/src/registry1.0/receipt_sqlite.tcl:51231-60371
/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/registry2.0/receipt_sqlite.tcl:67304-67305,67307,67384,67449,67451,67487,67593,67595,67763,67792,67838,68058,68281,68286,68288,68413,68416,68463,68593,68620,68675-68676,68680,68683-68684,68691,68697,68746,68749,68764,68779,68806,68816-68817,68849,68851
/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692
+ /branches/gsoc08-privileges/base/src/registry1.0/receipt_sqlite.tcl:37343-46937
/branches/gsoc09-logging/base/src/registry1.0/receipt_sqlite.tcl:51231-60371
/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base/src/registry2.0/receipt_sqlite.tcl:67304-67305,67307,67384,67449,67451,67487,67593,67595,67763,67792,67838,68058,68281,68286,68288,68413,68416,68463,68593,68620,68675-68676,68680,68683-68684,68691,68697,68746,68749,68764,68779,68806,68816-68817,68849,68851,68864
/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100616/37b6f4d9/attachment.html>
More information about the macports-changes
mailing list