On 06/18/2018 06:00 PM, Eric Schirra wrote:
Do you have try with?:
if [ $1 -eq 2 ]; then service google-network-daemon start fi
See: https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
Yes, that doesn't make any difference. Putting it into quotes just turns the integer expression into a string. Thus, it doesn't really make a difference whether you compare $1 and 2 or "$1" and "2". However, comparing the strings has the advantage that you don't risk running into syntax error when $1 is unset: glaubitz@suse-laptop:~> if [ $1 -ne 0 ] ; then echo "Hello" ; fi bash: [: -ne: unary operator expected glaubitz@suse-laptop:~> if ! [ "$1" == "0" ] ; then echo "Hello" ; fi Hello glaubitz@suse-laptop:~> As mentioned before, the problem is that the build fails because osc tries installing the package after building it which will also invoke the service commands. What I don't understand is that for the test installation, "$1" is equal to "2". But I assume that's because it's testing both upgrades as well as installation. Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org