diff options
Diffstat (limited to 'dkms-modules-info/merge_dkms_info.pl')
-rwxr-xr-x | dkms-modules-info/merge_dkms_info.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dkms-modules-info/merge_dkms_info.pl b/dkms-modules-info/merge_dkms_info.pl new file mode 100755 index 00000000..efd10069 --- /dev/null +++ b/dkms-modules-info/merge_dkms_info.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use MDK::Common; + +my $prefix = "dkms-modules"; + +my %fields; +my %filters = ( + alias => sub { + my ($module, $values) = @_; + map { "alias $module $_\n" } sort(uniq(@$values)); + }, + description => sub { + my ($module, $values) = @_; + my $desc = find { $_} @$values; + if_($desc, "$module\t$desc\n"); + }, +); + +foreach my $kver (grep { $_ ne ".svn" && -d $_ } all(".")) { + foreach my $file (all($kver)) { + my ($module, $type) = $file =~ /^(.+)\.(.+?)$/ or next; + push @{$fields{$type}{$module}}, chomp_(cat_($kver . '/' . $file)); + } +} + +foreach my $type (keys %filters) { + output("$prefix.$type", map { $filters{$type}->($_, $fields{$type}{$_}) } sort(keys(%{$fields{$type}}))); +} |