我需要使用rpmrebuild重新构建RPM,其中我需要修改spec文件中的Requires:
行。
命令:
rpmrebuild --edit-spec --notest-install --package <rpm-name>
Do you want to continue ? (y/N) y
result: <updated-rpm-name>
规格文件中的更改:
由rpmbuild -ba <spec-file>
生成的旧规格文件:
Requires: python(abi) = 3.8
运行rpmrebuild后,它将打开vi编辑器,我需要在其中修改spec文件,如下所示:
### Comment out this line
# Requires: python(abi) = 3.8
### Add this line
Requires: rh-python38
问题
我怎样才能在非交互模式下运行这个呢?换句话说,我只想运行rpmrebuild而不打开文件,只在命令行中指定更改。类似于:
rpmrebuild --replace-requires --old-requires=python(abi)=3.8 --new-requires=rh-python38 <rpm-name>
我看到rpmrebuild的插件:https://www.mankier.com/1/rpmrebuild#--change-spec-requires
但是我不确定在这里怎么用,请告诉我。
1条答案
按热度按时间qpgpyjmq1#
我想出了解决办法:
我们可以使用
sed
命令将其替换并传递给--change-spec-requires
,如下所示:这个example帮助我: