1

I have created a script for deployment using YUM and RPM. During the pre script, is it possible to know whats the version of the rpm I am deploying.

I want to create a backup file with the version of the RPM (in its name) so that i can trace back the version of the RPM file.

I am ok if it is some base unix or RPM or YUM command

1 Answer 1

1

I'm assuming you mean the version of the RPM file you're installing. In that case it's in the %version macro. However, you probably want the Release tag, too. So you probably want to do something like:

echo "{%version}-{%release}" > %{_datadir}/%{name}/rpmver

If you want the version of RPM itself:

rpm --version > %{_datadir}/%{name}/rpmver
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .