[pkg-nvidia-devel] r1291 - in /packages/nvidia-graphics-drivers/trunk/debian: nvidia-glx.postrm nvidia-glx.preinst

anbe-guest at users.alioth.debian.org anbe-guest at users.alioth.debian.org
Sun Jul 4 17:26:40 UTC 2010


Author: anbe-guest
Date: Sun Jul  4 17:26:37 2010
New Revision: 1291

URL: http://svn.debian.org/wsvn/pkg-nvidia/?sc=1&rev=1291
Log:
move the diversion of libglx.so to /usr/lib/nvidia/diversions

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

Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm?rev=1291&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm Sun Jul  4 17:26:37 2010
@@ -39,11 +39,10 @@
 	fi
 
 	dpkg-divert $DIVERT_QUIET --remove --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
-		/usr/lib/nvidia/libglx.so.xlibmesa \
+		/usr/lib/nvidia/diversions/libglx.so \
 		/usr/lib/xorg/modules/extensions/libglx.so
 
-	test ! -d /usr/lib/nvidia || \
-		rmdir /usr/lib/nvidia || true;
+	rmdir /usr/lib/nvidia/diversions /usr/lib/nvidia 2>/dev/null || true
 
 	# work around dpkg-divert bug #581544: useless errors on not writable destination if source does not exist
 	rmdir /usr/lib/xorg/modules/extensions /usr/lib/xorg/modules /usr/lib/xorg 2>/dev/null || true

Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst?rev=1291&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst Sun Jul  4 17:26:37 2010
@@ -3,6 +3,11 @@
 
 
 #DIVERT_QUIET="--quiet"
+
+exists()
+{
+	test -e "$1" || test -L "$1"
+}
 
 # <target: squeeze>
 dpkg-maintscript-helper rm_conffile /etc/default/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-1~ -- "$@"
@@ -14,12 +19,46 @@
     install|upgrade)
 
 	# the destination directory for the diversions
-	test -d /usr/lib/nvidia || \
-		mkdir -p /usr/lib/nvidia || true
+	test -d /usr/lib/nvidia/diversions || \
+		mkdir -p /usr/lib/nvidia/diversions || true
+
+	# <target: squeeze>
+	# update the diversion
+        if dpkg --compare-versions "$2" lt-nl 195.36.31
+	then
+		file_orig="/usr/lib/xorg/modules/extensions/libglx.so"
+		file_old_divert="/usr/lib/nvidia/libglx.so.xlibmesa"
+		file_new_divert="/usr/lib/nvidia/diversions/libglx.so"
+		old_diverter="`dpkg-divert --listpackage $file_orig`"
+
+		if [ -n "$old_diverter" ]
+		then
+			# avoid dpkg-divert --add --rename in upgrade scenarios,
+			# it might rename *our* existing file -- see dpkg bug #588077
+
+			dpkg-divert --remove --package $old_diverter --divert \
+				"$file_old_divert" \
+				"$file_orig"
+			if exists "$file_old_divert"
+			then
+				echo "Moving $file_old_divert to $file_new_divert"
+				mv "$file_old_divert" "$file_new_divert"
+			fi
+			dpkg-divert --add --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
+				"$file_new_divert" \
+				"$file_orig"
+		fi
+		if exists "$file_old_divert"
+		then
+			echo "ERROR: $file_old_divert does still exist. Aborting."
+			exit 1
+		fi
+	fi
+	# </target: squeeze>
 
 	# make new diversions
 	dpkg-divert $DIVERT_QUIET --add --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
-		/usr/lib/nvidia/libglx.so.xlibmesa \
+		/usr/lib/nvidia/diversions/libglx.so \
 		/usr/lib/xorg/modules/extensions/libglx.so
 
     ;;




More information about the Pkg-nvidia-devel mailing list