Blame erlang-find-requires.sh
|
Peter Lemenkov |
328521 |
#!/bin/bash
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
# This script reads filenames from STDIN and outputs any relevant requires
|
|
Peter Lemenkov |
328521 |
# information that needs to be included in the package.
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
filelist=`sed "s/['\"]/\\\&/g"`
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
/usr/lib/rpm/rpmdeps --requires $filelist
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
# Get the list of *.app files
|
|
Peter Lemenkov |
328521 |
appfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.app$')
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
for f in $appfiles; do
|
|
Peter Lemenkov |
328521 |
apps=`cat $f | tr -d [:space:] | grep -o -E '\{applications,\[.*[a-zA-Z0-9_]\]\}' | sed -e "s,.*\[,,g;s,\].*,,g;s.,. .g"`
|
|
Peter Lemenkov |
328521 |
for a in $apps; do
|
|
Peter Lemenkov |
328521 |
echo "erlang($a)"
|
|
Peter Lemenkov |
328521 |
done
|
|
Peter Lemenkov |
328521 |
done
|
|
Peter Lemenkov |
328521 |
|
|
Peter Lemenkov |
328521 |
# Get the list of *.beam files
|
|
Peter Lemenkov |
328521 |
beamfiles=$(echo $filelist | tr [:blank:] '\n' | grep -o -E '.*/ebin/.*\.beam$')
|
|
Peter Lemenkov |
328521 |
/usr/lib/rpm/erlang-find-requires.escript $beamfiles | sort | uniq
|
|
Peter Lemenkov |
328521 |
|