[Bug 205669] New: HAL fdi file: <append key="..." type="strlist"> writes multiple same strings
https://bugzilla.novell.com/show_bug.cgi?id=205669 Summary: HAL fdi file: <append key="..." type="strlist"> writes multiple same strings Product: SUSE Linux 10.1 Version: Final Platform: i386 OS/Version: SuSE Linux 10.1 Status: NEW Severity: Normal Priority: P5 - None Component: Hotplug AssignedTo: dkukawka@novell.com ReportedBy: jsmeix@novell.com QAContact: qa@suse.de Perhaps I misunderstand the documentation: /usr/share/doc/packages/hal/spec/hal-spec.html#spec-device-info reads in section "Chapter 7. Device Information Files" that "merge" for a "strlist" will overwrite the whole list so that I must use "append" to add something. But this seems not to check if the added string is already in the list so that multiple same strings can be added to the same strlist. For example when I use the follwing in a fdi file: --------------------------------------------------------------------------- <match key="resmgr.class" exists="true"> <append key="info.callouts.add" type="strlist">hal-resmgr</append> <append key="info.callouts.remove" type="strlist">hal-resmgr</append> </match> <match key="info.capabilities" contains="scanner"> <append key="info.callouts.add" type="strlist">hal-resmgr</append> <append key="info.callouts.remove" type="strlist">hal-resmgr</append> </match> --------------------------------------------------------------------------- and both items match for a particular UDI, I get in "lshal" --------------------------------------------------------------------------- udi = '/org/freedesktop/Hal/devices/usb_device_4a9_220e_noserial_usbraw' info.callouts.add = {'hal-resmgr', 'hal-resmgr'} (string list) info.callouts.remove = {'hal-resmgr', 'hal-resmgr'} (string list) info.capabilities = {'usbraw', 'scanner'} (string list) ... resmgr.class = 'scanner' (string) ... --------------------------------------------------------------------------- In this particular case I could avoid the problem because I can test if the first item does not match like --------------------------------------------------------------------------- <match key="resmgr.class" exists="true"> <append key="info.callouts.add" type="strlist">hal-resmgr</append> <append key="info.callouts.remove" type="strlist">hal-resmgr</append> </match> <match key="info.capabilities" contains="scanner"> <match key="resmgr.class" exists="false"> <append key="info.callouts.add" type="strlist">hal-resmgr</append> <append key="info.callouts.remove" type="strlist">hal-resmgr</append> </match> </match> --------------------------------------------------------------------------- but I don't know how to specify such a test in general. I.e. I would need a "nomatch" or a general kind of "if-else" clause. Even if I could test in gereral, I think it is inconvenient to require such a test. I.e. I would expect that "append/prepend" has "add" semantics for a set - i.e. don't add duplicates. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=205669 dkukawka@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|Normal |Enhancement ------- Comment #1 from dkukawka@novell.com 2006-09-14 09:45 MST ------- I already discussed the problems with append/prepend commands for strlist, but the current behavior is the whished one. But I take a look at this issue and could implement a add command or maybe a contains_not command which should allow the same but one more line. IMO it's really difficult to implement a if-else clause. But I can take a look at nomatch, but's maybe not that kind of easy. Btw. all this is more a enhancement request than a bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=205669 ------- Comment #2 from dkukawka@novell.com 2007-02-24 11:03 MST ------- Created an attachment (id=120932) --> (https://bugzilla.novell.com/attachment.cgi?id=120932&action=view) patch to add new attribute contains_not for strlist I send this patch upstream which adds a new attribute for string lists (only) named contains_not. This allow e.g such constructs: <match key="info.callouts" contains_not="foobar"> <append key="info.callouts" type="strlist">foobar</append> </match> If accepted upstream it go into 10.3 hal version. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=205669 dkukawka@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Component|Hotplug |Hotplug Product|SUSE Linux 10.1 |openSUSE 10.3 Resolution| |FIXED Fixed in Milestone|--- |unspecified Version|Final |unspecified ------- Comment #3 from dkukawka@novell.com 2007-02-24 11:03 MST ------- close this now. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com