[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#659440: Patch for bumblebee package



Hi,

attached is a patch for the bumblebee package to properly handle the
configuration files stored in /etc/bumblebee. For some reason, the
package used to not ship these files, but instead copy them in postinst,
which means users would not be prompted about changes in the default
configuration, nor obtain an updated configuration if they did not
change the file.

I also simplieifed debian/rules a bit in favour of using
debian/bumblebee.install to give additional files which are included in
the package. The bash-completion file is installed by "make install", so
there's no need to do that again.

Kind regards,
Ralf
>From 23f3310b78ecace5fba1c92fac0e55544f0eb8df Mon Sep 17 00:00:00 2001
From: Ralf Jung <post@ralfj.de>
Date: Wed, 6 Mar 2013 21:47:23 +0100
Subject: [PATCH] Make the files in /etc conffiles and use
 debian/bumblebee.install instead of manually calling
 dh_install or cp

copying the bash_completion file is no longer needed, "make install" does that
---
 debian/bumblebee.install |    2 ++
 debian/postinst          |    6 ------
 debian/postrm            |    1 +
 debian/rules             |   14 --------------
 4 files changed, 3 insertions(+), 20 deletions(-)
 create mode 100644 debian/bumblebee.install

diff --git a/debian/bumblebee.install b/debian/bumblebee.install
new file mode 100644
index 0000000..f6931c5
--- /dev/null
+++ b/debian/bumblebee.install
@@ -0,0 +1,2 @@
+debian/bumblebee/etc/bumblebee/*	usr/share/bumblebee/default-conf/
+scripts/systemd/bumblebeed.service	lib/systemd/system/
diff --git a/debian/postinst b/debian/postinst
index 5a06623..76cf24e 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -14,12 +14,6 @@ USE_GROUPS='adm sudo admin'
 
 case "$1" in
   configure)
-    for file in bumblebee.conf xorg.conf.nvidia xorg.conf.nouveau; do
-        if [ ! -f /etc/bumblebee/$file ]; then
-            cp -p /usr/share/bumblebee/default-conf/$file /etc/bumblebee/
-        fi
-    done
-
     # only add a group and members if the configured group does match the
     # default group and if the group is missing
     if grep -qx ServerGroup=$BB_GROUP /etc/bumblebee/bumblebee.conf &&
diff --git a/debian/postrm b/debian/postrm
index 24f2c6d..95f7ec8 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -9,6 +9,7 @@ set -e
 case "$1" in
   purge)
     groupdel bumblebee || true
+    # keep this as old versions did not mark these files as conffiles
     for file in bumblebee.conf xorg.conf.nvidia xorg.conf.nouveau; do
         rm -f /etc/bumblebee/$file
     done
diff --git a/debian/rules b/debian/rules
index 90e38e7..fe4008f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,20 +23,6 @@ endif
 
 override_dh_auto_install:
 	dh_auto_install --destdir=debian/bumblebee/
-	dh_installdirs usr/share/bumblebee/default-conf
-	mv debian/bumblebee/etc/bumblebee/* \
-		debian/bumblebee/usr/share/bumblebee/default-conf/
-	dh_installdirs lib/systemd/system
-	cp scripts/systemd/bumblebeed.service \
-	    debian/bumblebee/lib/systemd/system/bumblebeed.service
-
-override_dh_install:
-	dh_install
-	# Use our own sysvinit script instead of the one distributed upstream
-	#cp scripts/sysvinit/bumblebeed debian/bumblebee.bumblebeed.init
-	#cp scripts/upstart/bumblebeed.conf debian/bumblebee.bumblebeed.upstart
-	cp scripts/bash_completion/bumblebee \
-	    debian/bumblebee/etc/bash_completion.d/bumblebee
 
 override_dh_installinit:
 	dh_installinit --name=bumblebeed
-- 
1.7.10.4


Reply to: