From: Krzysztof Malysa Date: Fri, 14 Feb 2025 13:02:18 +0000 (+0100) Subject: Fix %postun being called on the end of package upgrade/reinstall making tests fail X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc0536bc144cb08dc60ea0fdaf47b4ddc0a3d18f;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Fix %postun being called on the end of package upgrade/reinstall making tests fail Change-Id: Id3796fbfbdd43f1e5a1dd46b42ba9546f3ef68cb --- diff --git a/packaging/security-tests.spec b/packaging/security-tests.spec index f1409870..354097e9 100644 --- a/packaging/security-tests.spec +++ b/packaging/security-tests.spec @@ -144,4 +144,8 @@ echo "security-tests postinst done ..." %{sm_test_dir} %postun -id -u security_test_user 1>/dev/null 2>&1 && gum-utils -o -d --uid=`id -u security_test_user` +# RPM has irrational order of calling %postun during upgrade and reinstallation: first it installs +# new version, then it uninstalls old version and calls %postun, hence the below if... +if [ $1 = 0 ]; then + id -u security_test_user 1>/dev/null 2>&1 && gum-utils -o -d --uid=`id -u security_test_user` +fi