[opensuse-packaging] Sricplet in spec
Hello, i hope someone can help me. I wan't to add scriptlet in spec. It should run only at upgrade a package not run by new install. So i insert something like: %post if [ "$1" = 2 ]; then %{_bindir}/php %{my_path}/%{name}/console param fi I have try [ "$1" -gt 1 ] too without right result. Obs will run this at build. And so an error is rising up. Can i prevent this from running at build? It should run only at package-install or upgrade. Or is something wrong at my code? Or is something missing in Requires? Best regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Saturday 2015-06-13 12:59, Eric Schirra wrote:
So i insert something like:
%post if [ "$1" = 2 ]; then %{_bindir}/php %{my_path}/%{name}/console param fi
I have try [ "$1" -gt 1 ] too without right result.
1 is install, 2 is upgrade.
Obs will run this at build.
Yes. You have to cope with failure in %post.
Can i prevent this from running at build?
Don't run the command at all? What does it do, anyway? Why do you need it in %post? Why can it not be run at a later time? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am Samstag, 13. Juni 2015, 16:22:14 schrieb Jan Engelhardt:
On Saturday 2015-06-13 12:59, Eric Schirra wrote:
So i insert something like:
%post if [ "$1" = 2 ]; then
%{_bindir}/php %{my_path}/%{name}/console param
fi
I have try [ "$1" -gt 1 ] too without right result.
1 is install, 2 is upgrade.
Obs will run this at build.
Yes. You have to cope with failure in %post.
Can i prevent this from running at build?
Don't run the command at all? What does it do, anyway? Why do you need it in %post? Why can it not be run at a later time?
It can run later. It must only run sometime after upgrade the program I want upgrade one database when the program self is updated. Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Saturday 2015-06-13 17:18, Eric Schirra wrote:
Don't run the command at all? What does it do, anyway? Why do you need it in %post? Why can it not be run at a later time?
It can run later. It must only run sometime after upgrade the program I want upgrade one database when the program self is updated.
Yeah so why does the program not do this on its own the next time it is started? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (2)
-
Eric Schirra
-
Jan Engelhardt