Diametric
20th July 2011, 02:53 AM
Hola,
I've been successful so far in getting my first rpm built, but it seems I am not getting something right when attempting to run a "scriptlet' in the %pre section.
Specifically, I have the following:
%pre
if [ -s /etc/myfile ] then
mv /etc/myfile /etc/myfile.bak;
touch /etc/myfile
fi
Now, I think my logic is clear and correct, and I have read the fedora/rpm/wiki on the scriptlets section. However my rpm installs but the above code does not appear to be processing correctly - actually, not at all. IS there a #!/bin/sh needed or some other such formatting I'm unaware of?
Thanks for your help.
I've been successful so far in getting my first rpm built, but it seems I am not getting something right when attempting to run a "scriptlet' in the %pre section.
Specifically, I have the following:
%pre
if [ -s /etc/myfile ] then
mv /etc/myfile /etc/myfile.bak;
touch /etc/myfile
fi
Now, I think my logic is clear and correct, and I have read the fedora/rpm/wiki on the scriptlets section. However my rpm installs but the above code does not appear to be processing correctly - actually, not at all. IS there a #!/bin/sh needed or some other such formatting I'm unaware of?
Thanks for your help.