mingw-filesystem/mingw-find-provides.sh
Petr Šabata 629fa18c92 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/mingw-filesystem#b733b32514d698cd44765eb7c4aa950f1ee391ff
2020-10-15 19:43:55 +02:00

25 lines
590 B
Bash
Executable File

#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ]"
exit 1
fi
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.dll$')
for f in $dlls; do
basename=`basename $f | tr '[:upper:]' '[:lower:]'`
for target in $targets; do
host_triplet=`rpm --eval "%{${target}_target}"`
[[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)"
done
done
exit 0