[pkg-nvidia-devel] r1340 - /packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst

anbe-guest at users.alioth.debian.org anbe-guest at users.alioth.debian.org
Fri Jul 9 09:01:09 UTC 2010


Author: anbe-guest
Date: Fri Jul  9 09:00:53 2010
New Revision: 1340

URL: http://svn.debian.org/wsvn/pkg-nvidia/?sc=1&rev=1340
Log:
on the first install, do more validation/recovery on the diverted libGL.so symlink

Modified:
    packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst

Modified: packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst?rev=1340&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/libgl1-nvidia-glx.preinst Fri Jul  9 09:00:53 2010
@@ -21,11 +21,9 @@
 	# remove libGL.so created by obsolete nvidia-glx* init script
 	# otherwise we dpkg-divert --rename an unowned file
 	if [ -L /usr/lib/libGL.so ] && \
-		( [ ! -f /usr/lib/libGL.so ] \
-		|| [ "`readlink /usr/lib/libGL.so`" != "libGL.so.1" ] \
-		|| [ ! -e /usr/lib/libGL.so.1.2 ] )
+		[ "$(readlink /usr/lib/libGL.so)" != "libGL.so.1" ]
 	then
-		echo "Removing /usr/lib/libGL.so from unknown origin"
+		echo "Removing /usr/lib/libGL.so symlink from unknown origin."
 		rm -f /usr/lib/libGL.so
 	fi
 	# </target: squeeze>
@@ -92,6 +90,42 @@
 esac
 
 
+# <target: squeeze>
+if [ "$1" = "install" ]
+then
+
+	# <target: squeeze>
+	# do some validation of the diverted libGL.so
+
+	# check ownership of the original libGL.so
+	libGLso="$(dpkg-query -S /usr/lib/libGL.so 2>/dev/null | grep -v '^diversion by' || true)"
+
+	if [ -L /usr/lib/nvidia/diversions/libGL.so ] && \
+		[ -z "$libGLso" ]
+	then
+		echo "Removing diverted libGL.so symlink owned by no package."
+		rm /usr/lib/nvidia/diversions/libGL.so
+	fi
+
+	if [ -L /usr/lib/nvidia/diversions/libGL.so ] && \
+		[ "`readlink /usr/lib/nvidia/diversions/libGL.so`" != "libGL.so.1" ]
+	then
+		echo "Removing diverted libGL.so symlink with unexpected target."
+		rm /usr/lib/nvidia/diversions/libGL.so
+	fi
+
+	if [ ! -L /usr/lib/nvidia/diversions/libGL.so ] && \
+		[ -n "$libGLso" ]
+	then
+		echo "Restoring diverted libGL.so symlink."
+		ln -s libGL.so.1 /usr/lib/nvidia/diversions/libGL.so
+	fi
+	# </target: squeeze>
+
+fi
+# </target: squeeze>
+
+
 #DEBHELPER#
 
 exit 0




More information about the Pkg-nvidia-devel mailing list