File:
[LON-CAPA] /
loncom /
build /
Makefile.cvs
Revision
1.9:
download - view:
text,
annotated -
select for diffs
Mon Feb 3 18:03:52 2003 UTC (22 years ago) by
harris41
Branches:
MAIN
CVS tags:
version_2_9_X,
version_2_9_99_0,
version_2_9_1,
version_2_9_0,
version_2_8_X,
version_2_8_99_1,
version_2_8_99_0,
version_2_8_2,
version_2_8_1,
version_2_8_0,
version_2_7_X,
version_2_7_99_1,
version_2_7_99_0,
version_2_7_1,
version_2_7_0,
version_2_6_X,
version_2_6_99_1,
version_2_6_99_0,
version_2_6_3,
version_2_6_2,
version_2_6_1,
version_2_6_0,
version_2_5_X,
version_2_5_99_1,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_X,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
version_2_1_3,
version_2_1_2,
version_2_1_1,
version_2_1_0,
version_2_12_X,
version_2_11_X,
version_2_11_6_msu,
version_2_11_6,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0_RC1,
version_2_10_0,
version_2_0_X,
version_2_0_99_1,
version_2_0_2,
version_2_0_1,
version_2_0_0,
version_1_99_3,
version_1_99_2,
version_1_99_1_tmcc,
version_1_99_1,
version_1_99_0_tmcc,
version_1_99_0,
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_X,
version_1_2_99_1,
version_1_2_99_0,
version_1_2_1,
version_1_2_0,
version_1_1_X,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
version_1_1_3,
version_1_1_2,
version_1_1_1,
version_1_1_0,
version_1_0_99_3,
version_1_0_99_2,
version_1_0_99_1,
version_1_0_99,
version_1_0_3,
version_1_0_2,
version_1_0_1,
version_1_0_0,
version_0_99_5,
version_0_99_4,
version_0_99_3,
version_0_99_2,
version_0_99_1,
version_0_99_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
conference_2003,
bz6209-base,
bz6209,
bz5969,
bz5610,
bz2851,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3,
GCI_2,
GCI_1,
BZ5971-printing-apage,
BZ5434-fox,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
best wishes to all.
1: # The LearningOnline Network with CAPA
2:
3: # $Id: Makefile.cvs,v 1.9 2003/02/03 18:03:52 harris41 Exp $
4:
5: STATDIR="loncom/build/cvsstats"
6: STATSUBDIR="cvsstats"
7: TIMEAGO=7
8:
9: help:
10: @echo "*** You need to specify a valid target ***"
11: @echo "cvsreport: look at the latest changes over the last week"
12: @echo "cvscommit: look at the number of commits since the origin of"
13: @echo " LON-CAPA archiving"
14: @echo "linesofcode: look at the number of unique lines of code since"
15: @echo " LON-CAPA archiving"
16: @echo "statpage: an HTML formatted presentation of cvscommit and"
17: @echo " linesofcode"
18: @echo "Information is placed inside CVS:loncom/build/cvsstats"
19:
20: cvsreport:
21: # Header
22: echo "<h1>Automatically generated CVS report</h1>" > \
23: ../../doc/build/cvsreport.html
24: # General Date Info
25: echo "<h1>LON-CAPA Software Changes from \
26: `date --date='$(TIMEAGO) days ago' \
27: +\"%Y-%m-%d\"` to `date +\"%Y-%m-%d\"`</h1>" >> \
28: ../../doc/build/cvsreport.html
29: # General Alteration Info
30: echo "<p>Number of altered files:" >> ../../doc/build/cvsreport.html
31: cd ../..; cvs log \
32: -d ">`date --date='$(TIMEAGO) days ago' +\"%Y-%m-%d\"`" \
33: loncom CAPA doc 2>/dev/null | perl \
34: loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- | \
35: wc -l >> doc/build/cvsreport.html
36: # Listing of Altered Files
37: echo "</p><p>Altered files:</p><p><pre>" >> \
38: ../../doc/build/cvsreport.html
39: cd ../..; cvs log \
40: -d ">`date --date='$(TIMEAGO) days ago' +\"%Y-%m-%d\"`" \
41: loncom CAPA doc 2>/dev/null | \
42: perl loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- \
43: >> doc/build/cvsreport.html
44: echo "</pre></p>" >> ../../doc/build/cvsreport.html
45: make -f Makefile.cvs COMPONENT=loncom logentries
46: make -f Makefile.cvs COMPONENT=CAPA logentries
47: make -f Makefile.cvs COMPONENT=doc logentries
48:
49: logentries:
50: # Log entries for $(COMPONENT)
51: echo "<p>Log entries for <b>$(COMPONENT)</b>:</p><pre>" >>\
52: ../../doc/build/cvsreport.html
53: cd ../../$(COMPONENT); cvs log -d ">`date --date='$(TIMEAGO) days ago' \
54: +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \
55: ../doc/build/cvsreport.html
56: echo "</pre></p>" >> ../../doc/build/cvsreport.html
57:
58: statpage:
59: install -d $(STATSUBDIR)
60: echo '<html><title>LON-CAPA Coding Metrics</title>' > $(STATSUBDIR)/index.html
61: echo '<body bgcolor="#ffffff">' >> $(STATSUBDIR)/index.html
62: echo '<h1>LON-CAPA Coding Metrics</h1>' >> $(STATSUBDIR)/index.html
63: echo '<br />Compiled as of ' >> $(STATSUBDIR)/index.html
64: date >> $(STATSUBDIR)/index.html
65: echo "<p>The general algorithm for counting lines of code (this excludes blank lines) is <blockquote>cvs -q diff -D'start-date' -D'end-date' -b -B -N | egrep '^> .*[^ \t]' | sed 's/^> //g' | sort | uniq | wc -l</blockquote> </p>" >> $(STATSUBDIR)/index.html
66: echo "<p>The general algorithm for counting the number of CVS repository commits (includes additions, deletions, and modifications) is: <blockquote>cvs history -D'start-date' -a -xMAR | wc -l</blockquote> </p>" >> $(STATSUBDIR)/index.html
67: echo "<p>Each listing contains two graphs. One graph relates to the entire LON-CAPA repository. The other graph relates solely to the *.pm files (perl modules including Apache handlers).</p>" >> $(STATSUBDIR)/index.html
68: echo '<br /><a href="#loc">Lines of Code; unique changes per month</a>' >> $(STATSUBDIR)/index.html
69: echo '<br /><a href="#locsum">Lines of Code; aggregate sum of unique changes per month</a>' >> $(STATSUBDIR)/index.html
70: echo '<br /><a href="#commit">Number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html
71: echo '<br /><a href="#commitsum">Aggregate sum of number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html
72: echo '<hr /><a name="loc"><h3>Lines of Code</h3>' >> $(STATSUBDIR)/index.html
73: echo 'The first graph displays the number of unique line changes made in the CVS repository per month. The second graphs displays the number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html
74: echo '<br /><img src="loc.png" alt="lines of code" />' >> $(STATSUBDIR)/index.html
75: echo '<br /><img src="locpm.png" alt="lines of code, perl modules" />' >> $(STATSUBDIR)/index.html
76: echo '<hr /><a name="locsum"><h3>Aggregate Lines of Code</h3>' >> $(STATSUBDIR)/index.html
77: echo 'The first graph displays the aggregate number of unique line changes made in the CVS repository per month. The second graphs displays the aggregate number of unique line changes made to *.pm files in the CVS repository per month.' >> $(STATSUBDIR)/index.html
78: echo '<br /><img src="locsum.png" alt="aggregate lines of code" />' >> $(STATSUBDIR)/index.html
79: echo '<br /><img src="locpmsum.png" alt="aggregate lines of code, perl modules" />' >> $(STATSUBDIR)/index.html
80: echo '<hr /><a name="commit"><h3>Commits to Repository</h3>' >> $(STATSUBDIR)/index.html
81: echo 'The first graph displays the number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html
82: echo '<br /><img src="commit.png" alt="number of commits" />' >> $(STATSUBDIR)/index.html
83: echo '<br /><img src="commitpm.png" alt="number of commits, perl modules" />' >> $(STATSUBDIR)/index.html
84: echo '<hr /><a name="commitsum"><h3>Aggregate Commits to Repository</h3>' >> $(STATSUBDIR)/index.html
85: echo 'The first graph displays the aggregate number of repository commits (additions, deletions, and modifications) made in the CVS repository per month. The second graphs displays the aggregate number of repository commits involving *.pm files made in the CVS repository per month.' >> $(STATSUBDIR)/index.html
86: echo '<br /><img src="commitsum.png" alt="aggregate number of commits" />' >> $(STATSUBDIR)/index.html
87: echo '<br /><img src="commitpmsum.png" alt="aggregate number of commits, perl modules" />' >> $(STATSUBDIR)/index.html
88: echo '</body>' >> $(STATSUBDIR)/index.html
89: echo '</html>' >> $(STATSUBDIR)/index.html
90:
91: linesofcode:
92: install -d cvsstats
93: # for all, and for .pm
94: # get date array
95: cd ../..; perl -e ' \
96: ($$begindate,$$enddate)=@ARGV;\
97: ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
98: ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
99: for ($$y=$$by; $$y<=$$ey; $$y++) {\
100: if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
101: if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
102: for ($$m; $$m<=$$m2; $$m++) {\
103: printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
104: $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
105: }\
106: }' 20000101 `date +"%Y%m%d"` |\
107: perl -nle '($$d1,$$d2)=split(/\t/);$$loc=`cvs -q diff -D$$d1 -D$$d2 -b -B -N | egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/table.txt
108: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nUnique changes per month"\nset output "cvsstats/loc.png"\nset term png color\nplot "cvsstats/table.txt" using 1:2 with lines' | gnuplot
109: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code\\nAggregate count; Unique changes per month"\nset output "cvsstats/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot
110: cd ../..; perl -e ' \
111: ($$begindate,$$enddate)=@ARGV;\
112: ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
113: ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
114: for ($$y=$$by; $$y<=$$ey; $$y++) {\
115: if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
116: if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
117: for ($$m; $$m<=$$m2; $$m++) {\
118: printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
119: $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
120: }\
121: }' 20000101 `date +"%Y%m%d"` |\
122: perl -nle '($$d1,$$d2)=split(/\t/);$$loc=`cvs -q diff -D$$d1 -D$$d2 -b -B -N |\
123: perl -e "\@flag=(1);while(<>){if (/RCS file:/) {\@flag=(); pop \@flag; \@flag=(1) if /^RCS file: .*\.pm\,v/;} print if \@flag;}" |\
124: egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt
125: # process counts, generate table
126: # pass table to gnuplot
127: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nUnique changes per month"\nset output "cvsstats/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot
128: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "lines of code"\nset nokey\nset title "Lines of Code, perl modules\\nAggregate count; Unique changes per month"\nset output "cvsstats/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot
129:
130: cvscommit:
131: install -d cvsstats
132: # for all, and for .pm
133: # get date array
134: cd ../..; perl -e ' \
135: ($$begindate,$$enddate)=@ARGV;\
136: ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
137: ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
138: for ($$y=$$by; $$y<=$$ey; $$y++) {\
139: if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
140: if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
141: for ($$m; $$m<=$$m2; $$m++) {\
142: printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
143: $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
144: }\
145: }' 20000101 `date +"%Y%m%d"` |\
146: perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctable.txt
147: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commit.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:2 with lines' | gnuplot
148: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits\\nAggregate count (Additions, Deletions, and Modifications"\nset output "cvsstats/commitsum.png"\nset term png color\nplot "cvsstats/ctable.txt" using 1:3 with lines' | gnuplot
149: cd ../..; perl -e ' \
150: ($$begindate,$$enddate)=@ARGV;\
151: ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
152: ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
153: for ($$y=$$by; $$y<=$$ey; $$y++) {\
154: if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
155: if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
156: for ($$m; $$m<=$$m2; $$m++) {\
157: printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
158: $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
159: }\
160: }' 20000101 `date +"%Y%m%d"` |\
161: perl -nle '($$d1,$$d2)=split(/\t/);$$cmt1=`cvs history -D$$d1 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt1;$$cmt2=`cvs history -D$$d2 -a -xMAR | grep "\.pm[[:space:]]" | wc -l`;chomp $$cmt2;$$cmt=$$cmt1-$$cmt2;$$cmtsum+=$$cmt;print "$$d2\t$$cmt\t$$cmtsum";' > $(STATDIR)/ctablepm.txt
162: # process counts, generate table
163: # pass table to gnuplot
164: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\n(Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpm.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:2 with lines' | gnuplot
165: echo -e 'set xdata time\nset timefmt "%Y%m%d"\nset format x "%b %y"\nset xlabel "time"\nset ylabel "commits"\nset nokey\nset title "Commits, perl modules\\nAggregate count (Additions, Deletions, and Modifications)"\nset output "cvsstats/commitpmsum.png"\nset term png color\nplot "cvsstats/ctablepm.txt" using 1:3 with lines' | gnuplot
166:
167: clean:
168: rm -Rf cvsstats
169:
170:
171:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>