[109860] trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

Ryan Schmidt ryandesign at macports.org
Wed Aug 21 01:48:34 PDT 2013


On Aug 20, 2013, at 17:37, jeremyhu at macports.org wrote:

> Revision: 109860
>          https://trac.macports.org/changeset/109860
> Author:   jeremyhu at macports.org
> Date:     2013-08-20 15:37:37 -0700 (Tue, 20 Aug 2013)
> Log Message:
> -----------
> muniversal: Move code to strip arch flags into a separate procedure
> 
> Modified Paths:
> --------------
>    trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

> +            reinplace {s:-arch  *[^ ][^ ]*::} ${tempfile1} ${tempfile2}

The replacement should probably be global, so that multiple flags on a single line are all replaced.

This could be more simply written as:

reinplace -E {s:-arch +[^ ]+::g} ${tempfile1} ${tempfile2}

We could also update the recipe to use that regex since it's slightly simpler:

https://trac.macports.org/wiki/PortfileRecipes#archflags

In any case we should update the recipe to explain what files the muniversal portgroup now handles automatically.

Perhaps this automatic replacement should be in base, not in the muniversal portgroup, since it's confusing for this to be handled automatically for universal builds of ports using the muniversal portgroup but not handled automatically for non-universal builds or universal builds not using the muniversal portgroup.


> +            reinplace {s:-m32::} ${tempfile1} ${tempfile2}
> +            reinplace {s:-m64::} ${tempfile1} ${tempfile2}

This should be global too.

In fact all three replacements could be done in a single regex.

I'd feel better about the -m32 and -m64 replacements if they were more specific, checking for word boundaries on either side, since I can't possibly guarantee for all current or future software in MacPorts that "-m32" or "-m64" aren't part of an unrelated substring somewhere that shouldn't be replaced.



More information about the macports-dev mailing list