rpmbuild - when does a macro defined by a conditional rpm macro get expanded? -
if have macro defined globally as:
%{!?patch_file_list: %global patch_file_list %(pfl=$(mktemp -t); ls %{_topdir}/sources/*.patch | sort > $pfl; echo $pfl)}
and use in %prep
section, assured %{patch_file_list}
contain name of file returned mktemp -t
, file contain list of patch files ?
when macro defined %global patch_file_list ...
expanded ? when defined globally or when used first time in %prep
section ?
a conditional macro expansion expands body (i.e. following colon matching right curly brace) if test macro defined (note definition %{nil} valid definition).
macros expanded when encountered; in case, when spec file being parsed before %prep section executed.
what may confusing conditional expansion defines same macro name being tested.
Comments
Post a Comment