From a6d02feba744506490bfa5a28a9f787692003c03 Mon Sep 17 00:00:00 2001 From: Evan Lezar <7723350-elezar@users.noreply.gitlab.com> Date: Mon, 27 Feb 2023 12:36:49 +0000 Subject: [PATCH] Merge branch 'fix-rpm-postun-scriptlet' into 'main' nvidia-container-toolkit.spec: fix syntax error in postun scriptlet See merge request nvidia/container-toolkit/container-toolkit!309 --- packaging/rpm/SPECS/nvidia-container-toolkit.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index f206f632..ac47cfa2 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -65,7 +65,9 @@ rm -rf %{_localstatedir}/lib/rpm-state/nvidia-container-toolkit ln -sf %{_bindir}/nvidia-container-runtime-hook %{_bindir}/nvidia-container-toolkit %postun -if [ -L %{_bindir}/nvidia-container-toolkit ] then; rm -f %{_bindir}/nvidia-container-toolkit; fi +if [ "$1" = 0 ]; then # package is uninstalled, not upgraded + if [ -L %{_bindir}/nvidia-container-toolkit ]; then rm -f %{_bindir}/nvidia-container-toolkit; fi +fi %files %license LICENSE