Am 07.03.2009 um 07:25 schrieb Harald Dunkel:

> Obviously this patch wasn't complete. Below is a
> better one.
>
> diff -ur nvidia-kernel-common-20080825+1/debian/changelog 
> nvidia-kernel-common-20080825+1+nmu1/debian/changelog
> --- nvidia-kernel-common-20080825+1/debian/changelog  2008-09-01 
> 20:22:35.000000000 +0200
> +++ nvidia-kernel-common-20080825+1+nmu1/debian/changelog     2009-03-07 
> 07:22:21.000000000 +0100
> @@ -1,3 +1,10 @@
> +nvidia-kernel-common (20080825+1+nmu1) unstable; urgency=low
> +
> +  * Non-maintainer upload.
> +  * rename modprobe config file to nvidia-kernel-nkc.conf (closes: #518566)
> +
> + -- Harald Dunkel <harald.dun...@t-online.de>  Sat, 07 Mar 2009 07:21:49 
> +0100
> +
>  nvidia-kernel-common (20080825+1) unstable; urgency=medium
>  
>    * Change maintainer. 
> diff -ur nvidia-kernel-common-20080825+1/debian/preinst 
> nvidia-kernel-common-20080825+1+nmu1/debian/preinst
> --- nvidia-kernel-common-20080825+1/debian/preinst    2008-08-25 
> 22:51:21.000000000 +0200
> +++ nvidia-kernel-common-20080825+1+nmu1/debian/preinst       2009-03-07 
> 07:16:30.000000000 +0100
> @@ -7,6 +7,9 @@
>               rm -f /etc/devfs/conf.d/nvidia-kernel-nkc
>               rm -f /etc/modutils/nvidia-kernel-nkc
>       fi
> +     if dpkg --compare-versions "$2" le-nl '20080825+1'; then
> +             rm -f /etc/modprobe.d/nvidia-kernel-nkc
> +     fi
>  fi
>  
>  #DEBHELPER#
> diff -ur nvidia-kernel-common-20080825+1/debian/rules 
> nvidia-kernel-common-20080825+1+nmu1/debian/rules
> --- nvidia-kernel-common-20080825+1/debian/rules      2008-08-26 
> 18:50:25.000000000 +0200
> +++ nvidia-kernel-common-20080825+1+nmu1/debian/rules 2009-03-07 
> 06:45:36.000000000 +0100
> @@ -21,7 +21,7 @@
>  
>       dh_installinit --name=nvidia-kernel -- start 20 2 3 4 5 . stop 20 1 .
>  
> -     install -D -m 0644 nvidia-kernel.modules-2.6 
> debian/nvidia-kernel-common/etc/modprobe.d/nvidia-kernel-nkc
> +     install -D -m 0644 nvidia-kernel.modules-2.6 
> debian/nvidia-kernel-common/etc/modprobe.d/nvidia-kernel-nkc.conf
>  
>  
>  # Build architecture-independent files here.

This one is still not good, since it fails to preserve local
modifications.  Here is a patch that does this, shamelessly stolen from
the Ubuntu package:

diff -Nru nvidia-kernel-common-20080825+1/debian/changelog nvidia-kernel-common-20080825+1+nmu1/debian/changelog
--- nvidia-kernel-common-20080825+1/debian/changelog	2008-09-01 20:22:35.000000000 +0200
+++ nvidia-kernel-common-20080825+1+nmu1/debian/changelog	2009-03-31 13:22:24.000000000 +0200
@@ -1,3 +1,11 @@
+nvidia-kernel-common (20080825+1+nmu1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Rename modprobe config file to nvidia-kernel-nkc.conf,
+    patch stolen from the Ubuntu package (closes: #518566).
+
+ -- Sven Joachim <svenj...@gmx.de>  Tue, 31 Mar 2009 13:18:57 +0200
+
 nvidia-kernel-common (20080825+1) unstable; urgency=medium
 
   * Change maintainer. 
diff -Nru nvidia-kernel-common-20080825+1/debian/postinst nvidia-kernel-common-20080825+1+nmu1/debian/postinst
--- nvidia-kernel-common-20080825+1/debian/postinst	1970-01-01 01:00:00.000000000 +0100
+++ nvidia-kernel-common-20080825+1+nmu1/debian/postinst	2009-03-05 21:13:25.000000000 +0100
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+	if [ -e "/etc/modprobe.d/nvidia-kernel-nkc" ]; then
+		echo "Preserving user changes to /etc/modprobe.d/nvidia-kernel-nkc.conf ..."
+		if [ -e "/etc/modprobe.d/nvidia-kernel-nkc.conf" ]; then
+			mv -f "/etc/modprobe.d/nvidia-kernel-nkc.conf" "/etc/modprobe.d/nvidia-kernel-nkc.conf.dpkg-new"
+		fi
+		mv -f "/etc/modprobe.d/nvidia-kernel-nkc" "/etc/modprobe.d/nvidia-kernel-nkc.conf"
+	fi
+fi
+
+#DEBHELPER#
diff -Nru nvidia-kernel-common-20080825+1/debian/preinst nvidia-kernel-common-20080825+1+nmu1/debian/preinst
--- nvidia-kernel-common-20080825+1/debian/preinst	2008-08-25 22:51:21.000000000 +0200
+++ nvidia-kernel-common-20080825+1+nmu1/debian/preinst	2009-03-31 13:14:35.000000000 +0200
@@ -9,4 +9,14 @@
 	fi
 fi
 
+if [ "$1" = install ] || [ "$1" = upgrade ]; then
+	if [ -e "/etc/modprobe.d/nvidia-kernel-nkc" ]; then
+		if [ "`md5sum \"/etc/modprobe.d/nvidia-kernel-nkc\" | sed -e \"s/ .*//\"`" = \
+		     "`dpkg-query -W -f='${Conffiles}' nvidia-kernel-common | sed -n -e \"\\\\' /etc/modprobe.d/nvidia-kernel-nkc's/.* //p\"`" ]
+		then
+			rm -f "/etc/modprobe.d/nvidia-kernel-nkc"
+		fi
+	fi
+fi
+
 #DEBHELPER#
diff -Nru nvidia-kernel-common-20080825+1/debian/rules nvidia-kernel-common-20080825+1+nmu1/debian/rules
--- nvidia-kernel-common-20080825+1/debian/rules	2008-08-26 18:50:25.000000000 +0200
+++ nvidia-kernel-common-20080825+1+nmu1/debian/rules	2009-03-31 13:14:42.000000000 +0200
@@ -21,7 +21,7 @@
 
 	dh_installinit --name=nvidia-kernel -- start 20 2 3 4 5 . stop 20 1 .
 
-	install -D -m 0644 nvidia-kernel.modules-2.6 debian/nvidia-kernel-common/etc/modprobe.d/nvidia-kernel-nkc
+	install -D -m 0644 nvidia-kernel.modules-2.6 debian/nvidia-kernel-common/etc/modprobe.d/nvidia-kernel-nkc.conf
 
 
 # Build architecture-independent files here.

Reply via email to