[PATCH] add new fdi directives

Danny Kukawka danny.kukawka at web.de
Fri Aug 10 09:56:23 PDT 2007


Hi,

this patch introduce new fdi-file <match> directives for strings. The new are:
 - string_outof
 - prefix_outof
 - contains_outof

They all work like the normal directives (string, prefix, contains), but only 
on string properties and match against a ';'-separated list (any other ideas 
for a char as separator?) as in this examples:

  <match key="system.hardware.product" string_outof="foo;bar">
  - matches if "system.hardware.product" is 'foo' or 'bar'

  <match key="system.hardware.product" prefix_outof="foo;bar">
  - matches if "system.hardware.product" starts with 'foo' or 'bar'

  <match key="system.hardware.product" contains_outof="foo;bar">
  - matches if "system.hardware.product" contains the (sub-)string 
    'foo' or 'bar'

This new match directives allow us to reduce the size (and number of 
duplicated rules) of many fdi files in hal and hal-info. See as example a new 
version of fdi/information/10freedesktop/30-keymap-acer.fdi which I reduced 
from 28532 to 8123 bytes (which is ~ -72 %).

If this new directives are okay to commit I would also add a 'int_outof' to 
handle e.g. usb/pci ids e.g. for mp3 player.

Please review/comment.

Danny
 
hal-fdi-directive-_outof.diff:
 doc/spec/hal-spec-fdi-files.xml |   31 ++++++++++++++++++
 fdi/fdi.dtd                     |    3 +
 hald/create_cache.c             |    6 +++
 hald/device_info.c              |   51 ++++++++++++++++++++++++++++++
 hald/rule.h                     |    5 ++
 5 files changed, 95 insertions(+), 1 deletion(-)

hal-fdi-directive-_outof-keymap_Acer.diff:
 fdi.dtd                                      |    3
 information/10freedesktop/30-keymap-acer.fdi |  206 -----------------
 2 files changed, 8 insertions(+), 201 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fdi-directive-_outof-keymap_Acer.diff
Type: text/x-diff
Size: 24624 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070810/93322b79/attachment-0002.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fdi-directive-_outof.diff
Type: text/x-diff
Size: 6142 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070810/93322b79/attachment-0003.diff 


More information about the hal mailing list