From 6c6b0c04958b2528e4902d7588da0067eeeed6a8 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Sat, 22 Sep 2007 10:03:11 +0000 Subject: add parse_file_modules helper --- perl-install/modalias.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/perl-install/modalias.pm b/perl-install/modalias.pm index 6ae09b9cc..516a2dd01 100644 --- a/perl-install/modalias.pm +++ b/perl-install/modalias.pm @@ -59,6 +59,17 @@ sub parse_path { } } +sub parse_file_modules { + my ($path) = @_; + my %modules; + foreach (cat_($path)) { + if (my ($alias, undef, $module) = $_ =~ $alias_re) { + push @{$modules{$module}}, $alias; + } + } + \%modules; +} + sub get_alias_groups() { @alias_groups = map { my $group = {}; -- cgit v1.2.1