Blame SOURCES/gphoto2-storage.patch

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