bloguetronica / cp2130-conf

CP2130 Configurator (cp2130-conf) is an application that can be used to configure CP2130 devices, including VID, PID, as well as other descriptors. Most importantly, the application allows you to configure pin functions and states.
GNU General Public License v3.0
1 stars 1 forks source link

Maintainer scripts won't restart eudev or udev #32

Closed samuelfmlourenco closed 1 year ago

samuelfmlourenco commented 1 year ago

The fix described in https://github.com/bloguetronica/cp2130-conf/issues/30 was not correctly applied to the maintainer scripts, postinst and postrm, contained in the Debian package. For instance, here are the contents of the postinst script:

#!/bin/sh

set -e
cat > /etc/udev/rules.d/70-cp2130-conf.rules << EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", MODE="0666"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="10c4", MODE="0666"
EOF
if echo $services | grep -q eudev; then
    service eudev restart
elif echo $services | grep -q udev; then
    service udev restart
fi

The issue is that the variable "$services" is not set, as it should. Therefore, service is never called to restart eudev or udev. To fix this, the missing line must be added to the script. Thus:

#!/bin/sh

set -e
cat > /etc/udev/rules.d/70-cp2130-conf.rules << EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", MODE="0666"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="10c4", MODE="0666"
EOF
services=$(service --status-all)
if echo $services | grep -q eudev; then
    service eudev restart
elif echo $services | grep -q udev; then
    service udev restart
fi
samuelfmlourenco commented 1 year ago

Fixed in version 1.6.