[Pkg-phototools-devel] Bug#531979: libgphoto2: Please create hal fdi at build time

Martin Pitt martin.pitt at ubuntu.com
Fri Jun 5 13:04:21 UTC 2009


Package: libgphoto2
Version: 2.4.6-1
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch karmic

Hello,

In https://launchpad.net/bugs/352271 and a couple of duplicates it was
reported that print-camera-list often crashes when the postinst runs.
This might be due to some half-configured libraries, but it's quite
dubious. But either way, the hal fdi should be statically shipped in
the package; it's much more robust than having to fiddle with it in
postinst and postrm.

Attached debdiff moves fdi creation into debian/rules to do it at
build time.

Thanks for considering,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
 * Move hal fdi creation from debian/libgphoto2-2.postinst to debian/rules.
   This avoids problems with half-configured libraries during
   upgrade/installation (LP: #352271), and is generally more robust as well.
diff -u libgphoto2-2.4.6/debian/rules libgphoto2-2.4.6/debian/rules
--- libgphoto2-2.4.6/debian/rules
+++ libgphoto2-2.4.6/debian/rules
@@ -97,6 +97,11 @@
 		mkdir -p debian/libgphoto2-port0/lib/udev && \
 		mv debian/tmp/usr/lib/udev/check-mtp-device \
 			debian/libgphoto2-port0/lib/udev/check-mtp-device
+
+	# create hal FDI
+	mkdir -p debian/libgphoto2-$(major)/usr/share/hal/fdi/preprobe/10osvendor/
+	./packaging/generic/print-camera-list hal-fdi > \
+		debian/libgphoto2-$(major)/usr/share/hal/fdi/preprobe/10osvendor/20-libgphoto2.fdi
 endif
 
 	# remove *.la files before trying to remove debian/tmp
--- libgphoto2-2.4.6/debian/libgphoto2-2.postrm
+++ libgphoto2-2.4.6/debian/libgphoto2-2.postrm
@@ -10,7 +10,6 @@
 	rm -f /usr/share/hal/fdi/information/20thirdparty/$PACKAGE.fdi || /bin/true
 	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE.fdi || /bin/true
 	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE-device.fdi || /bin/true
-	rm -f /usr/share/hal/fdi/preprobe/10osvendor/20-$PACKAGE.fdi || /bin/true
 	;;
 
     disappear|upgrade|failed-upgrade|abort-install|abort-upgrade)
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
@@ -7,11 +7,6 @@
 
 case "$1" in
     configure)
-	# create FDI file
-	mkdir -p /usr/share/hal/fdi/preprobe/10osvendor/ || true
-	/usr/lib/$PACKAGE/print-camera-list hal-fdi > \
-		/usr/share/hal/fdi/preprobe/10osvendor/20-$PACKAGE.fdi
-	
 	# remove old fdi files
 	rm -f /usr/share/hal/fdi/information/10freedesktop/10-camera-$PACKAGE.fdi
 	rm -f /usr/share/hal/fdi/information/20thirdparty/$PACKAGE.fdi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-phototools-devel/attachments/20090605/eaeb2023/attachment.pgp>


More information about the Pkg-phototools-devel mailing list