summaryrefslogtreecommitdiffstats
path: root/dkms-modules-info
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-31 13:56:21 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-31 13:56:21 +0000
commitb166f9bceae92921b71cd5ffc997fdca2abda7df (patch)
tree32dedd44aabaed51ea907787b50386295681c824 /dkms-modules-info
parent147c9ff55c760f9d95eecc7fc84fd171ebdae868 (diff)
downloadldetect-lst-b166f9bceae92921b71cd5ffc997fdca2abda7df.tar
ldetect-lst-b166f9bceae92921b71cd5ffc997fdca2abda7df.tar.gz
ldetect-lst-b166f9bceae92921b71cd5ffc997fdca2abda7df.tar.bz2
ldetect-lst-b166f9bceae92921b71cd5ffc997fdca2abda7df.tar.xz
ldetect-lst-b166f9bceae92921b71cd5ffc997fdca2abda7df.zip
build and install dkms-modules.alias and dkms-modules.description files
Diffstat (limited to 'dkms-modules-info')
-rw-r--r--dkms-modules-info/Makefile10
-rwxr-xr-xdkms-modules-info/merge_dkms_info.pl29
2 files changed, 39 insertions, 0 deletions
diff --git a/dkms-modules-info/Makefile b/dkms-modules-info/Makefile
new file mode 100644
index 00000000..b15eaa1e
--- /dev/null
+++ b/dkms-modules-info/Makefile
@@ -0,0 +1,10 @@
+include ../Makefile.config
+
+FILES=dkms-modules.alias dkms-modules.description
+
+build:
+ ./merge_dkms_info.pl
+
+install: $(FILES)
+ mkdir -p $(dir)
+ install -m 644 $(FILES) $(dir)
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}})));
+}