Package: release.debian.org Severity: normal Tags: buster User: release.debian....@packages.debian.org Usertags: pu
Hi, I'd like to update lirc in buster to fix the conffile management (conffiles were installed in dummy locations but not copied to the proper locations). Now they are handled as proper conffiles. I've tested several upgrade scenarios before uploading these changes to sid. This may cause dpkg prompting due to modified conffiles on upgrades, but only if there are actually user modifications (i.e. the existing configuration files (if any) do not match anything known to be shipped in the past). In order to get a clean upgrade path to bullseye, we need to be careful with the version numbers (in .preinst and .maintscript). Therefore this is a rebuild of the package in sid, but the two patches added in unrelated uploads to sid are not relevant for Debian buster and are disabled in the series file. The package is already uploaded. Andreas
diff -Nru lirc-0.10.1/debian/changelog lirc-0.10.1/debian/changelog --- lirc-0.10.1/debian/changelog 2019-04-06 15:12:52.000000000 +0200 +++ lirc-0.10.1/debian/changelog 2020-05-25 15:09:59.000000000 +0200 @@ -1,3 +1,39 @@ +lirc (0.10.1-6.2~deb10u1) buster; urgency=medium + + * Non-maintainer upload. + * Rebuild for buster. + * Disable patches for Raspbian (0.10.1-6) and python3.8 (0.10.1-6.1). + + -- Andreas Beckmann <a...@debian.org> Mon, 25 May 2020 15:09:59 +0200 + +lirc (0.10.1-6.2) unstable; urgency=medium + + * Non-maintainer upload. + * Revert "Revert "Do not install conffiles in a dummy location"" + (0.10.1-5.2). (Closes: #932779, #851618) + * d/lirc.maintscript: rm_conffile /etc/lirc/*.dist because they are most + likely unmodified, don't mv_conffile them to =~ s/\.dist// to avoid + clashes with existing and possibly modified configuration files. + * d/lirc.preinst: Remove unmodified configuration files that are unknown to + dpkg to avoid prompting when replacing them with conffiles. + + -- Andreas Beckmann <a...@debian.org> Thu, 14 May 2020 11:46:53 +0200 + +lirc (0.10.1-6.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix time.clock usage. Closes: #949835. + + -- Matthias Klose <d...@debian.org> Fri, 13 Mar 2020 08:55:53 +0100 + +lirc (0.10.1-6) unstable; urgency=medium + + * Team upload + * debian/patches/lirc-gpio-ir-0.10.patch: + - fix for kernel 4.19 (Closes: #931078, 930485). + + -- Gianfranco Costamagna <locutusofb...@debian.org> Thu, 04 Jul 2019 16:43:06 +0200 + lirc (0.10.1-5.2) unstable; urgency=medium * Non-maintainer upload. diff -Nru lirc-0.10.1/debian/lirc.maintscript lirc-0.10.1/debian/lirc.maintscript --- lirc-0.10.1/debian/lirc.maintscript 1970-01-01 01:00:00.000000000 +0100 +++ lirc-0.10.1/debian/lirc.maintscript 2020-05-25 15:09:59.000000000 +0200 @@ -0,0 +1,4 @@ +rm_conffile /etc/lirc/lircd.conf.dist 0.10.1-6.2~ +rm_conffile /etc/lirc/lircmd.conf.dist 0.10.1-6.2~ +rm_conffile /etc/lirc/irexec.lircrc.dist 0.10.1-6.2~ +rm_conffile /etc/lirc/lirc_options.conf.dist 0.10.1-6.2~ diff -Nru lirc-0.10.1/debian/lirc.preinst lirc-0.10.1/debian/lirc.preinst --- lirc-0.10.1/debian/lirc.preinst 1970-01-01 01:00:00.000000000 +0100 +++ lirc-0.10.1/debian/lirc.preinst 2020-05-25 15:09:59.000000000 +0200 @@ -0,0 +1,40 @@ +#!/bin/sh +set -e + +md5sums_shipped=" +92df549c82f58ea28b605e5045984e04 /etc/lirc/irexec.lircrc +d2664e84bab19f7f36628d1de3f273dd /etc/lirc/lirc_options.conf #stretch +6599e8ea08b5f4bf19409666cae22441 /etc/lirc/lirc_options.conf #buster +810233d6f1bb15b64468beb95e4c670e /etc/lirc/lircd.conf +eca53bdc53bd5edc63cf06a4cff16b0d /etc/lirc/lircmd.conf +" + +if dpkg --compare-versions "$2" lt-nl "0.10.1-6.2~" +then + # * configuration files unknown to dpkg and identical to a known + # shipped version can be deleted to avoid prompting when replacing + # them with proper conffiles + # * we must not remove conffiles still known to dpkg as "(obsolete)", + # otherwise dpkg will remember their deletion + conffiles="$(dpkg-query -f '${Conffiles}' -W lirc)" + for conffile in /etc/lirc/lircd.conf /etc/lirc/lircmd.conf /etc/lirc/irexec.lircrc /etc/lirc/lirc_options.conf + do + test -f "$conffile" || continue + if [ -n "$(echo "$conffiles" | grep " $conffile ")" ] + then + echo "Keeping conffile $conffile which is known to dpkg." + continue + fi + case "$md5sums_shipped" in + *"$(md5sum "$conffile")"*) + echo "Removing unmodified configuration file $conffile which is unknown to dpkg." + rm "$conffile" + ;; + *) + echo "Keeping modified configuration file $conffile which is unknown to dpkg." + ;; + esac + done +fi + +#DEBHELPER# diff -Nru lirc-0.10.1/debian/patches/lirc-gpio-ir-0.10.patch lirc-0.10.1/debian/patches/lirc-gpio-ir-0.10.patch --- lirc-0.10.1/debian/patches/lirc-gpio-ir-0.10.patch 1970-01-01 01:00:00.000000000 +0100 +++ lirc-0.10.1/debian/patches/lirc-gpio-ir-0.10.patch 2020-05-25 15:09:59.000000000 +0200 @@ -0,0 +1,178 @@ +Origin: https://github.com/neuralassembly/raspi/blob/master/lirc-gpio-ir-0.10.patch +Bug-Debian: bugs.debian.org/931078 + +diff -ruN lirc-0.10.1.orig/lib/config_file.c lirc-0.10.1/lib/config_file.c +--- lirc-0.10.1.orig/lib/config_file.c 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/config_file.c 2019-06-26 00:39:45.734320696 +0900 +@@ -71,7 +71,7 @@ + typedef void* (*array_guest_func)(void* item, void* arg); + + +-#define LINE_LEN 1024 ++#define LINE_LEN 4096 + #define MAX_INCLUDES 10 + + const char* whitespace = " \t"; +diff -ruN lirc-0.10.1.orig/lib/ir_remote.h lirc-0.10.1/lib/ir_remote.h +--- lirc-0.10.1.orig/lib/ir_remote.h 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/ir_remote.h 2019-06-26 00:39:45.714321224 +0900 +@@ -110,12 +110,17 @@ + + static inline int is_pulse(lirc_t data) + { +- return data & PULSE_BIT ? 1 : 0; ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_PULSE) ? 1 : 0; + } + + static inline int is_space(lirc_t data) + { +- return !is_pulse(data); ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_SPACE) ? 1 : 0; ++} ++ ++static inline int is_timeout(lirc_t data) ++{ ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_TIMEOUT) ? 1 : 0; + } + + static inline int has_repeat(const struct ir_remote* remote) +diff -ruN lirc-0.10.1.orig/lib/irrecord.c lirc-0.10.1/lib/irrecord.c +--- lirc-0.10.1.orig/lib/irrecord.c 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/irrecord.c 2019-06-26 00:39:45.724320960 +0900 +@@ -1398,9 +1398,16 @@ + state->retval = 0; + return STS_LEN_TIMEOUT; + } ++ if (is_timeout(state->data)) { ++ return STS_LEN_AGAIN; ++ } + state->count++; + if (state->mode == MODE_GET_GAP) { +- state->sum += state->data & PULSE_MASK; ++ if (state->sum != 0 || is_pulse(state->data)) { ++ state->sum += state->data & PULSE_MASK; ++ }else{ ++ return STS_LEN_AGAIN; ++ } + if (state->average == 0 && is_space(state->data)) { + if (state->data > 100000) { + state->sum = 0; +@@ -1472,6 +1479,10 @@ + state->keypresses = lastmaxcount; + return STS_LEN_AGAIN; + } else if (state->mode == MODE_HAVE_GAP) { ++ if (state->count==1 && is_space(state->data)) { ++ state->count = 0; ++ return STS_LEN_AGAIN; ++ } + if (state->count <= MAX_SIGNALS) { + signals[state->count - 1] = state->data & PULSE_MASK; + } else { +@@ -1510,7 +1521,7 @@ + /* such long pulses may appear with + * crappy hardware (receiver? / remote?) + */ +- else { ++ else if(is_pulse(state->data)) { + remote->gap = 0; + return STS_LEN_NO_GAP_FOUND; + } +@@ -1811,22 +1822,24 @@ + + static int raw_data_ok(struct button_state* btn_state) + { +- int r; ++ int r = 0; + int ref; + +- if (!is_space(btn_state->data)) { ++ if (is_pulse(btn_state->data)) { + r = 0; +- } else if (is_const(&remote)) { +- if (remote.gap > btn_state->sum) { +- ref = (remote.gap - btn_state->sum); +- ref *= (100 - remote.eps); +- ref /= 100; ++ } else if (is_space(btn_state->data)) { ++ if (is_const(&remote)) { ++ if (remote.gap > btn_state->sum) { ++ ref = (remote.gap - btn_state->sum); ++ ref *= (100 - remote.eps); ++ ref /= 100; ++ } else { ++ ref = 0; ++ } ++ r = btn_state->data > ref; + } else { +- ref = 0; ++ r = btn_state->data > (remote.gap * (100 - remote.eps)) / 100; + } +- r = btn_state->data > ref; +- } else { +- r = btn_state->data > (remote.gap * (100 - remote.eps)) / 100; + } + return r; + } +@@ -1970,7 +1983,7 @@ + btn_state->data = remote.gap; + } + if (btn_state->count == 0) { +- if (!is_space(btn_state->data) ++ if (is_pulse(btn_state->data) + || btn_state->data < + remote.gap - remote.gap * remote.eps / + 100) { +diff -ruN lirc-0.10.1.orig/lib/lirc/ir_remote.h lirc-0.10.1/lib/lirc/ir_remote.h +--- lirc-0.10.1.orig/lib/lirc/ir_remote.h 2017-09-10 17:52:58.000000000 +0900 ++++ lirc-0.10.1/lib/lirc/ir_remote.h 2019-06-26 00:39:45.724320960 +0900 +@@ -110,12 +110,17 @@ + + static inline int is_pulse(lirc_t data) + { +- return data & PULSE_BIT ? 1 : 0; ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_PULSE) ? 1 : 0; + } + + static inline int is_space(lirc_t data) + { +- return !is_pulse(data); ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_SPACE) ? 1 : 0; ++} ++ ++static inline int is_timeout(lirc_t data) ++{ ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_TIMEOUT) ? 1 : 0; + } + + static inline int has_repeat(const struct ir_remote* remote) +diff -ruN lirc-0.10.1.orig/tools/mode2.cpp lirc-0.10.1/tools/mode2.cpp +--- lirc-0.10.1.orig/tools/mode2.cpp 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/tools/mode2.cpp 2019-06-26 00:45:38.840404976 +0900 +@@ -326,12 +326,24 @@ + void print_mode2_data(unsigned int data) + { + static int bitno = 1; ++ static bool leading_space = true; ++ unsigned int msg = data & LIRC_MODE2_MASK; + + switch (opt_dmode) { + case 0: +- printf("%s %u\n", ( +- data & PULSE_BIT) ? "pulse" : "space", +- (uint32_t)(data & PULSE_MASK)); ++ if (leading_space && msg == LIRC_MODE2_SPACE ) { ++ break; ++ } else { ++ leading_space = false; ++ } ++ if (msg == LIRC_MODE2_PULSE) { ++ printf("pulse %u\n", (__u32)(data & PULSE_MASK)); ++ } else if (msg == LIRC_MODE2_SPACE) { ++ printf("space %u\n", (__u32)(data & PULSE_MASK)); ++ } else if (msg == LIRC_MODE2_TIMEOUT) { ++ printf("timeout %u\n", (__u32)(data & PULSE_MASK)); ++ leading_space = true; ++ } + break; + case 1: { + /* print output like irrecord raw config file data */ diff -Nru lirc-0.10.1/debian/patches/python3.8.diff lirc-0.10.1/debian/patches/python3.8.diff --- lirc-0.10.1/debian/patches/python3.8.diff 1970-01-01 01:00:00.000000000 +0100 +++ lirc-0.10.1/debian/patches/python3.8.diff 2020-05-25 15:09:59.000000000 +0200 @@ -0,0 +1,17 @@ +Index: b/python-pkg/lirc/client.py +=================================================================== +--- a/python-pkg/lirc/client.py ++++ b/python-pkg/lirc/client.py +@@ -219,10 +219,10 @@ class RawConnection(AbstractConnection): + def readline(self, timeout: float = None) -> str: + ''' Implements AbstractConnection.readline(). ''' + if timeout: +- start = time.clock() ++ start = time.perf_counter() + while b'\n' not in self._buffer: + ready = self._select.select( +- start + timeout - time.clock() if timeout else timeout) ++ start + timeout - time.perf_counter() if timeout else timeout) + if ready == []: + if timeout: + raise TimeoutException( diff -Nru lirc-0.10.1/debian/patches/series lirc-0.10.1/debian/patches/series --- lirc-0.10.1/debian/patches/series 2019-03-12 01:33:40.000000000 +0100 +++ lirc-0.10.1/debian/patches/series 2020-05-25 15:09:59.000000000 +0200 @@ -3,3 +3,5 @@ 0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch 0004-lircd-Fix-connect-option-parsing-error-343.patch 0005-systemd-support-Notify-systemd-on-successful-startup.patch +#lirc-gpio-ir-0.10.patch +#python3.8.diff diff -Nru lirc-0.10.1/debian/rules lirc-0.10.1/debian/rules --- lirc-0.10.1/debian/rules 2019-04-06 14:56:02.000000000 +0200 +++ lirc-0.10.1/debian/rules 2020-05-25 15:09:59.000000000 +0200 @@ -42,10 +42,6 @@ endif # Temporary postinstall 0.9.4 script. cp debian/lirc-old2new debian/tmp/usr/share/lirc - # Don't overwrite existing config files. - for f in lircd.conf lircmd.conf irexec.lircrc lirc_options.conf; do \ - mv debian/tmp/etc/lirc/$$f debian/tmp/etc/lirc/$$f.dist; \ - done override_dh_auto_test: ifneq "nocheck" "$(findstring nocheck,$(DEB_BUILD_OPTIONS))"