From 8beb7b4231d7e73cc89dbb3a832924c1d5585756 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 19 Sep 2022 15:31:10 +0200 Subject: [PATCH] Only remove nvidia-container-toolkit if it is a symlink Signed-off-by: Evan Lezar --- packaging/rpm/SPECS/nvidia-container-toolkit.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/rpm/SPECS/nvidia-container-toolkit.spec b/packaging/rpm/SPECS/nvidia-container-toolkit.spec index 24dd48fa..0c21b9bd 100644 --- a/packaging/rpm/SPECS/nvidia-container-toolkit.spec +++ b/packaging/rpm/SPECS/nvidia-container-toolkit.spec @@ -56,7 +56,7 @@ install -m 644 -t %{buildroot}/usr/share/containers/oci/hooks.d oci-nvidia-hook. ln -sf %{_bindir}/nvidia-container-runtime-hook %{_bindir}/nvidia-container-toolkit %postun -rm -f %{_bindir}/nvidia-container-toolkit +if [ -L %{_bindir}/nvidia-container-toolkit ] then; rm -f %{_bindir}/nvidia-container-toolkit; fi %files %license LICENSE