File djgpp-find-requires.sh of Package djgpp-filesystem

#!/bin/bash

# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.

if [ "$1" ]
then
   package_name="$1"
fi

[ -z "$OBJDUMP" ] && OBJDUMP=i586-pc-msdosdjgpp-objdump

# Get the list of files.

filelist=`sed "s/['\"]/\\\&/g"`

dlls=$(echo $filelist | tr [:blank:] '\n' | grep -Ei '\.(dll|exe)$')

for f in $dlls; do
    $OBJDUMP -p $f | grep 'DLL Name' | grep -Eo '[-._[:alnum:]]+\.dll' |
        tr [:upper:] [:lower:] |
        sed 's/\(.*\)/djgpp(\1)/'
done | sort -u
openSUSE Build Service is sponsored by