sane-backends-1.0.23-udev.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From c7f5126447ed5335a54d9333ac37f35c2189fbf4 Mon Sep 17 00:00:00 2001
  2. From: Nils Philippsen <nils@redhat.com>
  3. Date: Mon, 10 Sep 2012 12:25:33 +0200
  4. Subject: [PATCH] patch: udev
  5. Squashed commit of the following:
  6. commit 3d19b3eaf91fa8c3c2a78956f570d3e0f4c3f342
  7. Author: Nils Philippsen <nils@redhat.com>
  8. Date: Mon Sep 10 12:25:16 2012 +0200
  9. adapt generated udev rules for Fedora
  10. commit 7017c3ad1dadc27edd2c47ceec04f8648c839d53
  11. Author: Nils Philippsen <nils@redhat.com>
  12. Date: Mon Sep 10 12:20:43 2012 +0200
  13. use group and mode macros consistently
  14. ---
  15. tools/sane-desc.c | 13 ++++++-------
  16. 1 file changed, 6 insertions(+), 7 deletions(-)
  17. diff --git a/tools/sane-desc.c b/tools/sane-desc.c
  18. index 7bbd012..5c5bbe9 100644
  19. --- a/tools/sane-desc.c
  20. +++ b/tools/sane-desc.c
  21. @@ -56,9 +56,9 @@
  22. #define COLOR_NEW "\"#F00000\""
  23. #define COLOR_UNKNOWN "\"#000000\""
  24. -#define DEVMODE "0664"
  25. +#define DEVMODE "0644"
  26. #define DEVOWNER "root"
  27. -#define DEVGROUP "scanner"
  28. +#define DEVGROUP "root"
  29. #ifndef PATH_MAX
  30. # define PATH_MAX 1024
  31. @@ -3543,7 +3543,8 @@ print_udev (void)
  32. }
  33. printf("\n# The following rule will disable USB autosuspend for the device\n");
  34. - printf("ENV{libsane_matched}==\"yes\", RUN+=\"/bin/sh -c 'if test -e /sys/$env{DEVPATH}/power/control; then echo on > /sys/$env{DEVPATH}/power/control; elif test -e /sys/$env{DEVPATH}/power/level; then echo on > /sys/$env{DEVPATH}/power/level; fi'\"\n");
  35. + printf("ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n");
  36. + printf("ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
  37. printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");
  38. @@ -3619,10 +3620,8 @@ print_udev (void)
  39. }
  40. printf ("LABEL=\"libsane_scsi_rules_end\"\n");
  41. - if (mode == output_mode_udevacl)
  42. - printf("\nENV{libsane_matched}==\"yes\", RUN+=\"/bin/setfacl -m g:%s:rw $env{DEVNAME}\"\n", DEVGROUP);
  43. - else
  44. - printf ("\nENV{libsane_matched}==\"yes\", MODE=\"664\", GROUP=\"scanner\"\n");
  45. + if (mode != output_mode_udevacl)
  46. + printf ("\nENV{libsane_matched}==\"yes\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
  47. printf ("\nLABEL=\"libsane_rules_end\"\n");
  48. }
  49. --
  50. 1.7.11.4