From eb20b9b2fea727b7f53b8b19f904b11ae57e0c21 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Tue, 20 Aug 2013 17:35:08 +0000 Subject: [PATCH] Remove .run installed driver if present on pre-installation --- xorg-x11-drv-nvidia.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xorg-x11-drv-nvidia.spec b/xorg-x11-drv-nvidia.spec index f98a200..330031f 100644 --- a/xorg-x11-drv-nvidia.spec +++ b/xorg-x11-drv-nvidia.spec @@ -240,6 +240,12 @@ sed -i -e "s/__USER__/root/" $RPM_BUILD_ROOT%{_unitdir}/nvidia-persistenced.serv mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/nvidia +%pre +if [ "$1" -eq "1" ]; then + if [ -x %{_bindir}/nvidia-uninstall ]; then + %{_bindir}/nvidia-uninstall -s && rm -f %{_bindir}/nvidia-uninstall &>/dev/null || : + fi +fi %post if [ "$1" -eq "1" ]; then