Can I use rpm to expand the macros in a specfile?
问题 The concrete example being I have lots of specfiles with Source0 : or other Source lines containing macros. How can I have these macros expanded without actually starting a build on the specfile or writing my own parser? 回答1: You could grep to get the Source lines, sed to extract the string containing the macro and then rpm --eval 'string' to evaluate it. Note that this will only expand the global macros, not the ones defined in this spec. To expand those as well you'd probably need to grep