Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 153471 | Differences between
and this patch

Collapse All | Expand All

(-)libgphoto2-2.2.1-orig/packaging/generic/check_ptp_camera (+20 lines)
Line 0 Link Here
1
#!/bin/sh
2
 
3
# check if any interface of this device is a PTP camera interface (06)
4
INTERFACE="${1:-06/01/01}"
5
6
BASENAME=${PHYSDEVPATH##*/}
7
for d in /sys/${PHYSDEVPATH}/${BASENAME}:*; do
8
	[[ -d ${d} ]] || continue
9
	INTERFACEID="$(< ${d}/bInterfaceClass)"
10
	INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceSubClass)"
11
	INTERFACEID="${INTERFACEID}/$(< ${d}/bInterfaceProtocol)"
12
13
	#echo ${d}: ${INTERFACEID}
14
	if [[ ${INTERFACE} == ${INTERFACEID} ]]; then
15
		# Found interface
16
		exit 0
17
	fi
18
done
19
 
20
exit 1
(-)libgphoto2-2.2.1-orig/packaging/generic/Makefile.am (+1 lines)
Lines 2-7 Link Here
2
#       policies
2
#       policies
3
utilsdir = $(libdir)/$(PACKAGE)
3
utilsdir = $(libdir)/$(PACKAGE)
4
utils_PROGRAMS = print-camera-list
4
utils_PROGRAMS = print-camera-list
5
EXTRA_DIST = check_ptp_camera
5
6
6
# print_camera_list_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
7
# print_camera_list_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
7
print_camera_list_SOURCE = print-camera-list.c
8
print_camera_list_SOURCE = print-camera-list.c
(-)libgphoto2-2.2.1-orig/packaging/generic/print-camera-list.c (-22 / +18 lines)
Lines 105-111 Link Here
105
	} while (0)
105
	} while (0)
106
#endif /* __GNUC__ */
106
#endif /* __GNUC__ */
107
107
108
109
/* print_usb_usermap
108
/* print_usb_usermap
110
 *
109
 *
111
 * Print out lines that can be included into usb.usermap 
110
 * Print out lines that can be included into usb.usermap 
Lines 262-274 Link Here
262
261
263
262
264
static int
263
static int
265
udev_begin_func (const func_params_t *params)
264
udev_098_begin_func (const func_params_t *params)
266
{
265
{
267
	printf ("# udev rules file for libgphoto2\n#\n");
266
	printf ("# udev rules file for libgphoto2 devices (udev >= 0.98)\n#\n");
268
	printf ("BUS!=\"usb\", ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n");	
267
	printf ("ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n");
268
	printf ("SUBSYSTEM!=\"usb*\", GOTO=\"libgphoto2_rules_end\"\n\n");
269
	return 0;
269
	return 0;
270
}
270
}
271
271
			
272
static int
272
static int
273
udev_end_func (const func_params_t *params)
273
udev_end_func (const func_params_t *params)
274
{
274
{
Lines 280-286 Link Here
280
280
281
281
282
static int
282
static int
283
udev_camera_func (const func_params_t *params, 
283
udev_098_camera_func (const func_params_t *params, 
284
		  const int i,
284
		  const int i,
285
		  const CameraAbilities *a)
285
		  const CameraAbilities *a)
286
{
286
{
Lines 324-345 Link Here
324
	}
324
	}
325
	
325
	
326
	if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) {
326
	if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) {
327
		printf("SYSFS{bInterfaceClass}==\"%02x\", ", class);
327
		if ((flags & (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL)) == (GP_USB_HOTPLUG_MATCH_INT_CLASS|GP_USB_HOTPLUG_MATCH_INT_SUBCLASS|GP_USB_HOTPLUG_MATCH_INT_PROTOCOL))
328
		if (flags & GP_USB_HOTPLUG_MATCH_INT_SUBCLASS) {
328
			printf("PROGRAM=\"check_ptp_camera %02d/%02d/%02d\", ", class, subclass, proto);
329
			printf("SYSFS{bInterfaceSubClass}==\"%02x\", ", subclass);
329
		else
330
		}
330
			fprintf(stderr,"unhandled interface match flags %x\n", flags);
331
		if (flags & GP_USB_HOTPLUG_MATCH_INT_PROTOCOL) {
332
			printf("SYSFS{bInterfaceProtocol}==\"%02x\", ", proto);
333
			}
334
	} else {
331
	} else {
335
		printf ("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ",
332
		printf ("ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ",
336
			a->usb_vendor, a->usb_product);
333
			a->usb_vendor, a->usb_product);
337
	}
334
	}
338
	printf("RUN+=\"%s\"\n", hotplug_script);
335
	printf("MODE=\"660\", GROUP=\"plugdev\"\n");
339
	return 0;
336
	return 0;
340
}
337
}
341
338
342
343
static int
339
static int
344
empty_begin_func (const func_params_t *params)
340
empty_begin_func (const func_params_t *params)
345
{
341
{
Lines 647-658 Link Here
647
	 camera_func: fdi_device_camera_func,
643
	 camera_func: fdi_device_camera_func,
648
	 end_func: fdi_device_end_func
644
	 end_func: fdi_device_end_func
649
	},
645
	},
650
	{name: "udev-rules",
646
	{name: "udev-rules-0.98",
651
	 descr: "udev rules file",
647
	 descr: "udev >= 0.98 rules file",
652
	 help: "Put it into /etc/udev/libgphoto2.rules",
648
	 help: "Put it into /etc/udev/libgphoto2.rules, for udev >= 0.98",
653
	 paramdescr: "<PATH_TO_HOTPLUG_SCRIPT>",
649
	 paramdescr: "( <PATH_TO_SCRIPT> | [mode <mode>|owner <owner>|group <group>]* ) ",
654
	 begin_func: udev_begin_func, 
650
	 begin_func: udev_098_begin_func, 
655
	 camera_func: udev_camera_func,
651
	 camera_func: udev_098_camera_func,
656
	 end_func: udev_end_func
652
	 end_func: udev_end_func
657
	},
653
	},
658
	{name: "idlist",
654
	{name: "idlist",

Return to bug 153471