This patch fixes issues with udev-098 and higher, since in those releases the following renames have been done: BUS -> SUBSYSTEMS SYSFS -> ATTRS (and a few others, but those does not effect libgphoto2). Index: packaging/generic/print-camera-list.c =================================================================== --- packaging/generic/print-camera-list.c (revision 9114) +++ packaging/generic/print-camera-list.c (working copy) @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA. */ +#include #define _GPHOTO2_INTERNAL_CODE @@ -289,7 +290,11 @@ udev_begin_func (const func_params_t *params) { printf ("# udev rules file for libgphoto2\n#\n"); +#if UDEV_VERSION >= 98 + printf ("SUBSYSTEMS!=\"usb\", ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"); +#else printf ("BUS!=\"usb\", ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"); +#endif return 0; } @@ -345,16 +350,33 @@ } if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) { +#if UDEV_VERSION >= 98 + printf("ATTRS{bInterfaceClass}==\"%02x\", ", class); +#else printf("SYSFS{bInterfaceClass}==\"%02x\", ", class); +#endif if (flags & GP_USB_HOTPLUG_MATCH_INT_SUBCLASS) { +#if UDEV_VERSION >= 98 + printf("ATTRS{bInterfaceSubClass}==\"%02x\", ", subclass); +#else printf("SYSFS{bInterfaceSubClass}==\"%02x\", ", subclass); +#endif } if (flags & GP_USB_HOTPLUG_MATCH_INT_PROTOCOL) { +#if UDEV_VERSION >= 98 + printf("ATTRS{bInterfaceProtocol}==\"%02x\", ", proto); +#else printf("SYSFS{bInterfaceProtocol}==\"%02x\", ", proto); +#endif } } else { +#if UDEV_VERSION >= 98 + printf ("ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ", + a->usb_vendor, a->usb_product); +#else printf ("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ", a->usb_vendor, a->usb_product); +#endif } if ((*params->argv)[1] == NULL) { const char *hotplug_script = ((*params->argv)[0] != NULL) Index: configure.in =================================================================== --- configure.in (revision 9114) +++ configure.in (working copy) @@ -493,6 +493,13 @@ AC_PATH_PROG(LIBUSB_CONFIG,libusb-config) AM_CONDITIONAL(HAVE_LIBUSB,test -n "${LIBUSB_CONFIG}") +dnl --------------------------------------------------------------------------- +dnl Check udev version +dnl --------------------------------------------------------------------------- +AC_MSG_CHECKING(udev version) +UDEVVER=`/sbin/udev -V|sed 's/^0//'` +AC_DEFINE_UNQUOTED([UDEV_VERSION],[$UDEVVER],[udev version]) +AC_MSG_RESULT([$UDEVVER]) dnl --------------------------------------------------------------------------- dnl Turn on all warnings when using gcc