sane-desc does not include unsupported scanners in hwdb and udev files
I'm writing this as a maintainer in NixOS.
We used to ship the pre-computed udev rules that are distributed in the tarballs. This is problematic as it changes the group of scanners to scanner
which removes the group lp
and prevents cups from using it. For this reason we switched to generating udev and hwdb files as follows:
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external > $out/etc/udev/rules.d/49-libsane.rules
./tools/sane-desc -m udev+hwdb -s doc/descriptions -m hwdb > $out/etc/udev/hwdb.d/20-sane.hwdb
following what other distros do. this is great, but sane-desc does not include unsupported .desc entries like EPSON V300 PHOTO, which was present in the distributed udev rules. So even when installing all the required unfree stuff to make the corresponding epkowa backend work, it only works as root as there is no corresponding hwdb entry. As the .desc entry contains the usb ids, just applying this patch makes scanning working as expected:
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
index 7a8645dea..d6ca42f66 100644
--- a/tools/sane-desc.c
+++ b/tools/sane-desc.c
@@ -3243,9 +3243,9 @@ create_usbids_table (void)
for (model = mfg->model; model; model = model->next)
{
- if ((model->status == status_unsupported)
- || (model->status == status_unknown))
- continue;
+ /* if ((model->status == status_unsupported) */
+ /* || (model->status == status_unknown)) */
+ /* continue; */
if (model->usb_vendor_id && model->usb_product_id)
{
Questions:
- is there a better approach?
- would you accept this change?