rpms/gphoto2/devel gphoto2-storage.patch, NONE, 1.1 gphoto2.spec, 1.83, 1.84

Jindrich Novy (jnovy) fedora-extras-commits at redhat.com
Tue Sep 18 20:41:33 UTC 2007


Author: jnovy

Update of /cvs/extras/rpms/gphoto2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1480

Modified Files:
	gphoto2.spec 
Added Files:
	gphoto2-storage.patch 
Log Message:
avoid tagging mass storage devices as cameras (#295051)

gphoto2-storage.patch:

--- NEW FILE gphoto2-storage.patch ---
--- gphoto2-2.4.0/libgphoto2-2.4.0/packaging/generic/print-camera-list.c.orig	2007-09-18 11:36:19.000000000 -0400
+++ gphoto2-2.4.0/libgphoto2-2.4.0/packaging/generic/print-camera-list.c	2007-09-18 11:52:42.000000000 -0400
@@ -799,6 +799,8 @@
 	printf("<deviceinfo version=\"0.2\">\n");
 	printf(" <device>\n");
 	printf("  <match key=\"info.bus\" string=\"usb\">\n");
+	printf("   <!-- skip USB Mass Storage Devices -->\n");
+	printf("   <match key=\"usb.interface_class\" compare_ne=\"8\">\n");
 	return 0;
 }
 
@@ -838,52 +840,52 @@
 			return 0;
 		}
 		if (a->usb_vendor) { /* usb product id might be 0! */
-			printf("   <match key=\"usb.vendor_id\" int=\"%d\">\n", a->usb_vendor);
-			printf("    <match key=\"usb.product_id\" int=\"%d\">\n", a->usb_product);
+			printf("    <match key=\"usb.vendor_id\" int=\"%d\">\n", a->usb_vendor);
+			printf("     <match key=\"usb.product_id\" int=\"%d\">\n", a->usb_product);
 			if (a->device_type & GP_DEVICE_AUDIO_PLAYER) {
-				printf("     <merge key=\"info.category\" type=\"string\">portable_audio_player</merge>\n");
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
-				printf("     <merge key=\"portable_audio_player.access_method\" type=\"string\">user</merge>\n");
-				printf("     <merge key=\"portable_audio_player.type\" type=\"string\">mtp</merge>\n");
+				printf("      <merge key=\"info.category\" type=\"string\">portable_audio_player</merge>\n");
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
+				printf("      <merge key=\"portable_audio_player.access_method\" type=\"string\">user</merge>\n");
+				printf("      <merge key=\"portable_audio_player.type\" type=\"string\">mtp</merge>\n");
 				
 				/* FIXME: needs true formats ... But all of them can do MP3 */
-				printf("     <append key=\"portable_audio_player.output_formats\" type=\"strlist\">audio/mpeg</append>\n");
+				printf("      <append key=\"portable_audio_player.output_formats\" type=\"strlist\">audio/mpeg</append>\n");
 			} else {
-				printf("     <merge key=\"info.category\" type=\"string\">camera</merge>\n");
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+				printf("      <merge key=\"info.category\" type=\"string\">camera</merge>\n");
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
 				
 				/* HACK alert ... but the HAL / gnome-volume-manager guys want that */
 				if (NULL!=strstr(a->library,"ptp"))
-					printf("     <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
+					printf("      <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
 				else
-					printf("     <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
+					printf("      <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
 			}
 			/* leave them here even for audio players */
-			printf("     <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
-			printf("     <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
+			printf("      <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
+			printf("      <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
+			printf("     </match>\n");
 			printf("    </match>\n");
-			printf("   </match>\n");
 			
 		} else if ((a->usb_class) && (a->usb_class != 666)) {
-			printf("   <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
-			printf("    <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
-			printf("     <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
-			printf("      <merge key=\"info.category\" type=\"string\">camera</merge>\n");
-			printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+			printf("    <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
+			printf("     <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
+			printf("      <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
+			printf("       <merge key=\"info.category\" type=\"string\">camera</merge>\n");
+			printf("       <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
 			if (a->usb_class == 6) {
-				printf("      <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
+				printf("       <merge key=\"camera.access_method\" type=\"string\">ptp</merge>\n");
 			} else {
 				if (a->usb_class == 8) {
-					printf("      <merge key=\"camera.access_method\" type=\"string\">storage</merge>\n");
+					printf("       <merge key=\"camera.access_method\" type=\"string\">storage</merge>\n");
 				} else {
-					printf("      <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
+					printf("       <merge key=\"camera.access_method\" type=\"string\">proprietary</merge>\n");
 				}
 			}
-			printf("      <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
-			printf("      <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
+			printf("       <merge key=\"camera.libgphoto2.name\" type=\"string\">%s</merge>\n", model);
+			printf("       <merge key=\"camera.libgphoto2.support\" type=\"bool\">true</merge>\n");
+			printf("      </match>\n");
 			printf("     </match>\n");
 			printf("    </match>\n");
-			printf("   </match>\n");
 		}
 	} /* camera has USB connection */
 	return 0;
@@ -892,6 +894,7 @@
 static int
 fdi_end_func (const func_params_t *params, void *data)
 {
+	printf("   </match>\n");
 	printf("  </match>\n");
 	printf(" </device>\n");
 	printf("</deviceinfo>\n");
@@ -918,6 +921,8 @@
 	printf("<deviceinfo version=\"0.2\">\n");
 	printf(" <device>\n");
 	printf("  <match key=\"info.bus\" string=\"usb\">\n");
+	printf("   <!-- skip USB Mass Storage Devices -->\n");
+	printf("   <match key=\"usb.interface_class\" compare_ne=\"8\">\n");
 	return 0;
 }
 
@@ -961,28 +966,28 @@
 			/* do not set category. We don't really know what this device really is.
 			 * But we do now that is capable of being a camera, so add to capabilities
 			 */
-			printf("   <match key=\"usb_device.vendor_id\" int=\"%d\">\n", a->usb_vendor);
-			printf("    <match key=\"usb_device.product_id\" int=\"%d\">\n", a->usb_product);
+			printf("    <match key=\"usb_device.vendor_id\" int=\"%d\">\n", a->usb_vendor);
+			printf("     <match key=\"usb_device.product_id\" int=\"%d\">\n", a->usb_product);
 			if (params->add_comments) {
 				printf("     <!-- %s -->\n", a->model);
 			}
 			if (a->device_type & GP_DEVICE_AUDIO_PLAYER)
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">portable_audio_player</append>\n");
 			else
-				printf("     <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+				printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+			printf("     </match>\n");
 			printf("    </match>\n");
-			printf("   </match>\n");
 		}
 #if 0
 		/* would need to be able to merge upwards ... but cannot currently */
 		else if ((a->usb_class) && (a->usb_class != 666)) {
-			printf("   <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
-			printf("    <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
-			printf("     <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
-			printf("      <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+			printf("    <match key=\"usb.interface.class\" int=\"%d\">\n", a->usb_class);
+			printf("     <match key=\"usb.interface.subclass\" int=\"%d\">\n", a->usb_subclass);
+			printf("      <match key=\"usb.interface.protocol\" int=\"%d\">\n", a->usb_protocol);
+			printf("       <append key=\"info.capabilities\" type=\"strlist\">camera</append>\n");
+			printf("      </match>\n");
 			printf("     </match>\n");
 			printf("    </match>\n");
-			printf("   </match>\n");
 		}
 #endif
 	}
@@ -992,6 +997,7 @@
 static int
 fdi_device_end_func (const func_params_t *params, void *data)
 {
+	printf("   </match>\n");
 	printf("  </match>\n");
 	printf(" </device>\n");
 	printf("</deviceinfo>\n");


Index: gphoto2.spec
===================================================================
RCS file: /cvs/extras/rpms/gphoto2/devel/gphoto2.spec,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- gphoto2.spec	23 Aug 2007 06:29:42 -0000	1.83
+++ gphoto2.spec	18 Sep 2007 20:41:01 -0000	1.84
@@ -8,13 +8,14 @@
 %define libpkg libgphoto2
 %define libver 2.4.0
 Version: %{pkgver}
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2 and LGPLv2+
 Group: Applications/Multimedia
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Source0: http://prdownloads.sourceforge.net/gphoto/%{pkg}-%{pkgver}.tar.bz2
 Source1: http://prdownloads.sourceforge.net/gphoto/%{libpkg}-%{libver}.tar.bz2
 Patch1: gphoto2-pkgcfg.patch
+Patch2: gphoto2-storage.patch
 Url: http://www.gphoto.org/
 ExcludeArch: s390 s390x
 Provides: libgphoto2 = %{libver}
@@ -68,6 +69,7 @@
 %prep
 %setup -q -a 1
 %patch1 -p1 -b .pkgcfg
+%patch2 -p1 -b .storage
 
 # write pkg-config stuff 
 cat > gphoto2.pc.in << EOF
@@ -197,6 +199,9 @@
 # ChangeLog
 ########################################################################
 %changelog
+* Tue Sep 18 2007 Jindrich Novy <jnovy at redhat.com> 2.4.0-3
+- avoid tagging mass storage devices as cameras (#295051)
+
 * Thu Aug 23 2007 Jindrich Novy <jnovy at redhat.com> 2.4.0-2
 - update License
 - rebuild for BuildID




More information about the fedora-extras-commits mailing list