diff options
author | Yaakov Selkowitz <yselkowitz@users.sourceforge.net> | 2011-02-17 04:20:33 -0600 |
---|---|---|
committer | Yaakov Selkowitz <yselkowitz@users.sourceforge.net> | 2011-02-17 04:20:33 -0600 |
commit | 7f63e5f253a78e5939369316fb8ef7951cd044a5 (patch) | |
tree | da4c6164c88b0dc471b0839a9747b93de97527df /cygwin-find-requires.sh | |
download | cygwin-filesystem-7f63e5f253a78e5939369316fb8ef7951cd044a5.tar.gz cygwin-filesystem-7f63e5f253a78e5939369316fb8ef7951cd044a5.tar.xz cygwin-filesystem-7f63e5f253a78e5939369316fb8ef7951cd044a5.zip |
Initial commit
Diffstat (limited to 'cygwin-find-requires.sh')
-rwxr-xr-x | cygwin-find-requires.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cygwin-find-requires.sh b/cygwin-find-requires.sh new file mode 100755 index 0000000..871c768 --- /dev/null +++ b/cygwin-find-requires.sh @@ -0,0 +1,27 @@ +#!/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=i686-pc-cygwin-objdump + +# Get the list of files. + +filelist=`sed "s/['\"]/\\\&/g"` + +# Everything requires cygwin-filesystem of at least the current version +# and cygwin. +echo 'cygwin-filesystem >= @VERSION@' + +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/\(.*\)/cygwin(\1)/' +done | sort -u |