From 3958e52b1b0d8daf28bf9716c610d33ae1d5e3da Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Wed, 25 Jul 2007 12:30:16 +0000 Subject: [PATCH] Simplify previous modification. --- tools/sane-desc.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/tools/sane-desc.c b/tools/sane-desc.c index 988c611e0..e7bdb1679 100644 --- a/tools/sane-desc.c +++ b/tools/sane-desc.c @@ -3160,7 +3160,7 @@ print_udev_header (void) "# udev rules file for supported USB devices\n" "#\n" "# To add a USB device, add a rule to the list below between the\n" - "# LABEL=\"libsane_no_create_usb_dev\" and LABEL=\"libsane_rules_end\" lines.\n" + "# ENV{DEVTYPE}!=... and LABEL=\"libsane_rules_end\" lines.\n" "#\n" "# To run a script when your device is plugged in, add RUN+=\"/path/to/script\"\n" "# to the appropriate rule.\n"); @@ -3180,24 +3180,7 @@ print_udev (void) print_udev_header (); printf("ACTION!=\"add\", GOTO=\"libsane_rules_end\"\n" - "ENV{DEVTYPE}==\"usb_device\", GOTO=\"libsane_create_usb_dev\"\n" - "SUBSYSTEM==\"usb_device\", GOTO=\"libsane_no_create_usb_dev\"\n" - "SUBSYSTEM!=\"usb_device\", GOTO=\"libsane_rules_end\"\n" - "\n"); - - printf("# Kernel >= 2.6.22 jumps here\n" - "LABEL=\"libsane_create_usb_dev\"\n" - "\n"); - - printf("# If you are running Linux >= 2.6.22 without CONFIG_USB_DEVICE_CLASS\n" - "# AND this rule doesn't already exist on your system, uncomment the\n" - "# following line to create the /dev/bus/usb/BBB/DDD device nodes.\n" - "# SUBSYSTEM==\"usb\", ACTION==\"add\", ENV{DEVTYPE}==\"usb_device\", " - "NAME=\"bus/usb/$env{BUSNUM}/$env{DEVNUM}\", MODE=\"0664\", OWNER=\"root\", GROUP=\"root\"\n" - "\n"); - - printf("# Kernel < 2.6.22 jumps here\n" - "LABEL=\"libsane_no_create_usb_dev\"\n" + "ENV{DEVTYPE}!=\"usb_device\", GOTO=\"libsane_rules_end\"\n" "\n"); while (usbid) @@ -3227,7 +3210,7 @@ print_udev (void) } } printf ("\n"); - printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"0664\", GROUP=\"scanner\"\n", + printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", NAME=\"bus/usb/$env{BUSNUM}/$env{DEVNUM}\", MODE=\"0664\", GROUP=\"scanner\"\n", usbid->usb_vendor_id + 2, usbid->usb_product_id + 2); usbid = usbid->next; }