summaryrefslogtreecommitdiff
blob: 675855877d7cd7ef2ae8e5980a7631694ac03946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff -Nur libgphoto2-2.3.1/packaging/generic/print-camera-list.c libgphoto2-2.3.1-udev-fix/packaging/generic/print-camera-list.c
--- libgphoto2-2.3.1/packaging/generic/print-camera-list.c	2006-12-24 10:16:19.000000000 -0500
+++ libgphoto2-2.3.1-udev-fix/packaging/generic/print-camera-list.c	2007-01-31 10:39:12.000000000 -0500
@@ -299,7 +299,7 @@
 	/* Note: 2 lines because we need to use || ... having them on the same
 	 * line would mean &&.
 	 */
-	printf ("SUBSYSTEM!=\"usb*\", GOTO=\"libgphoto2_rules_end\"\n");
+	printf ("SUBSYSTEM!=\"usb_device\", GOTO=\"libgphoto2_rules_end\"\n");
 	printf ("ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n");
 	return 0;
 }
@@ -479,9 +479,14 @@
 			else
 				fprintf(stderr,"unhandled interface match flags %x\n", flags);
 		}
-	} else {
-		printf ("ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ",
+	} else if (flags & GP_USB_HOTPLUG_MATCH_VENDOR_ID) {
+			
+		printf ("ATTR{idVendor}==\"%04x\", ATTR{idProduct}==\"%04x\", ",
 			a->usb_vendor, a->usb_product);
+	} else {
+		fprintf(stderr, "Attempted to output rule for Camera: \"%s\" , Vendor: \"%04x\" , Product: \"%04x\"",
+				a->model, a->usb_vendor, a->usb_product);
+		return 0;
 	}
 	if ((*params->argv)[1] == NULL) {
 		const char *hotplug_script = ((*params->argv)[0] != NULL)