Package: lirc
Version: 0.7.1pre2-6
Severity: normal
Tags: patch

Some variables in my /etc/lirc/hardware.conf (attached) are set in an
indented line. lirc's postinst fails to detect that these are
correctly set, and adds lines to set these. I simply deleted these
lines at first, but they are of course re-added on the next upgrade...

(Isn't modifying a conffile a policy violation as well? Anyway, I'd
prefer a debconf question: "Your hardware.conf seems broken? [Fix it
for me] [I will fix it myself] [Don't tell me again]")

I am attaching a simple-minded patch that at least handles indented
lines. Perhaps a better strategy would be to source hardware.conf and
check if the variables are then set.
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#Don't start lircmd even if there seems to be a good config file
START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
if [ $(uname -r | cut -d. -f2) -le 4 ]; then
  MODULES="lirc_dev lirc_i2c"
  DRIVER="default"
  DEVICE="/dev/lirc"
else
  MODULES="bttv ir-kbd-i2c"
  DRIVER="dev/input"
  DEVICE="/dev/input/event2"
fi

# Default configuration files for your hardware if any
LIRCD_CONF="hauppauge/lircd.conf.hauppauge"
LIRCMD_CONF="hauppauge/lircmd.conf.hauppauge"
--- /var/lib/dpkg/info/lirc.postinst    2005-03-28 23:11:49.000000000 +0200
+++ /var/lib/dpkg/info/lirc.postinst+   2005-04-04 20:01:19.608919424 +0200
@@ -51,7 +51,7 @@
        local VAR
        for VAR in DRIVER MODULES DEVICE LIRCD_CONF LIRCMD_CONF
        do
-               if ! grep -q "^$VAR\>" /etc/lirc/hardware.conf; then
+               if ! grep -q "^[        ]*$VAR\>" /etc/lirc/hardware.conf; then
                        echo "$VAR=\"UNCONFIGURED\"" >> /etc/lirc/hardware.conf
                fi
        done

Reply via email to