From 9f1da3613897346b6a45e1f7a706d2315bc0f420 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Wed, 3 Dec 2003 06:22:53 -0800 Subject: [PATCH] pattern matching for namedev As promised yesterday, here is a patch to implement a more advanced pattern matching instead of the simple '*'. We can remove the "tty"="tty" line from udev.rules now and replace "tty*" by "tty[0-9]*" to catch only the vc's. implement pattern matching in namedev '*' - to match zero or more chars '?' - to match exactly one char '[]' - character classes with ranges '[0-9]'and negation [!A] --- test/udev-test.pl | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/udev-test.pl b/test/udev-test.pl index 8af09a027b..47190f6e5d 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -51,12 +51,34 @@ LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="boot_disk%n" EOF }, { - desc => "catch device by wildcard", + desc => "catch device by *", subsys => "tty", devpath => "class/tty/ttyUSB0", expected => "visor/0" , conf => < "catch device by ?", + subsys => "tty", + devpath => "class/tty/ttyUSB0", + expected => "visor/0" , + conf => < "catch device by character class", + subsys => "tty", + devpath => "class/tty/ttyUSB0", + expected => "visor/0" , + conf => < "callout result substitution", subsys => "block", devpath => "block/sda/sda3", expected => "special-device-3" , -- cgit v1.2.3-54-g00ecf