File: debian-maintainer-scripts

package info (click to toggle)
morbig 0.11.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,716 kB
  • sloc: ml: 4,008; sh: 787; ansic: 227; makefile: 69
file content (29 lines) | stat: -rwxr-xr-x 758 bytes parent folder | download | duplicates (5)
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