1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/sh
# runs morbig on all debian maintainer scripts found under directory $1,
# producing for each of them a concrete syntax tree in bin format.
corpusroot=${1:?}
if [ ! -x /usr/bin/time ]; then
echo 'Please install /usr/bin/time (apt-get install time).'
exit 2
fi
cd ${corpusroot}
echo -n "Cleaning up ... "
find . -regextype posix-extended \
-regex '.*/.*\.(json|morbig|sjson|morbigerror)'\
-delete
echo "done."
echo "Start parsing `find . -regextype posix-extended -regex '.*/(pre|post)(inst|rm)' | wc -l` files."
find . -regextype posix-extended -regex '.*/(pre|post)(inst|rm)' | \
/usr/bin/time -f "%E real, %U user, %S sys" \
morbig \
--as bin \
--continue-after-error \
--from-stdin \
--skip-nosh \
--display-stats
|