Changeset 119571


Ignore:
Timestamp:
Apr 30, 2014, 10:35:13 PM (10 years ago)
Author:
jmr@…
Message:

process relative symlinks that point to .la files according to delete_la_files setting (absolute ones are trickier)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portdestroot.tcl

    r116449 r119571  
    173173    ui_debug "Fixing glibtool .la files in destroot for ${subport}"
    174174    fs-traverse -depth fullpath ${destroot} {
    175         if {[file extension $fullpath] eq ".la" && [file type $fullpath] eq "file"} {
     175        # XXX checking only relative symlinks - rewriting absolute links to point to destroot would be tricky
     176        if {[file extension $fullpath] eq ".la" && ([file type $fullpath] eq "file" || ([file type $fullpath] eq "link" && [file pathtype [file link $fullpath]] eq "relative"))} {
    176177            # Make sure it is from glibtool ... "a libtool library file" will appear in the first line
    177178            if {![catch {set fp [open $fullpath]}]} {
    178179                if {[gets $fp line] > 0 && [string first "a libtool library file" $line] != -1} {
    179                     if {${destroot.delete_la_files}} {
    180                         ui_debug "Removing [file tail $fullpath]"
    181                         file delete -force ${fullpath}
    182                     } else {
    183                         ui_debug "Clearing dependency_libs in [file tail $fullpath]"
    184                         reinplace "/dependency_libs/ s/'.*'/''/" ${fullpath}
    185                     }
     180                    lappend la_file_list $fullpath
    186181                }
    187182            } else {
     
    189184            }
    190185            catch {close $fp}
     186        }
     187    }
     188    foreach fullpath $la_file_list {
     189        if {${destroot.delete_la_files}} {
     190            ui_debug "Removing [file tail $fullpath]"
     191            file delete -force ${fullpath}
     192        } else {
     193            ui_debug "Clearing dependency_libs in [file tail $fullpath]"
     194            reinplace "/dependency_libs/ s/'.*'/''/" ${fullpath}
    191195        }
    192196    }
Note: See TracChangeset for help on using the changeset viewer.