File: find.sh

package info (click to toggle)
libreswan 5.2-2.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,656 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (46 lines) | stat: -rwxr-xr-x 1,276 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e

# Find anything remotely related to makefiles; used to find makefile
# variable references.  Assume this is being run as .../mk/find.sh.

look()
{
    d=$(dirname $(dirname $0))
    find $d/* \
	 -false \
	 -o -type d -name '__pycache__' -prune \
	 \
	 -o -type f -name '*~' -prune \
	 -o -type f -name '*.orig' -prune \
	 -o -type f -name '*.rej' -prune \
	 -o -type f -name '.*' -prune \
	 \
         -o -type d -path '$d/BACKUP' -prune \
	 -o -type d -path "$d/OBJ.*" -prune \
	 -o -type d -path "$d/linux" -prune \
	 -o -type d -path "$d/contrib" -prune \
	 -o -type d -path "$d/testing/pluto/*/*" -prune \
	 \
	 -o -type f -path "$d/testing/web/*" -print \
	 -o -type f -path "$d/testing/kvm/*" -print \
	 -o -type f -path "$d/testing/utils/*" -print \
	 -o -type f -path "$d/testing/guestbin/*" -print \
	 \
	 -o -type f -path "$d/packaging/*" -print \
	 \
	 -o -type f -name 'Makefile*' -print \
	 -o -type f -name '*.mk' -print \
	 -o -type f -name '*.py' -print \
	 -o -type f -name '*.sh' -print \
	 -o -type f -name '*.awk' -print \
	 -o -type f -name '*.in' -print \
	 -o -type f -name '*.[chly]' -print \
	 -o -type f -name '*.lex' -print \
	 -o -type f -name '*.xml' -print
}

if test $# -gt 0 ; then
    look | xargs grep -n "$@"
else
    look
fi