Blame SOURCES/find-provides

a008c1
#!/bin/bash
a008c1
a008c1
# This script reads filenames from STDIN and outputs any relevant provides
a008c1
# information that needs to be included in the package.
a008c1
a008c1
if [ "$1" ]
a008c1
then
a008c1
   package_name="$1"
a008c1
fi
a008c1
a008c1
filelist=`sed "s/['\"]/\\\&/g"`
a008c1
a008c1
[ -x /usr/lib/rpm/rpmdeps -a -n "$filelist" ] &&
a008c1
    echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/rpmdeps --provides
a008c1
a008c1
#
a008c1
# --- any other extra find-provides scripts
a008c1
for i in /usr/lib/rpm/redhat/find-provides.d/*.prov
a008c1
do
a008c1
    [ -x $i ] &&
a008c1
        (echo $filelist | tr '[:blank:]' \\n | $i | sort -u)
a008c1
done
a008c1
a008c1
#
a008c1
# --- Kernel module imported symbols
a008c1
#
a008c1
# Since we don't (yet) get passed the name of the package being built, we
a008c1
# cheat a little here by looking first for a kernel, then for a kmod.
a008c1
#
a008c1
a008c1
is_kmod=1
a008c1
for f in $filelist; do
a008c1
    if [ $(echo "$f" | sed -r -ne 's:^.*/lib/modules/(.*)/(.*)\.ko(\.gz|\.bz2|\.xz)?$:\2:p') ]
a008c1
    then
a008c1
        is_kernel=1;
a008c1
    fi
a008c1
    if [ $(echo "$f" | sed -r -ne 's:^.*/boot/(.*):\1:p') ]
a008c1
    then
a008c1
	unset is_kmod;
a008c1
    fi
a008c1
done
a008c1
if [ ! "$is_kernel" ] || [ "$package_name" == "kernel" ]
a008c1
then
a008c1
    unset is_kmod
a008c1
fi
a008c1
a008c1
[ -x /usr/lib/rpm/redhat/find-provides.ksyms ] && [ "$is_kmod" ] &&
a008c1
    printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides.ksyms
a008c1
a008c1
exit 0