Timing problem with '%buildsubdir'
lkardos at redhat.com
Tue Mar 1 12:39:42 UTC 2016
It's because the way how parsePrep() is implemented. First it reads all lines
in %prep section (parsePrep.c:545,555) during this process all macros are
expanded and then it looks for %setup in these read lines (parsePrep.c:557,569)
and if it finds it, function doSetup() is executed. So doSetup() is executed
and macro %buildsubdir is defined after all macros in %prep section are
So I think that it behaves as it behaves only because the way how it is
implemented. I don't think that there is some rule that the macro %buildsubdir
shouldn't be defined in %prep section.
----- Original Message -----
> From: "Andreas Scherer" <andreas.scherer at alice.de>
> To: rpm-list at lists.rpm.org
> Sent: Sunday, January 31, 2016 10:27:45 AM
> Subject: Timing problem with '%buildsubdir'
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Why is macro '%buildsubdir' not available in section '%prep'?
> According to the comment in 'macros[.in]', '%buildsubdir' is "set
> after processing %setup", but there seems to be a timing problem in
> setting and resolving this particular item.
> %setup -c
> produces "<<<PREP:%buildsubdir>>>, i.e., the macro is _not_ set at
> this point, while a later
> produces the expected <<<BUILD:sgb-20090810>>>. (Using
> 'https://github.com/ascherer/sgb/blob/local/sgb.spec' as example.)
> Internally, 'doSetupMacro()' uses 'spec->buildSubdir' for referencing
> the project building area, and calls 'addMacro(...,"buildsubdir",...)'
> on the way.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (GNU/Linux)
> -----END PGP SIGNATURE-----
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
More information about the Rpm-list