diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-09-22 10:02:55 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-09-22 10:02:55 +0000 |
commit | d22779aee15234c1273285bc35dfb0ce7a2b373c (patch) | |
tree | deb1db815e368eb6e1d6ded630fd27615b332c55 /perl-install/modalias.pm | |
parent | a7657b6da1785ace8ebfd2ea9618c2959b636d7f (diff) | |
download | drakx-d22779aee15234c1273285bc35dfb0ce7a2b373c.tar drakx-d22779aee15234c1273285bc35dfb0ce7a2b373c.tar.gz drakx-d22779aee15234c1273285bc35dfb0ce7a2b373c.tar.bz2 drakx-d22779aee15234c1273285bc35dfb0ce7a2b373c.tar.xz drakx-d22779aee15234c1273285bc35dfb0ce7a2b373c.zip |
move regexp in a variable
Diffstat (limited to 'perl-install/modalias.pm')
-rw-r--r-- | perl-install/modalias.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/modalias.pm b/perl-install/modalias.pm index 79add1adf..6ae09b9cc 100644 --- a/perl-install/modalias.pm +++ b/perl-install/modalias.pm @@ -23,6 +23,8 @@ my @config_groups = ( my @classes = qw(ide ieee1394 input pci pcmcia pnp serio usb); my @alias_groups; +my $alias_re = qr/^\s*alias\s+(([^:]+):\S+)\s+(\S+)$/; + sub alias_to_ids { my ($alias) = @_; my ($vendor, $device); @@ -40,7 +42,7 @@ sub parse_path { parse_path($group, "$path/$_") foreach all($path); } elsif (-f $path) { foreach (cat_($path)) { - if (my ($alias, $class, $module) = /^\s*alias\s+(([^:]+):\S+)\s+(\S+)$/) { + if (my ($alias, $class, $module) = $_ =~ $alias_re) { my ($vendor, $device) = alias_to_ids($alias); if (member($class, @classes)) { if ($vendor) { |