[PATCHv2] mpi2*: add support for udev's hwdb
Martin Pitt
martin.pitt at ubuntu.com
Mon Jul 22 23:58:48 PDT 2013
Hey Tom,
thanks for your patch! I modified it (see below), the final result is
http://cgit.freedesktop.org/media-player-info/commit/?id=d83dd01a0a
Tom Gundersen [2013-07-19 15:40 +0200]:
> 40-usb-media-players.rules: $(dist_mpi_DATA) $(top_srcdir)/tools/mpi2udev.py
> - $(top_srcdir)/tools/mpi2udev.py $(dist_mpi_DATA) > 40-usb-media-players.rules
> + $(top_srcdir)/tools/mpi2udev.py $(UDEV_VER) $(dist_mpi_DATA) > 40-usb-media-players.rules
> $(top_srcdir)/tools/udev-syntax-check.py 40-usb-media-players.rules
>
> +udevhwdbdir = $(UDEV_DIR)/hwdb.d
> +dist_udevhwdb_DATA = 20-usb-media-players.hwdb
> +20-usb-media-players.hwdb: $(dist_mpi_DATA) $(top_srcdir)/tools/mpi2hwdb.py
> + $(top_srcdir)/tools/mpi2hwdb.py $(dist_mpi_DATA) > 20-usb-media-players.hwdb
> +
This would always build and install the hwdb even on systems with
older udev. I like it better if configure.ac checks for a new enough
udev and then the udev/hwdb are built conditionally.
> -rm -f 40-usb-media-players.rules
> -EXTRA_DIST = 40-usb-media-players.rules
> + -rm -f 20-usb-media-players.hwdb
> +EXTRA_DIST = 40-usb-media-players.rules 20-usb-media-players.hwdb
As it now depends on the udev version, we shouldn't ship the
pre-generated files any more.
> # catch UMS devices
> SUBSYSTEM!="block", GOTO="media_player_end"
> -SUBSYSTEMS=="usb", GOTO="media_player_start"
> -GOTO="media_player_end"
> +SUBSYSTEMS!="usb", GOTO="media_player_end"
I reverted this bit. SUBSYSTEMS!="usb" doesn't do something sensible,
and it is definitively not equivalent to the original two rules. It
would mean something like "any parent device is not an usb device"
which in practice is always true.
> +# the first argument should be the udev version
> +# if it is not we fall back to the old behaviour
> +try:
> + hwdb = int(sys.argv[1]) >= 196
> + mpis = sys.argv[2:]
> +except ValueError:
> + hwdb = 0
> + mpis = sys.argv[1:]
I changed that to always require "udev" or "hwdb" as first argument
now, less suprising.
Thanks!
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20130723/49fbfb7f/attachment.pgp>
More information about the devkit-devel
mailing list