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