forked from Gnucash/gnucash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount.sh
139 lines (128 loc) · 4.59 KB
/
count.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#! /bin/sh
#
# Simple stupid utility to count lines of code
# The output may deceive you, remember to subtract 1 from file count
#
# FIXME This script is very out of date. It doesn't count a number
# of source directories (such as gnome, ledger, engine,...)
#
SRC_DIR=$(dirname $0)/../../src
cd $SRC_DIR
echo
echo
echo "app utils:"
wc $(find app-utils core-utils calculation gnc-module tax \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find app-utils core-utils calculation gnc-module tax \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) | wc
echo
echo
echo "import export:"
wc $(find import-export \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find import-export \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) | wc
echo
echo
echo "reports:"
wc $(find report \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find report \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) | wc
echo
echo
echo "scheme misc:"
wc $(find scm \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find scm \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) |wc
echo
echo
echo "Business:"
wc $(find business \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find business \
\( -regex '.*test[^/]*' -prune \) -o \
\( -path '*.svn' -prune \) -o \
\( \( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) | wc
echo
echo
echo "test:"
wc $(find . \( -path '*.svn' -prune \) -o \
\( -regex '.*/test.*/.*' -a \
\( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort )
wc $(find . \( -path '*.svn' -prune \) -o \
\( -regex '.*/test.*/.*' -a \
\( -name '*.c' -o \
-name '*.h' -o \
-name '*.scm' \) -a \
-print \) | sort ) | wc
echo
echo
echo "internal docs"
wc $(find .. \( -path '*.svn' -prune \) -o \
\( -name 'README*' -o \
-name '*.txt' -o \
-name '*.html' -o \
-name '*.texinfo' -o \
-name '*.dtd' \) -a \
-print | sort )
wc $(find .. \( -path '*.svn' -prune \) -o \
\( -name 'README*' -o \
-name '*.txt' -o \
-name '*.html' -o \
-name '*.texinfo' -o \
-name '*.dtd' \) -a \
-print | sort ) | wc
cd -