Blame SOURCES/find-provides

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