[Rpm-maint] [rpm-software-management/rpm] Provide function for $optflags manipulation (#814)

marxin notifications at github.com
Tue Aug 13 14:28:37 UTC 2019

> `%remove_optflags 'undesirable'`
> `%replace_optflags 'oldval' 'newval'`

Then we can have just the simple one. Following works for me:
$ rpm --define "%optflags -flto=auto -O2" --define "%replace_optflags() %global optflags %(echo %optflags | sed s/%{?1}/%{?2}/)" --eval '%replace_optflags "-flto=auto"' --eval 'optflags=%optflags'

optflags= -O2
rpm --define "%optflags -flto=auto -O2" --define "%replace_optflags() %global optflags %(echo %optflags | sed s/%{?1}/%{?2}/)" --eval '%replace_optflags "-O2" "-O3"' --eval 'optflags=%optflags'

optflags=-flto=auto -O3


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190813/af2e9864/attachment.html>

More information about the Rpm-maint mailing list