diff options
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | find-provides.in | 5 | ||||
-rw-r--r-- | kmod.prov | 41 |
3 files changed, 21 insertions, 26 deletions
@@ -1,6 +1,7 @@ - actually package php.attr - convert kmod provides to internal generator - convert perl requires from meta to internal generator +- use rpmdeps to generate any "normal" dependencies Version 2.0 - 12 September 2014, by Thierry Vignaud diff --git a/find-provides.in b/find-provides.in index 8c82209..598e099 100755 --- a/find-provides.in +++ b/find-provides.in @@ -8,4 +8,9 @@ filelist=`sed "s/['\"]/\\\&/g"` # fix parsing output of objdump when localized (mga#7883): export LC_ALL=C + +[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] && + echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --provides + + exit 0 @@ -1,28 +1,17 @@ -#!/bin/sh +#!/bin/sh +x -provideslist=`sed "s/['\"]/\\\&/g"` -modulelist=$(echo "$provideslist" | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.[g,x]z)?$') -echo $modulelist | xargs -r /sbin/modinfo | \ - perl -lne ' -$name = $1 if m!^filename:\s*(?:.*/)?([^/]+)\.k?o!; -$ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/; -$ver =~ s/(\[|\]|\:|-)/_/; -if (/^vermagic:/) { - print "kmod\($name\)" . ($ver ? " = $ver" : "") if $name; - undef $name; undef $ver; -} -' -dkmslist=$(echo "$provideslist" | egrep '(/var/lib/dkms-binary/[^/]+/[^/]+|/usr/src)/[^/]+/dkms.conf$') -[ -n "$dkmslist" ] && for d in $dkmslist; do - VERSION=`sed -rne 's/^PACKAGE_VERSION="?([^"]+)"?$/\1/;T;p' $d` - [ -z "$VERSION" ] && continue - PACKAGE_NAME=`sed -rne 's/^PACKAGE_NAME="?([^"]+)"?$/\1/;T;p' $d` - MODULES=`sed -rne 's/^DEST_MODULE_NAME\[[0-9]+\]="?([^"]+)"?$/\1/;T;p' $d` - [ -z "$MODULES" ] && MODULES=`sed -rne 's/^BUILT_MODULE_NAME\[[0-9]+\]="?([^"]+)"?$/\1/;T;p' $d` - # default on PACKAGE_NAME if no BUILT_MODULE_NAME is specified - [ -z "$MODULES" ] && MODULES=$PACKAGE_NAME - echo "$MODULES" | sed -re "s/\\\$PACKAGE_NAME/$PACKAGE_NAME/" | while read m; do - echo "kmod($m) = $VERSION" - done +IFS=$'\n' + +for i in $(grep -E '(/lib/modules/.*\.ko|/lib/modules/.*/modules.builtin)'); +do + kmod=$(basename $i | sed -e 's/.[xg]z//'); + + if [ $kmod == "modules.builtin" ]; then + for j in $(cat $i); do + j=$(basename $j); + echo "kmod($j)" + done + else + echo "kmod($kmod)" + fi done -exit 0 |