[58788] trunk/base/src/port1.0/portutil.tcl
ryandesign at macports.org
ryandesign at macports.org
Mon Oct 5 02:02:39 PDT 2009
Revision: 58788
http://trac.macports.org/changeset/58788
Author: ryandesign at macports.org
Date: 2009-10-05 02:02:38 -0700 (Mon, 05 Oct 2009)
Log Message:
-----------
portutil.tcl: merge proc: use pure tcl to identify symlinks and directories, to avoid Snow Leopard's "file" command which dereferences symlinks; see #21852
Modified Paths:
--------------
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2009-10-05 08:53:57 UTC (rev 58787)
+++ trunk/base/src/port1.0/portutil.tcl 2009-10-05 09:02:38 UTC (rev 58788)
@@ -2231,30 +2231,34 @@
set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]]
if {${fpath} != ""} {
# determine the type (dir/file/link)
- set filetype [exec [findBinary file $portutil::autoconf::file_path] "-b" "${basepath}${fpath}"]
- switch -regexp ${filetype} {
+ switch [file type ${basepath}${fpath}] {
directory {
# just create directories
ui_debug "mrg: directory ${fpath}"
file mkdir "${destroot}${fpath}"
}
- symbolic\ link.* {
+ link {
# copy symlinks, TODO: check if targets match!
ui_debug "mrg: symlink ${fpath}"
file copy "${basepath}${fpath}" "${destroot}${fpath}"
}
- Mach-O.* {
- merge_lipo "${base}" "${destroot}" "${fpath}" "${archs}"
- }
- current\ ar\ archive {
- merge_lipo "${base}" "${destroot}" "${fpath}" "${archs}"
- }
- ASCII\ C\ program\ text {
- merge_cpp "${base}" "${destroot}" "${fpath}" "${archs}"
- }
default {
- ui_debug "unknown file type: ${filetype}"
- merge_file "${base}" "${destroot}" "${fpath}" "${archs}"
+ set filetype [exec [findBinary file $portutil::autoconf::file_path] "-b" "${basepath}${fpath}"]
+ switch -regexp ${filetype} {
+ Mach-O.* {
+ merge_lipo "${base}" "${destroot}" "${fpath}" "${archs}"
+ }
+ current\ ar\ archive {
+ merge_lipo "${base}" "${destroot}" "${fpath}" "${archs}"
+ }
+ ASCII\ C\ program\ text {
+ merge_cpp "${base}" "${destroot}" "${fpath}" "${archs}"
+ }
+ default {
+ ui_debug "unknown file type: ${filetype}"
+ merge_file "${base}" "${destroot}" "${fpath}" "${archs}"
+ }
+ }
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091005/5ebc3480/attachment.html>
More information about the macports-changes
mailing list