Your message dated Mon, 08 Nov 2010 20:33:22 +0000
with message-id <[email protected]>
and subject line Bug#531978: fixed in libgphoto2 2.4.6-2
has caused the Debian Bug report #531978,
regarding libgphoto2: Please modernize udev rules
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
531978: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531978
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libgphoto2
Version: 2.4.6-1
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch karmic

Hello,

I recently did some ramblings about modernizing libgphoto2's udev
rules to work in a Linux world without hal [1]. I added a new udev
rule mode "136" and while I was at it, replaced the slow
check-ptp-camera shell script with a more efficient udev db query.
The patch got committed upstream now.

This doesn't break functionality with hal at all, of course.

This debdiff applies it to the Debian package and also moves udev rule
creation from postinst to debian/rules. This is possible now, since
from udev 136 on, rules are shipped in /lib/udev/rules.d/, thus
avoid becoming conffiles.

Thanks for considering,

Martin

[1] http://lists.freedesktop.org/archives/devkit-devel/2009-June/000191.html
[2] 
https://sourceforge.net/tracker/?func=detail&aid=2801117&group_id=8874&atid=308874

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
 * Add patch 01_udev_rules_136: Add a new udev mode "136" to create
   contemporary udev rules which will avoid using the check_ptp_camera
   script, and provide udev DB tags for the hal deprecation. (Now accepted
   into upstream svn).
 * debian/libgphoto2-2.postinst: Drop udev rule creation. Udev rules are
   shipped in /lib now since udev 136, thus we can do it at build time. Drop
   debian/libgphoto2-2.dirs for this.
 * debian/rules: Create udev rules (with new mode 136), install them with
   dh_installudev.

diff -u libgphoto2-2.4.6/debian/libgphoto2-2.postinst 
libgphoto2-2.4.6/debian/libgphoto2-2.postinst
--- libgphoto2-2.4.6/debian/libgphoto2-2.postinst
+++ libgphoto2-2.4.6/debian/libgphoto2-2.postinst
@@ -16,25 +16,6 @@
        rm -f 
/usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE.fdi
        rm -f /usr/share/hal/fdi/information/20thirdparty/$PACKAGE.fdi
        rm -f 
/usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE-device.fdi
-
-       # create udev rules file
-       if [ -d /etc/udev/ ]; then
-           /usr/lib/$PACKAGE/print-camera-list udev-rules version 0.98 mode 
0664 group plugdev > /etc/udev/$PACKAGE.rules
-           # install the udev file only once:
-           #    - the first time the package is installed
-           # OR - the first time the package is upgraded from a version 
earlier than 2.1.6-5.1
-           if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.1.6-5.1 ; then
-               ln -sf ../$PACKAGE.rules /etc/udev/rules.d/025_$PACKAGE.rules
-           fi
-
-           if [ -L /etc/udev/rules.d/020_libgphoto2_generic-ptp_support.rules 
]; then
-               rm -f /etc/udev/rules.d/020_libgphoto2_generic-ptp_support.rules
-           fi
-
-           if [ -f /etc/udev/libgphoto2_generic-ptp_support.rules ]; then
-               rm -f /etc/udev/libgphoto2_generic-ptp_support.rules
-           fi
-       fi
        ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff -u libgphoto2-2.4.6/debian/libgphoto2-2.postrm 
libgphoto2-2.4.6/debian/libgphoto2-2.postrm
diff -u libgphoto2-2.4.6/debian/changelog libgphoto2-2.4.6/debian/changelog
--- libgphoto2-2.4.6/debian/rules
+++ libgphoto2-2.4.6/debian/rules
@@ -85,8 +85,14 @@
                debian/libgphoto2-port0/usr/share/doc/libgphoto2-port0
 
 ifeq ($(DEB_HOST_ARCH_OS),linux)
-       install -D packaging/generic/check-ptp-camera 
debian/libgphoto2-$(major)/lib/udev/check-ptp-camera
+       # we don't need this any more with current udev
        rm debian/tmp/usr/lib/udev/check-ptp-camera
+
+       # create udev rules
+       ./packaging/generic/print-camera-list udev-rules version 136 mode 0664 
group plugdev > debian/libgphoto2-$(major).udev
+       dh_installudev
+       rm debian/libgphoto2-$(major).udev
+
        -test -e debian/tmp/usr/lib/udev/check-mtp-device && \
                mkdir -p debian/libgphoto2-port0/lib/udev && \
                mv debian/tmp/usr/lib/udev/check-mtp-device \
@@ -122,7 +128,7 @@
        dh_gencontrol -plibgphoto2-$(major)-dev
        dh_gencontrol -plibgphoto2-port0
 ifeq (linux,$(DEB_HOST_ARCH_OS))
-       dh_gencontrol -plibgphoto2-$(major) -- -Vudev-hotplug='udev (>= 
0.113-1)'
+       dh_gencontrol -plibgphoto2-$(major) -- -Vudev-hotplug='udev (>= 0.136)'
 else
        dh_gencontrol -plibgphoto2-$(major)
 endif
reverted:
--- libgphoto2-2.4.6/debian/libgphoto2-2.dirs
+++ libgphoto2-2.4.6.orig/debian/libgphoto2-2.dirs
@@ -1 +0,0 @@
-etc/udev/rules.d
diff -u libgphoto2-2.4.6/debian/patches/series 
libgphoto2-2.4.6/debian/patches/series
--- libgphoto2-2.4.6/debian/patches/series
+++ libgphoto2-2.4.6/debian/patches/series
@@ -1,3 +1,4 @@
+01_udev_rules_136
 10_disable_cache
 #11_hurd_no_path_max_bsdsource
 #45_increase_canon_timeout
only in patch2:
unchanged:
--- libgphoto2-2.4.6.orig/debian/patches/01_udev_rules_136
+++ libgphoto2-2.4.6/debian/patches/01_udev_rules_136
@@ -0,0 +1,108 @@
+# Description: Add a new udev mode "136" to create contemporary udev rules 
which will avoid using the check_ptp_camera script, and provide udev DB tags 
for the hal deprecation. See 
http://lists.freedesktop.org/archives/devkit-devel/2009-June/000191.html for 
discussion.
+# Upstream: 
http://sourceforge.net/tracker/?func=detail&aid=2801117&group_id=8874&atid=308874
 (in svn head)
+Index: libgphoto2-2.4.6/packaging/generic/print-camera-list.c
+===================================================================
+--- libgphoto2-2.4.6.orig/packaging/generic/print-camera-list.c        
2009-06-05 13:34:52.000000000 +0200
++++ libgphoto2-2.4.6/packaging/generic/print-camera-list.c     2009-06-05 
13:35:17.000000000 +0200
+@@ -366,12 +366,14 @@
+ 
+ typedef enum {
+               UDEV_PRE_0_98 = 0,
+-              UDEV_0_98 = 1
++              UDEV_0_98 = 1,
++              UDEV_136 = 2
+ } udev_version_t;
+ 
+ static const StringFlagItem udev_version_t_map[] = {
+       { "pre-0.98", UDEV_PRE_0_98 },
+       { "0.98", UDEV_0_98 },
++      { "136", UDEV_136 },
+       { NULL, 0 }
+ };
+ 
+@@ -399,13 +401,20 @@
+               "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n",
+               /* UDEV_0_98 */
+               "SUBSYSTEM!=\"usb|usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
++              "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n",
++              /* UDEV_136 */
++              "SUBSYSTEM!=\"usb\", GOTO=\"libgphoto2_rules_end\"\n"
++              "ENV{DEVTYPE}!=\"usb_device\", GOTO=\"libgphoto2_rules_end\"\n"
+               "ACTION!=\"add\", GOTO=\"libgphoto2_rules_end\"\n\n"
++              "ENV{ID_USB_INTERFACES}==\"\", IMPORT{program}=\"usb_id 
--export %%p\"\n\n"
+       };
+       static const char * const usbcam_strings[] = {
+               /* UDEV_PRE_0_98 */
+-              "SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", ",
++              "SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\"",
+               /* UDEV_0_98 */
+-              "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ",
++              "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\"",
++              /* UDEV_136 */
++              "ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", 
ENV{ID_GPHOTO2}=\"1\", ENV{GPHOTO2_DRIVER}=\"proprietary\""
+       };
+       udev_persistent_data_t *pdata;
+       pdata = calloc(1, sizeof(udev_persistent_data_t));
+@@ -444,7 +453,8 @@
+           && pdata->mode == NULL 
+           && pdata->group == NULL 
+           && pdata->owner == NULL 
+-          && pdata->script == NULL) {
++          && pdata->script == NULL
++          && pdata->version <= UDEV_0_98) {
+               FATAL("Either <script> or <mode,group,owner> parameters must be 
given.");
+       }
+       if ((pdata->script != NULL) && (pdata->mode != NULL 
+@@ -547,7 +557,11 @@
+ 
+       if (flags & GP_USB_HOTPLUG_MATCH_INT_CLASS) {
+               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))
 {
+-                      printf("PROGRAM=\"check-ptp-camera %02d/%02d/%02d\", ", 
class, subclass, proto);
++                      if (pdata->version == UDEV_136) {
++                              
printf("ENV{ID_USB_INTERFACES}==\"*:%02d%02d%02d:*\", ENV{ID_GPHOTO2}=\"1\", 
ENV{GPHOTO2_DRIVER}=\"PTP\"", class, subclass, proto);
++                      } else {
++                              printf("PROGRAM=\"check-ptp-camera 
%02d/%02d/%02d\"", class, subclass, proto);
++                      }
+                       has_valid_rule = 1;
+               } else {
+                       if (class == 666) {
+@@ -568,6 +582,9 @@
+               }
+       }
+       if (has_valid_rule != 0) {
++              if (pdata->script != NULL || pdata->mode != NULL || 
pdata->owner != NULL || pdata->group != NULL)
++                      printf(", ");
++
+               if (pdata->script != NULL) {
+                       printf("RUN+=\"%s\"\n", pdata->script);
+               } else if (pdata->mode != NULL || pdata->owner != NULL || 
pdata->group != NULL) {
+@@ -589,7 +606,8 @@
+                       printf("\n");
+               } else {
+                       printf("\n");
+-                      FATAL("udev_camera_func(): illegal branch");
++                      if (pdata->version < UDEV_136)
++                              FATAL("udev_camera_func(): illegal branch");
+               }
+       }
+       return 0;
+@@ -1118,12 +1136,16 @@
+        fdi_device_end_func
+       },
+       {"udev-rules",
+-       "udev rules file either for pre-0.98 or 0.98 and later",
+-       "Put it into /etc/udev/rules.d/90-libgphoto2.rules, set file mode, 
owner, group\n"
++       "udev rules file",
++       "For modes \"pre-0.98\" and \"0.98\" (and later), put it into\n"
++       "        /etc/udev/rules.d/90-libgphoto2.rules, set file mode, owner, 
group\n"
+        "        or add script to run. This rule files also uses the\n"
+        "        check-ptp-camera script included in libgphoto2 source. Either 
put it to\n"
+        "        /lib/udev/check-ptp-camera or adjust the path in the 
generated rules file.\n"
+-       "        If you give a script parameter, the mode, owner, group 
parameters will be ignored.",
++       "        If you give a script parameter, the mode, owner, group 
parameters will be ignored.\n"
++       "        For mode \"136\" put it into 
/lib/udev/rules.d/40-libgphoto2.rules;\n"
++       "        you can still use mode/owner/group, but the preferred mode of 
operation\n"
++       "        is to use udev-extras for dynamic access permissions.\n",
+        "[script <PATH_TO_SCRIPT>|version <version>|mode <mode>|owner 
<owner>|group <group>]*",
+        udev_begin_func, 
+        udev_camera_func,

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: libgphoto2
Source-Version: 2.4.6-2

We believe that the bug you reported is fixed in the latest version of
libgphoto2, which is due to be installed in the Debian FTP archive:

libgphoto2-2-dev_2.4.6-2_i386.deb
  to main/libg/libgphoto2/libgphoto2-2-dev_2.4.6-2_i386.deb
libgphoto2-2_2.4.6-2_i386.deb
  to main/libg/libgphoto2/libgphoto2-2_2.4.6-2_i386.deb
libgphoto2-port0_2.4.6-2_i386.deb
  to main/libg/libgphoto2/libgphoto2-port0_2.4.6-2_i386.deb
libgphoto2_2.4.6-2.diff.gz
  to main/libg/libgphoto2/libgphoto2_2.4.6-2.diff.gz
libgphoto2_2.4.6-2.dsc
  to main/libg/libgphoto2/libgphoto2_2.4.6-2.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David Paleino <[email protected]> (supplier of updated libgphoto2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 08 Nov 2010 11:19:51 +0100
Source: libgphoto2
Binary: libgphoto2-2-dev libgphoto2-port0 libgphoto2-2
Architecture: source i386
Version: 2.4.6-2
Distribution: unstable
Urgency: low
Maintainer: Debian PhotoTools Maintainers 
<[email protected]>
Changed-By: David Paleino <[email protected]>
Description: 
 libgphoto2-2 - gphoto2 digital camera library
 libgphoto2-2-dev - gphoto2 digital camera library (development files)
 libgphoto2-port0 - gphoto2 digital camera port library
Closes: 531974 531978
Changes: 
 libgphoto2 (2.4.6-2) unstable; urgency=low
 .
   * Merge Ubuntu patches, by Martin Pitt (thanks!):
     - Update Build-Depends: Move from libltdl3-dev to libltdl-dev
       (Closes: #531974).
     - Create modern udev rules at build-time instead of at install-time
       thanks to a patch sent (and now merged) upstream. Drop a lot of
       code from libgphoto2-2.postinst accordingly, while adding the
       generation code to debian/rules. Also bump the versioned dependency
       on udev from 0.113-1 to 0.136 (Closes: #531978).
   * Added myself to Uploaders
Checksums-Sha1: 
 45ce9e1413c0955074a6058f5565ee197da24587 1637 libgphoto2_2.4.6-2.dsc
 97635c4448ea8d47d73dab7c065d9d7b897cac46 23704 libgphoto2_2.4.6-2.diff.gz
 26d7167243dcbe5369ec7de4abf8fe9bb0784ae3 4583814 
libgphoto2-2-dev_2.4.6-2_i386.deb
 5e1a2db8bcd9e626700fac02111dff63a7404222 138314 
libgphoto2-port0_2.4.6-2_i386.deb
 e78c585e5b9ef3e7d43ff0e83a9469d8295b31a0 1510800 libgphoto2-2_2.4.6-2_i386.deb
Checksums-Sha256: 
 7dc4485de341f3717dc51d5c64752d4bc18d9f11324f0e4f5633f80da56c9799 1637 
libgphoto2_2.4.6-2.dsc
 a8241d258295ad2e24bf37e82befbe1ce18853d99a424bedde2541e83516fd56 23704 
libgphoto2_2.4.6-2.diff.gz
 87529a4d3c654f335321b83b465d1b44bedea849a7acee97c0672deb4b5d4a1c 4583814 
libgphoto2-2-dev_2.4.6-2_i386.deb
 87aa2d2155ed5dfbb8c80e1e440ac9a1bb60519039440c70c9b20a22b5e1e003 138314 
libgphoto2-port0_2.4.6-2_i386.deb
 1778b1baa82446e89ce0d71872480217bb36595d0a46810cb005e0c53d856915 1510800 
libgphoto2-2_2.4.6-2_i386.deb
Files: 
 656cbda082ccaaa5e7a3364984af6e43 1637 libs optional libgphoto2_2.4.6-2.dsc
 ca5340a97688114d9dc913a1e1c3ef81 23704 libs optional libgphoto2_2.4.6-2.diff.gz
 fa3db8a26bc48508fc29e4b2ca1b1de9 4583814 libdevel optional 
libgphoto2-2-dev_2.4.6-2_i386.deb
 795dc7e1e7b5224bcf2ced8a051b75cb 138314 libs optional 
libgphoto2-port0_2.4.6-2_i386.deb
 2fd135ed1077d78bb7cf2e9333b6f2bf 1510800 libs optional 
libgphoto2-2_2.4.6-2_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAkzYUMUACgkQ5qqQFxOSsXS1HwCeP4Q435Jl7+nWKal3W6AUd+/V
5jwAoMb8gA6GRT2IBbcfJQnK6LSWRkbU
=zjnk
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to