2017-08-25 8:53 GMT+02:00 Panu Matilainen <pmati...@redhat.com>:
> On 08/24/2017 07:48 PM, Juan Orti Alcaine wrote:
>>
>> 2017-08-24 9:54 GMT+02:00 Juan Orti Alcaine <j.orti.alca...@gmail.com>:
>>>
>>> Hi,
>>>
>>> I'm getting failed builds [1] in rawhide and f27 because the macro
>>> %py3_install fails when called with arguments. It was fine until f26.
>>>
>>> The package is rhythmbox-ampache, and I call the macro like this:
>>>
>>>
>>> %global py_install_args --no-glib-compile-schemas
>>
>>
>> Enquoting the value seems to fix it !?
>>
>> %global py_install_args "--no-glib-compile-schemas"
>
>
> Sorry I missed the initial email on this because the subject didn't seem
> like there'd be anything rpm-related inside.
>
> Previously working macros now reporting "invalid option -- '-'" is a
> side-effect of macro argument expansion. For the impatient, the solution is
> NOT to quote, but use a '--' to indicate end of macro options in the caller.
> This is compatible with older versions of rpm too. Ie use:
>
>         %py3_install -- %py_install_args
>
> The longer version for the less impatient, using a simplified version of
> %py3_install as an example:
>
> ---
> %define py3_install()\
>      %{__python3} %{?py_setup_args} install %{?*}
>
> %global py_install_args --no-glib-compile-schemas
>
> %py3_install %py_install_args
> ---
>
> In older versions of rpm, %py3_install would receive a literal
> "%py_install_args" as it's first argument, ie %{1}. This would then get
> expanded *inside* the %py3_install macro via the %{?*}.
>
> In the new world order, any macros in the arguments are expanded *before*
> executing %py3_install, so it's called as if you had written
>
>         %py3_install --no-glib-compile-schemas
>
> ... and now the macro engine thinks --no-glib-compile-schemas is supposed to
> be an option to the %py3_install macro itself and you get an error about
> invalid option. Older rpm versions will give the invalid option error in
> this situation too.
>
> As already mentioned, the simple fix that is also compatible with older
> versions too is to use '--' to indicate end of macro arguments in the caller
> to remove any ambiguity on whose options these are.


Thanks for the explanation, I will do as you say.
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

Reply via email to