Hey PEter, Peter Hutterer said the following on 01/30/2013 05:27 AM: > No two device description files should match on the same ID. > > Since a tablet may be listed multiple times in the database if it has more > than one match, we can't assume the matches are unique, we need to compare > the device name. > > Build hashtable of {match string : device name}, then check for each new > existing match string if the device name is identical.
I tried that patch by adding both the new definition from Pander for the CTH-661 and my own patch, expecting it to detect the duplicate definition and bail out (see the thread about adding support for the "libwacom CTH-661/L" and the discussion with Bastien). The case here is: - A tablet definition listing mutliple matches, DeviceMatch=usb:056a:00d3;usb:056a:00db under the name Name=Wacom Bamboo 2FG 6x8 - Another tablet definition adding a single duplicate match, DeviceMatch=usb:056a:00db under a dfferent name, Name=Wacom Bamboo 4FG 6x8 SE NL I was expecting this to trigger a failure. But it did not happen, "make check" ended happily ever after, so I wondered why. When loading a tablet definition, libwacom_database_new_for_path() will add all the matches given for that tablet in a hash table whose key is the match. So if the duplicate file is loaded first, its entry in the hash table will get replaced by the other definition loaded later, no dupe in database, "make check" is happy (while I was expecting it not to be). If the duplicate file is loaded after, then only the match for that given /other/ entry is replaced, "make check" should fail. So I think this adding this check here is not sufficient. Ideally, this should be done when loading the database (also because people could add new definitions without rebuilding and running "make check"). Cheers, Olivier. -- əɔıʌəp əɯos ɥʇıʍ əɹəɥʍəɯos ɯoɹɟ ʇuəs ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel