diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-25 18:23:04 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-25 18:23:04 +0000 |
commit | a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19 (patch) | |
tree | 6916caa3a899a86ddbd1e99e43232648b2c15e53 /kmod.prov | |
parent | d47bdd8c207d2c6d23144844db62b00c8991a03a (diff) | |
download | rpm-setup-a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19.tar rpm-setup-a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19.tar.gz rpm-setup-a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19.tar.bz2 rpm-setup-a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19.tar.xz rpm-setup-a2ee6a6b2b1bb5bc44df4c91858c3f68e99f6c19.zip |
add automatic kmod provides (based on work from Danny Tholen)
Diffstat (limited to 'kmod.prov')
-rwxr-xr-x | kmod.prov | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kmod.prov b/kmod.prov new file mode 100755 index 0000000..f378ec3 --- /dev/null +++ b/kmod.prov @@ -0,0 +1,13 @@ +#!/bin/sh + +provideslist=`sed "s/['\"]/\\\&/g"` +modulelist=$(echo "$provideslist" | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.gz)?$') +echo $modulelist | xargs -r /sbin/modinfo | \ + perl -lne ' +$name = $1 if m!^filename:.*\b([^/]+)\.k?o!; +$ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/; +if (/^srcversion:/) { + print "kmod\($name\) = $ver" if $name && $ver; + undef $name, $ver; +} +' |