vcrhonek / hwdata

hwdata contains various hardware identification and configuration data, such as the pci.ids and usb.ids databases.
Other
87 stars 19 forks source link

Fix various issues with tests on Gentoo Linux #7

Closed floppym closed 2 years ago

floppym commented 3 years ago

I am updating Gentoo Linux to use the hwdata package instead of our homegrown hwids package, and ran into a few issues when running make check.

vcrhonek commented 3 years ago

Thank you, the changes look good.

Just on Fedora the encoding test shows 'charset=utf-8' for all files except usb.ids, where it produces 'charset=unknown-8bit', I've allowed it too.

I'll merge the request if you're fine with my modification.

floppym commented 3 years ago

Just on Fedora the encoding test shows 'charset=utf-8' for all files except usb.ids, where it produces 'charset=unknown-8bit', I've allowed it too.

That sounds like a bug on Fedora's file command, or some difference in the data we are comparing. I think adding "unknown-8bit" as a valid option sort of invalidates the purpose of the test.

floppym commented 3 years ago

That said, if you want to add that workaround for now and fix the issue later, that's ok by me.

floppym commented 3 years ago

Hmm it seems the bug might be in Gentoo's file command. Attempting to run iconv on the usb.ids file fails.

% iconv -f utf-8 -t utf-16 /usr/share/hwdata/usb.ids > foo.txt 
iconv: illegal input sequence at position 692405
floppym commented 3 years ago

Given this discrepancy between distros, I think your change is reasonable.

floppym commented 3 years ago

I pushed a different approach: let's use iconv to validate the data instead of file.

vcrhonek commented 2 years ago

Thank you, merged!