Reputation: 1030
I want to ship a file test.py with rpm. And I like to execute "python test.py" in %pre.
But file is not available as %install didn't execute. Is there any way to these stuff?
Upvotes: 0
Views: 499
Reputation: 80931
I know of no way to execute a file from your RPM package during %pre
.
The only possibility you might have would be to find where the current RPM is located on disk and manually extract your file out of it but I don't know if you can reliably (or easily) do that from within a %pre
script.
That all being said this sort of testing in %pre
is generally, I feel, a bad idea as there isn't anything useful you can do if the tests fail and bailing out is evil. And more generally these are the sorts of things that should probably be asserted by Requires:
entries in the rpm spec file.
Upvotes: 1