bug-bash
[Top][All Lists]
Advanced

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

Re: Another little patch I would like to put upstream


From: Mike Frysinger
Subject: Re: Another little patch I would like to put upstream
Date: Mon, 5 Dec 2016 23:01:25 -0500

On 04 Dec 2016 22:53, Vladimir Marek wrote:
> Studio compiler may use things like '-xregs=no%frameptr' for example.
> 
> Thank you
> -- 
>       Vlad

> # Our compiler flags contain percent sign which get mixed up with percent sign
> # seprators used by sed.
> 
> # Submitted to address@hidden
> 
> --- Makefile.in       2014-01-25 13:27:30.000000000 -0800
> +++ Makefile.in       2015-04-02 11:18:58.143893640 -0700
> @@ -584,10 +585,10 @@
>       @echo
>  
>  bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG)
> -     @sed -e "s%!MACHINE!%$(Machine)%" -e "s%!OS!%$(OS)%" \
> -          -e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \
> -          -e "s%!RELEASE!%$(Version)%" -e "s%!PATCHLEVEL!%$(PatchLevel)%" \
> -          -e "s%!MACHTYPE!%$(MACHTYPE)%" -e "s%!RELSTATUS!%$(RELSTATUS)%" \
> +     @sed -e "s^!MACHINE!^$(Machine)^" -e "s^!OS!^$(OS)^" \
> +          -e "s^!CFLAGS!^$(CCFLAGS)^" -e "s^!CC!^$(CC)^" \
> +          -e "s^!RELEASE!^$(Version)^" -e "s^!PATCHLEVEL!^$(PatchLevel)^" \
> +          -e "s^!MACHTYPE!^$(MACHTYPE)^" -e "s^!RELSTATUS!^$(RELSTATUS)^" \
>            $(SUPPORT_SRC)bashbug.sh > $@
>       @chmod a+rx bashbug

using ^ as an anchor doesn't seem that much better than %

autoconf uses & and |, but they tend to do it for vars where it's
unlikely those will show up (like path vars)

how about something like:
        @s=$$(printf '\001'); \
        sed -e "s$$s!MACHINE!$$s$(Machine)$$s" ...
-mike

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]