Can I use rpm to expand the macros in a specfile?

后端 未结 5 1653
时光取名叫无心
时光取名叫无心 2021-02-01 20:06

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

5条回答
  •  深忆病人
    2021-02-01 20:44

    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 for them and feed them to rpm as your custom macros file.

提交回复
热议问题