Ignore:
Timestamp:
Oct 12, 2013, 1:52:44 AM (6 years ago)
Author:
ryandesign@…
Message:

perl5-1.0.tcl: use fs-traverse and reinplace instead of running find, xargs and sed via system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/perl5-1.0.tcl

    r111268 r112102  
    154154        # LDFLAGS can't be passed in (or if it can, it's not easy to figure out how).
    155155        post-configure {
    156             system "find ${worksrcpath} -name Makefile -type f -print0 | xargs -0 /usr/bin/sed -i \"\" '/^CCFLAGS *=/s/$/ [get_canonical_archflags cc]/' \;"
    157             system "find ${worksrcpath} -name Makefile -type f -print0 | xargs -0 /usr/bin/sed -i \"\" '/^OTHERLDFLAGS *=/s/$/ [get_canonical_archflags ld]/'"
     156            fs-traverse file ${configure.dir} {
     157                if {[file isfile ${file}] && [file tail ${file}] eq "Makefile"} {
     158                    ui_info "Fixing flags in [string map "${configure.dir}/ {}" ${file}]"
     159                    reinplace "/^CCFLAGS *=/s/$/ [get_canonical_archflags cc]/" ${file}
     160                    reinplace "/^OTHERLDFLAGS *=/s/$/ [get_canonical_archflags ld]/" ${file}
     161                }
     162            }
    158163        }
    159164
     
    164169        post-destroot {
    165170            fs-traverse file ${destroot}${perl5.lib} {
    166                 if {[file tail ${file}] eq ".packlist"} {
    167                     ui_info "Fixing packlist ${file}"
     171                if {[file isfile ${file}] && [file tail ${file}] eq ".packlist"} {
     172                    ui_info "Fixing paths in [string map "${destroot}${perl5.lib}/ {}" ${file}]"
    168173                    reinplace -n "s|${destroot}||p" ${file}
    169174                }
Note: See TracChangeset for help on using the changeset viewer.