On Tue, Mar 02, 2010 at 03:00:56PM +0100, Jonas Smedegaard wrote:

> From a quick glance it looks to me that you are moving around a conffile  
> in a packaging script.  It is tricky to do so properly - an example of  
> what might else happen is users getting confusing questions if they want  
> to preserve or overwrite "their" changes at package update.

Right.

> When switching from non-confile to conffile (which seems to be the case  
> here) there are (complex) ways to handle that properly by using ucf  
> instead and hashing the older default config files.

What do you think about the attached patch? Is it worth the effort or
should we just simply stick to the dpkg way?


Cheerio

-- 
mail: a...@thur.de      http://adi.thur.de      PGP/GPG: key via keyserver
>From c129122e92feaafce44aebcf2571e5daee918c0c Mon Sep 17 00:00:00 2001
From: Adrian Knoth <a...@drcomp.erfurt.thur.de>
Date: Mon, 8 Mar 2010 20:56:16 +0100
Subject: [PATCH] Switch to ucf.

Jonas suggested to use ucf instead of dpkg for audio.conf
---
 debian/jackd.examples |    1 +
 debian/jackd.install  |    1 -
 debian/jackd.postinst |    2 +-
 debian/jackd.postrm   |    1 +
 4 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/debian/jackd.examples b/debian/jackd.examples
index 87bfe17..6c6b2a4 100644
--- a/debian/jackd.examples
+++ b/debian/jackd.examples
@@ -1 +1,2 @@
 debian/asound.rc
+debian/audio.conf
diff --git a/debian/jackd.install b/debian/jackd.install
index c4b2175..5db77be 100644
--- a/debian/jackd.install
+++ b/debian/jackd.install
@@ -1,4 +1,3 @@
 debian/tmp/usr/bin/jack*
 debian/tmp/usr/share/*
 debian/bash_completion.d etc
-debian/audio.conf etc/security/limits.d
diff --git a/debian/jackd.postinst b/debian/jackd.postinst
index 6cb11b5..9726539 100644
--- a/debian/jackd.postinst
+++ b/debian/jackd.postinst
@@ -7,7 +7,7 @@ CONFIG_FILE=/etc/security/limits.d/audio.conf
 
 db_get jackd/tweak_rt_limits
 if [ $RET = "true" ]; then
-    mv ${CONFIG_FILE}.disabled ${CONFIG_FILE} || true
+    ucf --debconf-ok /usr/share/doc/jackd/examples/audio.conf /etc/security/limits.d/audio.conf
 else
     # user doesn't want RT prio
     mv $CONFIG_FILE ${CONFIG_FILE}.disabled || true
diff --git a/debian/jackd.postrm b/debian/jackd.postrm
index 605917c..9bfd3fd 100644
--- a/debian/jackd.postrm
+++ b/debian/jackd.postrm
@@ -7,6 +7,7 @@ if [ "$1" = "purge" ]
 then
     if [ -e $CONFIG_FILE ]
     then
+        ucf --purge /etc/security/limits.d/audio.conf
         rm $CONFIG_FILE
     fi
 
-- 
1.7.0

_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to