Bug#673818: laptop-mode-tools: ugly warning related to board-specific configuration - fix changes behaviour

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug#673818: laptop-mode-tools: ugly warning related to board-specific configuration - fix changes behaviour

Eddy Petrișor
package laptop-mode-tools
tags 673818 patch
thanks

Sorry, I quoted an incomplete patch. Correct patch attached.

BTW, there is an inconsistent usage of tabs and spaces for indentation
in the script, you might want to fix that, too.


2013/8/11 Eddy Petrișor <[hidden email]>:

> X-Debbugs-Cc: [hidden email]
>
> Package: laptop-mode-tools
> Version: 1.61-2
> Followup-For: Bug #673818
>
> I was looking over the fix for this bug, but it seems to me the fix changes the
> behaviour of laptop-mode.
>
> Previously the /usr/sbin/laptop_mode script looked for files with the .conf
> suffix, but now every file in the /etc/laptop-mode/conf.d and /etc/laptop-
> mode/conf.d/board-specific directories.
>
> I use the previous type of behaviour to disable specific scripts by renaming
> them to somehting not matching the pattern (e.g. bluetooth.conf.disabled), and
> I suspect others did, too.
>
> With the change, those scripts would be reenabled on upgrade.
>
>
>
> Please see below a proposal for the fix that does not have the
> described problem, nor the warning that caused this BR:
>
> --- laptop_mode.sid     2013-08-11 12:30:23.000000000 +0300
> +++ laptop_mode 2013-08-11 12:28:10.000000000 +0300
> @@ -234,7 +234,7 @@
>      test -d /etc/laptop-mode/conf.d/board-specific &&
> CONF_DIR="$CONF_DIR /etc/laptop-mode/conf.d/board-specific"
>
>      for PER_DIR in $CONF_DIR; do
> -               for CONF in $PER_DIR/*; do
> +               for CONF in $(ls $PER_DIR/* 2>/dev/null); do
>                     if [ -r "$CONF" ] ; then
>                             . "$CONF"
>                             #Handle individual module debug settings
>
>
> This also has the advantage of not trying to print wildcard matching patterns.
>
>
> -- System Information:
> Debian Release: 7.1
>   APT prefers stable
>   APT policy: (500, 'stable')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 3.10.0-heidi (SMP w/2 CPU cores)
> Locale: LANG=ro_RO.utf8, LC_CTYPE=ro_RO.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages laptop-mode-tools depends on:
> ii  lsb-base    4.1+Debian8+deb7u1
> ii  psmisc      22.19-1+deb7u1
> ii  util-linux  2.20.1-5.3
>
> Versions of packages laptop-mode-tools recommends:
> pn  ethtool         <none>
> ii  hdparm          9.39-1+b1
> ii  net-tools       1.60-24.2
> ii  sdparm          1.07-1
> ii  udev            175-7.2
> ii  wireless-tools  30~pre9-8
>
> Versions of packages laptop-mode-tools suggests:
> ii  acpid  1:2.0.16-1+deb7u1
> ii  hal    0.5.14-8
>
> -- no debconf information


--
Regards,
EddyP
=============================================
The universe is not required to be in perfect harmony with human
ambition. - Carl Sagan

673818.patch (632 bytes) Download Attachment