diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-31 13:56:21 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-31 13:56:21 +0000 |
commit | b166f9bceae92921b71cd5ffc997fdca2abda7df (patch) | |
tree | 32dedd44aabaed51ea907787b50386295681c824 | |
parent | 147c9ff55c760f9d95eecc7fc84fd171ebdae868 (diff) | |
download | ldetect-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
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | dkms-modules-info/Makefile | 10 | ||||
-rwxr-xr-x | dkms-modules-info/merge_dkms_info.pl | 29 |
3 files changed, 42 insertions, 1 deletions
@@ -12,6 +12,7 @@ FILES = AUTHORS ChangeLog Makefile Makefile.config convert lst update-ldetect-ls build: make -C lst build + make -C dkms-modules-info build check: make -C lst check @@ -23,6 +24,7 @@ clean: install: build install -d $(bindir) $(sbindir) $(dir) make -C lst install + make -C dkms-modules-info install install update-ldetect-lst $(sbindir) install convert/merge2pcitable.pl $(bindir) @@ -32,7 +34,7 @@ cleandist: rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 localcopy: - svn export -q -rBASE . $(PACKAGE)-$(VERSION) + svn export -q . $(PACKAGE)-$(VERSION) tar: tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) 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}}))); +} |