pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: devel/doxygen + MacOS




On Jan 18, 2017, at 7:48 AM, Greg Troxel <gdt%lexort.com@localhost> wrote:

While I did suggest thinking about a more complicated solution, I think
there is also great merit in avoiding it if it isn't necessary.  So if
you can make the sed grab the second word, or perhaps another _expression_
to recognize and remove the extra apple stuff, so that the last word
rule then works, that seems like a change with minimal other
consequences.

I agree that simple is best.  Given that nobody seems to have noticed the problem until now, I feel that matching the second word of the version string is basically the correct idea.  The problem is that the regular _expression_ in use does not match the second word, it matches the last because the first group is greedy and can include spaces.  I believe a better one would be the following, which is more explicit about eliminating spaces (and tabs just to be more general) within the capture groups:

s/^[[:blank:]]*\([^[:blank:]]\{1,\}\)[[:blank:]]\{1,\}\([^[:blank:]]\{1,\}\).*$$/\2/

This works on my Mac (which is using nbsed as ${SED} within pkgsrc).  I hope it works elsewhere, but perhaps those with better understanding of different versions of sed can chime in.

The simplest solution would be to replace the existing regex with something like the one above.  Thoughts?

Cheers,
Brook



Home | Main Index | Thread Index | Old Index