如何从 %pre 脚本中获取 RPM 的版本?

How to get the version of the RPM from inside the %pre script?

如何从 %pre 脚本中获取 RPM 的版本?

不就是%{version}吗?该宏将根据需要在您的 %pre 脚本中展开。