[Mesa-dev] [PATCH] configure.ac: Use POSIX word boundary regex.

Michel Dänzer michel at daenzer.net
Fri Mar 17 06:53:22 UTC 2017


On 17/03/17 09:16 AM, Jan Beich wrote:
> Vinson Lee <vlee at freedesktop.org> writes:
> 
>>      echo " `$1`" | sed -E \
>>          -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
>> -        -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
>> +        -e 's/[[[:space:]]]+-DNDEBUG[[[:>:]]]//g' \
> 
> Try matching some whitespace after the word as a workaround e.g.,
> 
>   -e 's/[[[:space:]]]+-DNDEBUG($|[[[:space:]]])/\1/g'

Instead of ($|...) I'd just add a space at the end of the string we feed
to sed as well, i.e.

      echo " `$1` " | sed -E \

Other than that, I agree replacing \> with [[[:space:]]] is probably the
best solution, since the former wouldn't work as intended anyway with
hypothetical switches containing one we're matching for as a prefix,
e.g. -DNDEBUG-THANKS / -D_GNU_SOURCE-PLEASE / -pedantic-aggressive /
-fno-rtti-at-all / ... :)


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list