2016-10-12 21:40:11 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2016-10-16 11:45:24 +00:00
|
|
|
if [ "$1" == "--help" ]; then
|
|
|
|
echo "Usage: include.mes FILE"
|
|
|
|
exit 0
|
|
|
|
fi
|
2016-10-16 06:00:04 +00:00
|
|
|
for prefix in $(dirname $(dirname $0))/share/mes . $(dirname $(dirname $0)); do
|
|
|
|
if [ -d ${prefix}/module ]; then
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
2016-10-20 20:03:17 +00:00
|
|
|
|
|
|
|
if [ -n "$BOOT" ]; then
|
|
|
|
echo $prefix/module/mes/loop-0.mes
|
|
|
|
fi
|
2016-10-12 21:40:11 +00:00
|
|
|
cat $1 \
|
|
|
|
| grep -Eo '(mes-use-module \([^()]+ [^()]+))' \
|
|
|
|
| grep -Eo ' \([^)]+\)' \
|
2016-10-16 06:00:04 +00:00
|
|
|
| sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'
|