Blame SOURCES/gphoto2-storage.patch

1093f1
diff -up libgphoto2-2.4.7/packaging/generic/print-camera-list.c.storage libgphoto2-2.4.7/packaging/generic/print-camera-list.c
1093f1
--- libgphoto2-2.4.7/packaging/generic/print-camera-list.c.storage	2009-08-11 17:11:27.000000000 +0200
1093f1
+++ libgphoto2-2.4.7/packaging/generic/print-camera-list.c	2009-08-19 15:44:41.000000000 +0200
1093f1
@@ -819,6 +819,8 @@ fdi_begin_func (const func_params_t *par
1093f1
 	printf("<deviceinfo version=\"0.2\">\n");
1093f1
 	printf(" <device>\n");
1093f1
 	printf("  <match key=\"info.subsystem\" string=\"usb\">\n");
1093f1
+	printf("   \n");
1093f1
+	printf("   <match key=\"usb.interface.class\" compare_ne=\"8\">\n");
1093f1
 	return 0;
1093f1
 }
1093f1
 
1093f1
@@ -858,62 +860,62 @@ fdi_camera_func (const func_params_t *pa
1093f1
 			return 0;
1093f1
 		}
1093f1
 		if (a->usb_vendor) { /* usb product id might be 0! */
1093f1
-			printf("   <match key=\"usb.vendor_id\" int=\"%d\">\n", a->usb_vendor);
1093f1
-			printf("    <match key=\"usb.product_id\" int=\"%d\">\n", a->usb_product);
1093f1
+			printf("    <match key=\"usb.vendor_id\" int=\"%d\">\n", a->usb_vendor);
1093f1
+			printf("     <match key=\"usb.product_id\" int=\"%d\">\n", a->usb_product);
1093f1
 			if (a->usb_vendor == 0x05ac) { /* Apple iPhone, PTP user. */
1093f1
-				printf("     <match key=\"usb.interface.class\" int=\"6\">\n");
1093f1
-				printf("      <match key=\"usb.interface.subclass\" int=\"1\">\n");
1093f1
-				printf("       <match key=\"usb.interface.protocol\" int=\"1\">\n");
1093f1
+				printf("      <match key=\"usb.interface.class\" int=\"6\">\n");
1093f1
+				printf("       <match key=\"usb.interface.subclass\" int=\"1\">\n");
1093f1
+				printf("        <match key=\"usb.interface.protocol\" int=\"1\">\n");
1093f1
 			}
1093f1
 			if (a->device_type & GP_DEVICE_AUDIO_PLAYER) {
1093f1
-				printf("     <merge key=\"info.category\" type=\"string\">portable_audio_player</merge>\n");
1093f1
-				printf("     <addset key=\"info.capabilities\" type=\"strlist\">portable_audio_player</addset>\n");
1093f1
-				printf("     <merge key=\"portable_audio_player.access_method\" type=\"string\">user</merge>\n");
1093f1
-				printf("     <merge key=\"portable_audio_player.type\" type=\"string\">mtp</merge>\n");
1093f1
+				printf("      <merge key=\"info.category\" type=\"string\">portable_audio_player</merge>\n");
1093f1
+				printf("      <addset key=\"info.capabilities\" type=\"strlist\">portable_audio_player</addset>\n");
1093f1
+				printf("      <merge key=\"portable_audio_player.access_method\" type=\"string\">user</merge>\n");
1093f1
+				printf("      <merge key=\"portable_audio_player.type\" type=\"string\">mtp</merge>\n");
1093f1
 				
1093f1
 				/* FIXME: needs true formats ... But all of them can do MP3 */
1093f1
-				printf("     <append key=\"portable_audio_player.output_formats\" type=\"strlist\">audio/mpeg</append>\n");
1093f1
+				printf("      <append key=\"portable_audio_player.output_formats\" type=\"strlist\">audio/mpeg</append>\n");
1093f1
 			} else {
1093f1
-				printf("     <merge key=\"info.category\" type=\"string\">camera</merge>\n");
1093f1
-				printf("     <addset key=\"info.capabilities\" type=\"strlist\">camera</addset>\n");
1093f1
+				printf("      <merge key=\"info.category\" type=\"string\">camera</merge>\n");
1093f1
+				printf("      <addset key=\"info.capabilities\" type=\"strlist\">camera</addset>\n");
1093f1
 
1093f1
 				/* HACK alert ... but the HAL / gnome-volume-manager guys want that */
1093f1
 				if (NULL!=strstr(a->library,"ptp"))
1093f1
-					printf("     <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
1093f1
+					printf("      <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
1093f1
 				else
1093f1
-					printf("     <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
1093f1
+					printf("      <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
1093f1
 			}
1093f1
 			/* leave them here even for audio players */
1093f1
-			printf("     <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
1093f1
-			printf("     <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
1093f1
+			printf("      <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
1093f1
+			printf("      <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
1093f1
 			if (a->usb_vendor == 0x05ac) { /* Apple iPhone */
1093f1
+				printf("        </match>\n");
1093f1
 				printf("       </match>\n");
1093f1
 				printf("      </match>\n");
1093f1
-				printf("     </match>\n");
1093f1
 			}
1093f1
+			printf("     </match>\n");
1093f1
 			printf("    </match>\n");
1093f1
-			printf("   </match>\n");
1093f1
 			
1093f1
 		} else if ((a->usb_class) && (a->usb_class != 666)) {
1093f1
-			printf("   <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
1093f1
-			printf("    <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
1093f1
-			printf("     <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
1093f1
-			printf("      <merge key=\"info.category\" type=\"string\">camera</merge>\n");
1093f1
-			printf("      <addset key=\"info.capabilities\" type=\"strlist\">camera</addset>\n");
1093f1
+			printf("    <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
1093f1
+			printf("     <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
1093f1
+			printf("      <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
1093f1
+			printf("       <merge key=\"info.category\" type=\"string\">camera</merge>\n");
1093f1
+			printf("       <addset key=\"info.capabilities\" type=\"strlist\">camera</addset>\n");
1093f1
 			if (a->usb_class == 6) {
1093f1
-				printf("      <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
1093f1
+				printf("       <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
1093f1
 			} else {
1093f1
 				if (a->usb_class == 8) {
1093f1
-					printf("      <merge key=\"camera.access_method\" type=\"string\">storage</merge>\n");
1093f1
+					printf("       <merge key=\"camera.access_method\" type=\"string\">storage</merge>\n");
1093f1
 				} else {
1093f1
-					printf("      <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
1093f1
+					printf("       <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
1093f1
 				}
1093f1
 			}
1093f1
-			printf("      <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
1093f1
-			printf("      <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
1093f1
+			printf("       <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
1093f1
+			printf("       <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
1093f1
+			printf("      </match>\n");
1093f1
 			printf("     </match>\n");
1093f1
 			printf("    </match>\n");
1093f1
-			printf("   </match>\n");
1093f1
 		}
1093f1
 	} /* camera has USB connection */
1093f1
 	return 0;
1093f1
@@ -922,6 +924,7 @@ fdi_camera_func (const func_params_t *pa
1093f1
 static int
1093f1
 fdi_end_func (const func_params_t *params, void *data)
1093f1
 {
1093f1
+	printf("   </match>\n");
1093f1
 	printf("  </match>\n");
1093f1
 	printf(" </device>\n");
1093f1
 	printf("</deviceinfo>\n");
1093f1
@@ -948,6 +951,8 @@ fdi_device_begin_func (const func_params
1093f1
 	printf("<deviceinfo version=\"0.2\">\n");
1093f1
 	printf(" <device>\n");
1093f1
 	printf("  <match key=\"info.subsystem\" string=\"usb\">\n");
1093f1
+	printf("   \n");
1093f1
+	printf("   <match key=\"usb.interface.class\" compare_ne=\"8\">\n");
1093f1
 	return 0;
1093f1
 }
1093f1
 
1093f1
@@ -991,28 +996,28 @@ fdi_device_camera_func (const func_param
1093f1
 			/* do not set category. We don't really know what this device really is.
1093f1
 			 * But we do now that is capable of being a camera, so add to capabilities
1093f1
 			 */
1093f1
-			printf("   <match key=\"usb_device.vendor_id\" int=\"%d\">\n", a->usb_vendor);
1093f1
-			printf("    <match key=\"usb_device.product_id\" int=\"%d\">\n", a->usb_product);
1093f1
+			printf("    <match key=\"usb_device.vendor_id\" int=\"%d\">\n", a->usb_vendor);
1093f1
+			printf("     <match key=\"usb_device.product_id\" int=\"%d\">\n", a->usb_product);
1093f1
 			if (params->add_comments) {
1093f1
 				printf("     \n", a->model);
1093f1
 			}
1093f1
 			if (a->device_type & GP_DEVICE_AUDIO_PLAYER)
1093f1
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
1093f1
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
1093f1
 			else
1093f1
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
1093f1
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
1093f1
+			printf("     </match>\n");
1093f1
 			printf("    </match>\n");
1093f1
-			printf("   </match>\n");
1093f1
 		}
1093f1
 #if 0
1093f1
 		/* would need to be able to merge upwards ... but cannot currently */
1093f1
 		else if ((a->usb_class) && (a->usb_class != 666)) {
1093f1
-			printf("   <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
1093f1
-			printf("    <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
1093f1
-			printf("     <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
1093f1
-			printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
1093f1
+			printf("    <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
1093f1
+			printf("     <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
1093f1
+			printf("      <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
1093f1
+			printf("       <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
1093f1
+			printf("      </match>\n");
1093f1
 			printf("     </match>\n");
1093f1
 			printf("    </match>\n");
1093f1
-			printf("   </match>\n");
1093f1
 		}
1093f1
 #endif
1093f1
 	}
1093f1
@@ -1022,6 +1027,7 @@ fdi_device_camera_func (const func_param
1093f1
 static int
1093f1
 fdi_device_end_func (const func_params_t *params, void *data)
1093f1
 {
1093f1
+	printf("   </match>\n");
1093f1
 	printf("  </match>\n");
1093f1
 	printf(" </device>\n");
1093f1
 	printf("</deviceinfo>\n");