summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/sane-backends/files/udev-rule.patch')
-rw-r--r--media-gfx/sane-backends/files/udev-rule.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/media-gfx/sane-backends/files/udev-rule.patch b/media-gfx/sane-backends/files/udev-rule.patch
new file mode 100644
index 000000000000..894f47e6677f
--- /dev/null
+++ b/media-gfx/sane-backends/files/udev-rule.patch
@@ -0,0 +1,44 @@
+--- tools/sane-desc.c 2006-07-31 08:57:40.000000000 +0200
++++ tools/sane-desc-new.c 2006-07-31 09:10:50.000000000 +0200
+@@ -3151,7 +3151,7 @@
+
+ printf
+ ("#\n"
+- "# udev rules file for supported USB devices\n"
++ "# udev rules file for supported USB and SCSI devices\n"
+ "#\n"
+ "# To add a USB device, add a rule to the list below between the SUBSYSTEM...\n"
+ "# and LABEL... lines.\n"
+@@ -3169,21 +3169,28 @@
+ static void
+ print_udev (void)
+ {
++ int commentlen;
+ usbid_type *usbid = create_usbids_table ();
+
+ print_udev_header ();
+ printf ("\nACTION!=\"add\", GOTO=\"libsane_rules_end\"\n");
++ puts("BUS==\"scsi\", SYSFS{type}==\"6\", MODE=\"660\", GROUP=\"scanner\"");
+ printf ("SUBSYSTEM!=\"usb_device\", GOTO=\"libsane_rules_end\"\n\n");
+ while (usbid)
+ {
+ manufacturer_model_type * name = usbid->name;
+
+- printf ("# ");
++ commentlen = printf ("# ");
+ while (name)
+ {
+- if (name != usbid->name)
+- printf (" | ");
+- printf ("%s", name->name);
++ if (name != usbid->name) {
++ commentlen += printf (" | ");
++ }
++ if(commentlen + strlen(name->name) > 480) {
++ printf(" (line too long, names omitted)");
++ break;
++ }
++ commentlen += printf ("%s", name->name);
+ name = name->next;
+ }
+ printf ("\n");