Ticket #38010: prune-la.patch

File prune-la.patch, 1.1 KB (added by jeremyhu (Jeremy Huddleston Sequoia), 12 years ago)

prune-la.patch

  • src/port1.0/portdestroot.tcl

     
    166166        }
    167167    }
    168168
     169    # Delete glibtool .la turds: http://trac.macports.org/ticket/38010
     170    ui_info "$UI_PREFIX [format [msgcat::mc "Removing glibtool .la files from destroot for %s"] ${subport}]"
     171    fs-traverse -depth fullpath ${destroot} {
     172        if {![file isdirectory ${fullpath}] &&
     173            [regexp "^${destroot}(.*\.la)$" ${fullpath} match path]} {
     174            # Make sure it is from glibtool ... "a libtool library file" will appear in the first line
     175            set fp [open ${fullpath}]
     176            if {[gets $fp line] >= 0 && [regexp "a libtool library file" $line]} {
     177                ui_info "Removing ${path}"
     178                file delete ${fullpath}
     179            }
     180            close ${fp}
     181        }
     182    }
     183
    169184    # Prune empty directories in ${destroot}
    170185    foreach path ${destroot.keepdirs} {
    171186        if {![file isdirectory ${path}]} {