[119571] trunk/base/src/port1.0/portdestroot.tcl

jmr at macports.org jmr at macports.org
Wed Apr 30 15:35:13 PDT 2014


Revision: 119571
          https://trac.macports.org/changeset/119571
Author:   jmr at macports.org
Date:     2014-04-30 15:35:13 -0700 (Wed, 30 Apr 2014)
Log Message:
-----------
process relative symlinks that point to .la files according to delete_la_files setting (absolute ones are trickier)

Modified Paths:
--------------
    trunk/base/src/port1.0/portdestroot.tcl

Modified: trunk/base/src/port1.0/portdestroot.tcl
===================================================================
--- trunk/base/src/port1.0/portdestroot.tcl	2014-04-30 20:07:44 UTC (rev 119570)
+++ trunk/base/src/port1.0/portdestroot.tcl	2014-04-30 22:35:13 UTC (rev 119571)
@@ -172,17 +172,12 @@
     # Prevent overlinking due to glibtool .la files: https://trac.macports.org/ticket/38010
     ui_debug "Fixing glibtool .la files in destroot for ${subport}"
     fs-traverse -depth fullpath ${destroot} {
-        if {[file extension $fullpath] eq ".la" && [file type $fullpath] eq "file"} {
+        # XXX checking only relative symlinks - rewriting absolute links to point to destroot would be tricky
+        if {[file extension $fullpath] eq ".la" && ([file type $fullpath] eq "file" || ([file type $fullpath] eq "link" && [file pathtype [file link $fullpath]] eq "relative"))} {
             # Make sure it is from glibtool ... "a libtool library file" will appear in the first line
             if {![catch {set fp [open $fullpath]}]} {
                 if {[gets $fp line] > 0 && [string first "a libtool library file" $line] != -1} {
-                    if {${destroot.delete_la_files}} {
-                        ui_debug "Removing [file tail $fullpath]"
-                        file delete -force ${fullpath}
-                    } else {
-                        ui_debug "Clearing dependency_libs in [file tail $fullpath]"
-                        reinplace "/dependency_libs/ s/'.*'/''/" ${fullpath}
-                    }
+                    lappend la_file_list $fullpath
                 }
             } else {
                 ui_debug "Failed to open $fullpath"
@@ -190,6 +185,15 @@
             catch {close $fp}
         }
     }
+    foreach fullpath $la_file_list {
+        if {${destroot.delete_la_files}} {
+            ui_debug "Removing [file tail $fullpath]"
+            file delete -force ${fullpath}
+        } else {
+            ui_debug "Clearing dependency_libs in [file tail $fullpath]"
+            reinplace "/dependency_libs/ s/'.*'/''/" ${fullpath}
+        }
+    }
 
     # Prune empty directories in ${destroot}
     foreach path ${destroot.keepdirs} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140430/b071bd97/attachment.html>


More information about the macports-changes mailing list