Skip to contentSkip to conversation

udev: rules ignore whitespace but not case

DISCUSSION Eric C. Cooper 3 participants 3 messages Nov 15, 2004

lore
Share & tools
lore
#0 lore raw

I use a rule like this

    BUS="scsi", SYSFS{model}="iPod", KERNEL="sd[a-z]2", SYMLINK="ipod"

and it works even though the model field is actually
"iPod "

But a rule like this

    BUS="scsi", SYSFS{vendor}="KINGSTON", KERNEL="sd[a-z]1", SYMLINK="flash"

fails with my flash disk because the vendor field is actually "Kingston".

I think that if the pattern matching is going to trim whitespace, it should also ignore case. That would be more consistent and more resilient to errors.

Signature · 12 lines
Eric C. Cooper          e c c @ c m u . e d u


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 5 lines · Eric C. Cooper

I use a rule like this

    BUS="scsi", SYSFS{model}="iPod", KERNEL="sd[a-z]2", SYMLINK="ipod"

and it works even though the model field is actually
"iPod "

Quoted 7 lines

But a rule like this

    BUS="scsi", SYSFS{vendor}="KINGSTON", KERNEL="sd[a-z]1", SYMLINK="flash"

fails with my flash disk because the vendor field is actually "Kingston".

I think that if the pattern matching is going to trim whitespace, it should also ignore case. That would be more consistent and more resilient to errors.

That's on purpose. The whitespace is ignored only if your key value does not end with whitespace. So it's still possible to distinguish fields with differences only in the whitespace.

Thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Eric C. Cooper
Quoted 5 lines · Eric C. Cooper

I use a rule like this

    BUS="scsi", SYSFS{model}="iPod", KERNEL="sd[a-z]2", SYMLINK="ipod"

and it works even though the model field is actually
"iPod "

Quoted 7 lines

But a rule like this

    BUS="scsi", SYSFS{vendor}="KINGSTON", KERNEL="sd[a-z]1", SYMLINK="flash"

fails with my flash disk because the vendor field is actually "Kingston".

I think that if the pattern matching is going to trim whitespace, it should also ignore case. That would be more consistent and more resilient to errors.

No, we want to only trim whitespace, as that's the most common issue for people. Case sensitivity is still important to keep.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel