~ubuntu-branches/ubuntu/natty/lirc/natty

« back to all changes in this revision

Viewing changes to debian/lirc.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello, Jeremy Yoder, Mario Limonciello
  • Date: 2009-10-12 21:16:10 UTC
  • mfrom: (1.2.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20091012211610-z63bnon17ahmxgd1
Tags: 0.8.6-0ubuntu1
[ Jeremy Yoder ]
* Update to LIRC 0.8.6 release. (LP: #432678)
  - added support for ENE KB3926 revision B/C/D (ENE0100) CIR port
    (found on some notebooks, e.g: Acer Aspire 5720G, HP Pavilion dv5)
    (Maxim Levitsky)
  - New parameter for lircd: --repeat-max
  - merged 1st-gen mceusb device support into lirc_mceusb2,
    renamed lirc_mceusb2 to lirc_mceusb
  - added support for putting iMON receviers into MCE/RC6 mode
  - added input subsystem mouse device support to iMON driver
  - improved iMON driver to handle dual-interface iMON devices
    via a single lirc device, reducing configuration complexity
  - added support for more iMON devices, including proper support
    for touchscreen iMON devices (Rene Harder)
  - improved iMON driver including touchscreen support
  - Linux input support added to lircmd
  - added support for IT8720 CIR port
  - added support for XMP protocol
* Cleanup more_remotes.hwdb
* TODO:  Make changes to the "lircd.conf.atiusb" and
  "lircd.conf.hauppauge" files PATCHES instead of duplicates
* TODO:  Submit "lircd.conf.atiusb" and
  "lircd.conf.hauppauge" file patches upstream again
* Changed lirc init script to create socket in /var/run/lirc/lircd
  as is the new default, but also create a symlink /dev/lircd
  to point to it.  This makes all clients happy, old and new.
* Fix bug in dkms.conf.in, forgot to increment array number
  when adding ene0100 driver.
* Added the extra "Debian-only" remotes and transmitters back
  in, but in a different way.  I created a subdirectory 
  "debian/extras" and copy that to /usr/share/lirc/extras.
  This avoids patching the source.
  NOTE: CONFIG FILES IN BOTH LOCATIONS WILL USE THE "extras"
  VERSION.  DUPLICATE LINES IN lirc.hwdb AND extras/remotes.hwdb
  WILL USE THE extras/remotes.hwdb VERSION.  TRY TO AVOID THIS.
* Added support to build new ene0100 driver
* Update debian/lircd.init.d to reflect new default
  PID location in /var/run/lirc
* Update debian/lircd.init.d to force socket to /dev/lircd
  rather than the new default of /var/run/lirc/lircd
* Add support for new lirc-extras package to
  debian/lirc.postinst
* Remove /etc/lircd.conf link to /etc/lirc since
  0.8.6 defaults to /etc/lirc/lircd.conf now
* Drop 04_man_pages patch, included in upstream
* Drop 16_lirc-gpio in favor of a sed line in debian/rules
* Drop 28_irrecord_resume_support - Doesn't work
  according to upstream
* Drop 36_remove_extra_tekram in favor of a minor
  tweak to debian/lirc.postinst to ignore duplicates
* Drop extra remote control/transmitter patches, move to lirc-extras:
  - 21_atiusb
  - 22_hauppauge_novat_500
  - 23_remove_md8800
  - 24_freecom_dvbt
  - 26_transmitter_lircd.conf
  - 30_medion_md1_remote
  - 31_hauppauge_hvr_1100
  - 32_radioshack_15_2116_remote
  - 33_asus_mycinema_remote
  - 34_nebula_digitaltv_remote
  - 35_general_deviniput
  - 37_msi_tv_anywhere
  - 38_encore_enltv
* Cleaned up a few lintian warnings

[ Mario Limonciello ]
* lirc.init.d:
  - Merge a bunch of whitespace cleanup from debian.
* control:
  - Merge whitespace cleanup from debian.
  - Drop breaks on udev.  We don't have any older version of udev in karmic.
* copyright:
  - Sync from debian.
* watch:
  - Sync from debian.
* links:
  - Don't link to a transmitterdb, this should be provided by lirc-extras.
* rules:
  - Install extra changelog, as mentioned in debian's debian/rules.
* dkms.conf.in:
  - Drop bashisms. (LP: #445175)
* lirc.postinst:
  - On upgrades from earlier versions, require the user to reconfigure
    their remote and transmitter.
* lirc-modules-source.postinst:
  - Update to use the DKMS common postinst template.
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        #Make sure that all variables are there, and also create the file if
59
59
        #it is not there
60
60
        #local VAR
61
 
        for VAR in REMOTE REMOTE_MODULES REMOTE_DRIVER REMOTE_DEVICE REMOTE_LIRCD_CONF REMOTE_LIRCD_ARGS TRANSMITTER TRANSMITTER_MODULES TRANSMITTER_DRIVER TRANSMITTER_DEVICE TRANSMITTER_LIRCD_CONF TRANSMITTER_LIRCD_ARGS START_LIRCD START_LIRCMD LOAD_MODULES LIRCMD_CONF FORCE_NONINTERACTIVE_RECONFIGURATION
 
61
        for VAR in REMOTE REMOTE_MODULES REMOTE_DRIVER REMOTE_DEVICE REMOTE_SOCKET REMOTE_LIRCD_CONF REMOTE_LIRCD_ARGS TRANSMITTER TRANSMITTER_MODULES TRANSMITTER_DRIVER TRANSMITTER_DEVICE TRANSMITTER_SOCKET TRANSMITTER_LIRCD_CONF TRANSMITTER_LIRCD_ARGS START_LIRCD START_LIRCMD LOAD_MODULES LIRCMD_CONF FORCE_NONINTERACTIVE_RECONFIGURATION
62
62
        do
63
63
                # Patch provided by Robert Bihlmeyer <robbe@orcus.priv.at>
64
64
                # See http://bugs.debian.org/303078
127
127
        #Present the user with some choices
128
128
                #To later explain what this is actually doing without man pages:
129
129
                #First, only grab lines with a ;
130
 
                #Next, sort the list
131
130
                #Now, remove all commas from streams
132
131
                #Now, Remove all remaining comments or ['s
133
132
                #Now, Print the remote name
 
133
                #Next, sort the list and remove duplicates
134
134
                #Now, Affix a comma and space to all starts of lines
135
135
                #Lastly, change the newline to a null character
136
 
        REMOTES=`grep ";" /usr/share/lirc/lirc.hwdb | sort | sed 's/,//g' | awk -F ";" '$0!~/^#|^\[/{print $1}' | sed 's/^/,\ /' | tr '\n' '\0'`
137
 
        TRANSMITTERS=`grep ";" /usr/share/lirc/transmitter.hwdb | sort | sed 's/,//g' | awk -F ";" '$0!~/^#|^\[/{print $1}' | sed 's/^/,\ /' | tr '\n' '\0'`
 
136
        REMOTES=`cat /usr/share/lirc/lirc.hwdb /usr/share/lirc/extras/more_remotes.hwdb 2>/dev/null | grep ";" | sed 's/,//g' | awk -F ";" '$0!~/^#|^\[/{print $1}' | sort -u | sed 's/^/,\ /' | tr '\n' '\0'`
138
137
        db_subst lirc/remote REMOTES $REMOTES
139
 
        db_subst lirc/transmitter TRANSMITTERS $TRANSMITTERS
 
138
 
 
139
        if [ -f /usr/share/lirc/extras/transmitter.hwdb ]; then
 
140
                TRANSMITTERS=`grep ";" /usr/share/lirc/extras/transmitter.hwdb | sort | sed 's/,//g' | awk -F ";" '$0!~/^#|^\[/{print $1}' | sed 's/^/,\ /' | tr '\n' '\0'`
 
141
                db_subst lirc/transmitter TRANSMITTERS $TRANSMITTERS
 
142
        fi
140
143
 
141
144
        #If we are forcing a reconfigure, then our old remote and new ones are the same
142
145
        if [ "$FORCE_NONINTERACTIVE_RECONFIGURATION" = "true" ]; then
145
148
                db_set lirc/remote $CHOSEN_REMOTE
146
149
        else
147
150
                db_input high lirc/remote || true
148
 
                db_input high lirc/transmitter || true
 
151
                if [ -f /usr/share/lirc/extras/transmitter.hwdb ]; then
 
152
                        db_input high lirc/transmitter || true
 
153
                fi
149
154
                db_go
150
155
 
151
156
                #Populate remote information (remote is our primary device at all times)
154
159
        fi
155
160
 
156
161
        if [ "$CHOSEN_REMOTE" != "None" -a "$CHOSEN_REMOTE" != "Custom" ] && [ "$OLDREMOTE" != "$CHOSEN_REMOTE" -o "$FORCE_NONINTERACTIVE_RECONFIGURATION" = "true" ]; then
157
 
                REMOTE_MODULES=`grep ";" /usr/share/lirc/lirc.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_REMOTE}" | awk -F ";" '$0!~/^#|^\[/{print $3}'`
158
 
                REMOTE_DRIVER=`grep ";" /usr/share/lirc/lirc.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_REMOTE}" | awk -F ";" '$0!~/^#|^\[/{print $2}'`
159
 
                REMOTE_LIRCD_CONF=`grep ";" /usr/share/lirc/lirc.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_REMOTE}" | awk -F ";" '$0!~/^#|^\[/{print $5}'`
 
162
                #To later explain what this is actually doing without man pages:
 
163
                #First, only grab lines with a ;
 
164
                #Now, remove all commas from streams
 
165
                #Lastly, take the last matching entry found (so remotes.hwdb overrides lirc.hwdb)
 
166
                REMOTE_LINE=`cat /usr/share/lirc/lirc.hwdb /usr/share/lirc/extras/more_remotes.hwdb 2>/dev/null | grep ";" | sed 's/,//g' | grep "${CHOSEN_REMOTE}" | tail -1`
 
167
                #Remove all remaining comments or ['s
 
168
                #then print the remote name
 
169
                REMOTE_MODULES=`echo $REMOTE_LINE | awk -F ";" '$0!~/^#|^\[/{print $3}'`
 
170
                REMOTE_DRIVER=`echo $REMOTE_LINE | awk -F ";" '$0!~/^#|^\[/{print $2}'`
 
171
                REMOTE_LIRCD_CONF=`echo $REMOTE_LINE | awk -F ";" '$0!~/^#|^\[/{print $5}'`
160
172
                SUPPORTED_DRIVERS=`lircd -H help 2>&1 | awk '$0!~/^S|^D/{print $1}' | tr '\n' '\ '`
161
173
 
162
174
                #/dev/input/eventX is a weird case: filter it
254
266
                CHOSEN_TRANSMITTER="${RET}"
255
267
        fi
256
268
 
257
 
        if [ "$CHOSEN_TRANSMITTER" != "None" -a "$CHOSEN_TRANSMITTER" != "Custom" ] && [ "$OLDTRANSMITTER" != "$CHOSEN_TRANSMITTER" -o "$FORCE_NONINTERACTIVE_RECONFIGURATION" = "true" ]; then
258
 
                TRANSMITTER_MODULES=`grep ";" /usr/share/lirc/transmitter.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_TRANSMITTER}" | awk -F ";" '$0!~/^#|^\[/{print $3}'`
259
 
                TRANSMITTER_DRIVER=`grep ";" /usr/share/lirc/transmitter.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_TRANSMITTER}" | awk -F ";" '$0!~/^#|^\[/{print $2}'`
260
 
                TRANSMITTER_LIRCD_CONF=`grep ";" /usr/share/lirc/transmitter.hwdb | sort | sed 's/,//g' |  grep "${CHOSEN_TRANSMITTER}" | awk -F ";" '$0!~/^#|^\[/{print $5}'`
 
269
        if [ -f /usr/share/lirc/extras/transmitter.hwdb ] && [ "$CHOSEN_TRANSMITTER" != "None" -a "$CHOSEN_TRANSMITTER" != "Custom" ] && [ "$OLDTRANSMITTER" != "$CHOSEN_TRANSMITTER" -o "$FORCE_NONINTERACTIVE_RECONFIGURATION" = "true" ]; then
 
270
                TRANSMITTER_LINE=`grep ";" /usr/share/lirc/extras/transmitter.hwdb | sed 's/,//g' |  grep "${CHOSEN_TRANSMITTER}" | tail -1`
 
271
                TRANSMITTER_MODULES=`echo $TRANSMITTER_LINE | awk -F ";" '$0!~/^#|^\[/{print $3}'`
 
272
                TRANSMITTER_DRIVER=`echo $TRANSMITTER_LINE | awk -F ";" '$0!~/^#|^\[/{print $2}'`
 
273
                TRANSMITTER_LIRCD_CONF=`echo $TRANSMITTER_LINE | awk -F ";" '$0!~/^#|^\[/{print $5}'`
261
274
                #transmitter.hwdb puts none rather than ;;
262
275
                if [ "$TRANSMITTER_MODULES" != "none" ]; then
263
276
                        #if we have a module in use, don't use a driver too
447
460
 
448
461
EOF
449
462
        #if we have a remote, include it's config
450
 
        if [ -f "/usr/share/lirc/remotes/$REMOTE_LIRCD_CONF" ];then
 
463
        if [ -f "/usr/share/lirc/extras/more_remotes/$REMOTE_LIRCD_CONF" ];then
 
464
                cat >> /etc/lirc/lircd.conf <<EOF
 
465
#Configuration for the $REMOTE remote:
 
466
include "/usr/share/lirc/extras/more_remotes/$REMOTE_LIRCD_CONF"
 
467
 
 
468
EOF
 
469
        elif [ -f "/usr/share/lirc/remotes/$REMOTE_LIRCD_CONF" ];then
451
470
                cat >> /etc/lirc/lircd.conf <<EOF
452
471
#Configuration for the $REMOTE remote:
453
472
include "/usr/share/lirc/remotes/$REMOTE_LIRCD_CONF"
469
488
        fi
470
489
 
471
490
        #if we have a transmitter, include it's config
472
 
        if [ -f "/usr/share/lirc/transmitters/$TRANSMITTER_LIRCD_CONF" ];then
 
491
        if [ -f "/usr/share/lirc/extras/transmitters/$TRANSMITTER_LIRCD_CONF" ];then
473
492
                cat >> /etc/lirc/lircd.conf <<EOF
474
493
#Configuration for the $TRANSMITTER transmitter:
475
 
include "/usr/share/lirc/transmitters/$TRANSMITTER_LIRCD_CONF"
 
494
include "/usr/share/lirc/extras/transmitters/$TRANSMITTER_LIRCD_CONF"
476
495
EOF
477
496
        elif [ -f "$TRANSMITTER_LIRCD_CONF" ]; then
478
497
cat >> /etc/lirc/lircd.conf <<EOF
513
532
 
514
533
if [ "$1" = "configure" ]; then
515
534
 
 
535
        #0.8.6 got rid of mceusb2 so users need to repick remotes
 
536
        if dpkg --compare-versions "$2" le-nl "0.8.6-0ubuntu1"; then
 
537
                db_fset lirc/remote seen false
 
538
                db_fset lirc/transmitter seen false
 
539
        fi
 
540
 
516
541
        if [ -e "/etc/modprobe.d/lirc-serial" ]; then
517
542
                        echo "Preserving user changes to /etc/modprobe.d/lirc-serial.conf ..."
518
543
                        if [ -e "/etc/modprobe.d/lirc-serial.conf" ]; then
578
603
 
579
604
                # we don't restore the file unless the user is (re)configuring
580
605
                elif $CONFIG_CHANGED \
 
606
                        && [ -f "/usr/share/lirc/extras/more_remotes/$RET" ];then
 
607
                        echo trying default lircmd.conf
 
608
                        cp /usr/share/lirc/extras/more_remotes/$RET \
 
609
                                /etc/lirc/lircmd.conf
 
610
                elif $CONFIG_CHANGED \
581
611
                        && [ -f "/usr/share/lirc/remotes/$RET" ];then
582
612
                        echo trying default lircmd.conf
583
613
                        cp /usr/share/lirc/remotes/$RET \