File: robo-hack

package info (click to toggle)
pcp 6.3.8-1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 235,180 kB
  • sloc: ansic: 1,253,622; sh: 173,998; xml: 160,490; cpp: 83,331; python: 20,482; perl: 18,302; yacc: 6,886; makefile: 2,955; lex: 2,862; fortran: 60; java: 52
file content (48 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download | duplicates (4)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#
# run hack on source files and QA app files identified by hunter
#
# input looks like ...
# ...
# Source ...
# src/pcp/atop/atop.c:	__pmEndOptions(&opts);
# ...
# QA ...
# qa/src/somefile.c:  text
#

tmp=/var/tmp/$$
trap "rm -f $tmp.*; exit 0" 0 1 2 3 15

sed -e 's/:.*//' \
| awk >$tmp.list '
BEGIN		{ want = 0 }
NF == 0		{ next }
$1 == "Source" && $2 == "..."	{ want = 1; next }
$1 == "QA" && $2 == "..."	{ want = 1; next }
$1 == "Man" && $2 == "pages"	{ want = 0; next }
$1 == "Other" && $2 == "..."	{ want = 0; next }
NF == 1 && want == 1		{ print }'

cat $tmp.list \
| sort \
| uniq \
| while read file
do
    echo $file:
    if [ ! -f "$file" ]
    then
	echo "Botch: $file: not found"
	exit 1
    fi

    if hack -v "$file"
    then
	:
    else
	echo "Oops!"
	exit 1
    fi
done

exit 0