[pkg-nvidia-devel] r991 - in /packages/nvidia-graphics-drivers/trunk/debian: changelog nvidia-glx.links.in nvidia-glx.postinst nvidia-glx.postrm.in nvidia-glx.triggers

anbe-guest at users.alioth.debian.org anbe-guest at users.alioth.debian.org
Thu Jun 3 13:28:32 UTC 2010


Author: anbe-guest
Date: Thu Jun  3 13:28:19 2010
New Revision: 991

URL: http://svn.debian.org/wsvn/pkg-nvidia/?sc=1&rev=991
Log:
use a trigger to create /usr/lib/libGL.so (only if libgl1-mesa-dev is installed)

Added:
    packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.triggers
Modified:
    packages/nvidia-graphics-drivers/trunk/debian/changelog
    packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in
    packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst
    packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm.in

Modified: packages/nvidia-graphics-drivers/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/changelog?rev=991&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/changelog (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/changelog Thu Jun  3 13:28:19 2010
@@ -28,9 +28,12 @@
   * add/update old NEWS entries about the legacy drivers
   * stop creating/removing /usr/lib/libGL.so in the maintainer scripts and the
     init script (closes: #422002, #546210)
-  * nvidia-glx{,-ia32}: ship (possibly dangling) /usr/lib{,32}/libGL.so
-    symlink pointing to the diverted libGL.so.1.2 from libgl1-mesa-glx for
-    linking with the MESA OpenGL implementation by default via ... -lGL ...
+  * link with the MESA OpenGL implementation by default when compiling with
+    ... -lGL ...
+    - nvidia-glx: add a dpkg trigger to handle creating/removing of
+      /usr/lib/libGL.so depending on the state of libgl1-mesa-dev
+    - nvidia-glx-ia32: ship /usr/lib32/libGL.so symlink pointing to the
+      diverted libGL.so.1.2 from ia32-libs
   * nvidia-glx-{dev,ia32}: ship /usr/lib{,32}/nvidia/libGL.so, allowing
     explicit linking with the NVIDIA OpenGL implementation via
     ... -L/usr/lib/nvidia -lGL ...

Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in?rev=991&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in Thu Jun  3 13:28:19 2010
@@ -6,4 +6,3 @@
 usr/lib/xorg/modules/extensions/libglx.so.#VERSION#	usr/lib/xorg/modules/extensions/libglx.so
 usr/lib/libXvMCNVIDIA.so.#VERSION#			usr/lib/libXvMCNVIDIA.so.1
 usr/lib/libXvMCNVIDIA.so.#VERSION#			usr/lib/libXvMCNVIDIA_dynamic.so.1
-usr/lib/nvidia/libGL.so.1.2.xlibmesa			usr/lib/libGL.so

Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst?rev=991&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst Thu Jun  3 13:28:19 2010
@@ -4,6 +4,23 @@
 # see: dh_installdeb(1)
 
 set -e
+
+# A trigger that handles creating/removing /usr/lib/libGL.so
+if [ "$1" = "triggered" ]; then
+	LINK_origin=/usr/lib/libGL.so
+	LINK_diverted=/usr/lib/nvidia/libGL.so.xlibmesa
+	LINK_create=nvidia/libGL.so.1.2.xlibmesa
+
+	if [ -L "$LINK_origin" ] && [ ! -L "$LINK_diverted" ]; then
+		# libgl-mesa-dev was removed, drop libGL.so
+		echo "$DPKG_MAINTSCRIPT_PACKAGE: Removing $LINK_origin"
+		rm -f "$LINK_origin"
+	elif [ ! -L "$LINK_origin" ] && [ -L "$LINK_diverted" ]; then
+		# libgl-mesa-dev was installed, create libGL.so
+		echo "$DPKG_MAINTSCRIPT_PACKAGE: Creating $LINK_origin"
+		ln -s "$LINK_create" "$LINK_origin"
+	fi
+fi
 
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
@@ -50,9 +67,20 @@
         fi
         # </target: squeeze>
 
+        # <target: squeeze>
+	# remove libGL.so created before the trigger was introduced
+	# will be recreated by the trigger
+	if dpkg --compare-versions "$2" lt-nl 195.36.24-3 ; then
+		rm -f /usr/lib/libGL.so
+	fi
+        # </target: squeeze>
+
+	# activate our trigger
+	dpkg-trigger /usr/lib/libGL.so
+
     ;;
 
-    abort-upgrade|abort-remove|abort-deconfigure)
+    abort-upgrade|abort-remove|abort-deconfigure|triggered)
     ;;
 
     *)

Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm.in
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm.in?rev=991&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm.in (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm.in Thu Jun  3 13:28:19 2010
@@ -29,14 +29,13 @@
 #
 # Remove our diversions at the remove stage, since even if we have
 # configuration files left, we want to put back everything we moved.  Do not
-# try to do this again on purge since remove will have already been called,
-# and since the rm of /usr/lib/libGL.so will remove someone else's version at
-# that point.
+# try to do this again on purge since remove will have already been called.
 #
 # In the abort-install case, we may have gotten far enough to create our
-# diversions in our preinst, so back out of them.  Don't remove
-# /usr/lib/libGL.so, since that may still be owned by another package and
-# since we don't create that in preinst.
+# diversions in our preinst, so back out of them.
+#
+# Remove /usr/lib/libGL.so only if we still own a diversion of it, since the
+# link may have been created by our trigger in postinst or later.
 #
 # Leave all of our diversions alone during upgrades or aborted upgrades, since
 # we're staying installed in all cases and the diversions are still correct.
@@ -48,6 +47,12 @@
 
 case "$1" in
     remove|abort-install)
+
+	if [ -L /usr/lib/libGL.so ] && \
+           [ "`dpkg-divert --listpackage /usr/lib/libGL.so`" = "nvidia-glx" ]; then
+		echo "Removing /usr/lib/libGL.so created by nvidia-glx."
+		rm -f /usr/lib/libGL.so
+	fi
 
 	dpkg-divert --remove --rename --package nvidia-glx --divert /usr/lib/nvidia/libGL.so.1.xlibmesa /usr/lib/libGL.so.1 > /dev/null
 	dpkg-divert --remove --rename --package nvidia-glx --divert /usr/lib/nvidia/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2 > /dev/null

Added: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.triggers
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.triggers?rev=991&op=file
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.triggers (added)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.triggers Thu Jun  3 13:28:19 2010
@@ -1,0 +1,2 @@
+interest /usr/lib/libGL.so
+interest /usr/lib/nvidia/libGL.so.xlibmesa




More information about the Pkg-nvidia-devel mailing list