Modified: branches/release_2_0/base/src/macports1.0/macports.tcl (90094 => 90095)
--- branches/release_2_0/base/src/macports1.0/macports.tcl 2012-02-21 16:10:19 UTC (rev 90094)
+++ branches/release_2_0/base/src/macports1.0/macports.tcl 2012-02-21 16:13:17 UTC (rev 90095)
@@ -1006,12 +1006,19 @@
set user_plist "${user_home}/Library/Preferences/com.apple.dt.Xcode.plist"
set target_dir "${target_homedir}/Library/Preferences"
if {[file isfile $user_plist]} {
- if {[catch {
- file mkdir "${target_homedir}/Library/Preferences"
- file copy -force $user_plist $target_dir
- if {[getuid] == 0} {
- file attributes "${target_dir}/com.apple.dt.Xcode.plist" -owner $macportsuser
- }
+ if {![file isdirectory "${target_dir}"]} {
+ if {[catch {file mkdir "${target_dir}"} result]} {
+ ui_warn "Failed to create Library/Preferences in temporary home directory: $result"
+ return
+ }
+ }
+ ui_debug "Copying $user_plist to temporary home directory ${target_dir}"
+ if {[file writable ${target_dir}] && [catch {
+ file copy -force $user_plist $target_dir
+ if {[getuid] == 0} {
+ file attributes "${target_dir}/com.apple.dt.Xcode.plist" -owner $macportsuser
+ }
+ file attributes "${target_dir}/com.apple.dt.Xcode.plist" -permissions 644
} result]} {
ui_warn "Failed to copy com.apple.dt.Xcode.plist to temporary home directory: $result"
}