Diff for /loncom/build/Makefile.cvs between versions 1.1 and 1.9

version 1.1, 2002/01/07 22:12:59 version 1.9, 2003/02/03 18:03:52
Line 1 Line 1
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
   
 # Scott Harrison  
 # $Id$  # $Id$
   
 STATDIR="loncom/build/cvsstats"  STATDIR="loncom/build/cvsstats"
 STATSUBDIR="cvsstats"  STATSUBDIR="cvsstats"
   TIMEAGO=7
   
 help:  help:
  @echo "*** You need to specify a valid target ***"   @echo "*** You need to specify a valid target ***"
Line 13  help: Line 13  help:
  @echo "           LON-CAPA archiving"   @echo "           LON-CAPA archiving"
  @echo "linesofcode: look at the number of unique lines of code since"   @echo "linesofcode: look at the number of unique lines of code since"
  @echo "           LON-CAPA archiving"   @echo "           LON-CAPA archiving"
    @echo "statpage: an HTML formatted presentation of cvscommit and"
    @echo "          linesofcode"
  @echo "Information is placed inside CVS:loncom/build/cvsstats"   @echo "Information is placed inside CVS:loncom/build/cvsstats"
   
 cvsreport:  cvsreport:
Line 20  cvsreport: Line 22  cvsreport:
  echo "<h1>Automatically generated CVS report</h1>" > \   echo "<h1>Automatically generated CVS report</h1>" > \
  ../../doc/build/cvsreport.html   ../../doc/build/cvsreport.html
  # General Date Info   # General Date Info
  echo "<h1>LON-CAPA Software Changes from `date --date='7 days ago' \   echo "<h1>LON-CAPA Software Changes from \
    `date --date='$(TIMEAGO) days ago' \
  +\"%Y-%m-%d\"` to `date +\"%Y-%m-%d\"`</h1>" >> \   +\"%Y-%m-%d\"` to `date +\"%Y-%m-%d\"`</h1>" >> \
  ../../doc/build/cvsreport.html   ../../doc/build/cvsreport.html
  # General Alteration Info   # General Alteration Info
  echo "<p>Number of altered files:" >> ../../doc/build/cvsreport.html   echo "<p>Number of altered files:" >> ../../doc/build/cvsreport.html
  cd ../..; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" \   cd ../..; cvs log \
  loncom CAPA doc packaging 2>/dev/null | perl \   -d ">`date --date='$(TIMEAGO) days ago' +\"%Y-%m-%d\"`" \
    loncom CAPA doc 2>/dev/null | perl \
  loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- | \   loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- | \
  wc -l >> doc/build/cvsreport.html   wc -l >> doc/build/cvsreport.html
  # Listing of Altered Files   # Listing of Altered Files
  echo "</p><p>Altered files:</p><p><pre>" >> \   echo "</p><p>Altered files:</p><p><pre>" >> \
  ../../doc/build/cvsreport.html   ../../doc/build/cvsreport.html
  cd ../..; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" \   cd ../..; cvs log \
  loncom CAPA doc packaging 2>/dev/null | \   -d ">`date --date='$(TIMEAGO) days ago' +\"%Y-%m-%d\"`" \
    loncom CAPA doc 2>/dev/null | \
  perl loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- \   perl loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- \
  >> doc/build/cvsreport.html   >> doc/build/cvsreport.html
  # Log entries for loncom   echo "</pre></p>" >> ../../doc/build/cvsreport.html
  echo "</pre></p><p>Log entries for <b>loncom</b>:</p><pre>" >> \   make -f Makefile.cvs COMPONENT=loncom logentries
  ../../doc/build/cvsreport.html   make -f Makefile.cvs COMPONENT=CAPA logentries
  cd ../../loncom; cvs log -d ">`date --date='8 days ago' \   make -f Makefile.cvs COMPONENT=doc logentries
  +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \  
  ../doc/build/cvsreport.html  logentries:
  # Log entries for CAPA   # Log entries for $(COMPONENT)
  echo "</pre></p><p>Log entries for <b>CAPA</b>:</p><pre>" >> \   echo "<p>Log entries for <b>$(COMPONENT)</b>:</p><pre>" >>\
  ../../doc/build/cvsreport.html  
  cd ../../CAPA; cvs log -d ">`date --date='8 days ago' \  
  +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \  
  ../doc/build/cvsreport.html  
  # Log entries for doc  
  echo "</pre></p><p>Log entries for <b>doc</b>:</p><pre>" >> \  
  ../../doc/build/cvsreport.html  
  cd ../../doc; cvs log -d ">`date --date='8 days ago' \  
  +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \  
  ../doc/build/cvsreport.html  
  # Log entries for packaging  
  echo "</pre></p><p>Log entries for <b>packaging</b>:</p><pre>" >> \  
  ../../doc/build/cvsreport.html   ../../doc/build/cvsreport.html
  cd ../../packaging; cvs log -d ">`date --date='8 days ago' \   cd ../../$(COMPONENT); cvs log -d ">`date --date='$(TIMEAGO) days ago' \
  +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \   +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> \
  ../doc/build/cvsreport.html   ../doc/build/cvsreport.html
  echo "</pre></p>" >> ../../doc/build/cvsreport.html   echo "</pre></p>" >> ../../doc/build/cvsreport.html
   
 statpage:  statpage:
  install -d cvsstats   install -d $(STATSUBDIR)
  echo '<html><title>LON-CAPA Coding Metrics</title>' > $(STATSUBDIR)/index.html   echo '<html><title>LON-CAPA Coding Metrics</title>' > $(STATSUBDIR)/index.html
  echo '<body bgcolor="#ffffff">' >> $(STATSUBDIR)/index.html   echo '<body bgcolor="#ffffff">' >> $(STATSUBDIR)/index.html
  echo '<h1>LON-CAPA Coding Metrics</h1>' >> $(STATSUBDIR)/index.html   echo '<h1>LON-CAPA Coding Metrics</h1>' >> $(STATSUBDIR)/index.html
  echo '<br />Compiled as of ' >> $(STATSUBDIR)/index.html   echo '<br />Compiled as of ' >> $(STATSUBDIR)/index.html
  date >> $(STATSUBDIR)/index.html   date >> $(STATSUBDIR)/index.html
  echo '<p>&nbsp;</p>'   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>&nbsp;</p>" >> $(STATSUBDIR)/index.html
  echo '<br />Lines of Code; unique changes per month' >> $(STATSUBDIR)/index.html   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>&nbsp;</p>" >> $(STATSUBDIR)/index.html
  echo '<br />Lines of Code; unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html   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
  echo '<br />Lines of Code; aggregating sum of unique changes per month' >> $(STATSUBDIR)/index.html   echo '<br /><a href="#loc">Lines of Code; unique changes per month</a>' >> $(STATSUBDIR)/index.html
  echo '<br />Lines of Code; aggregating sum of unique changes (*.pm only) per month' >> $(STATSUBDIR)/index.html   echo '<br /><a href="#locsum">Lines of Code; aggregate sum of unique changes per month</a>' >> $(STATSUBDIR)/index.html
  echo '<br />Number of commits to software repository per month' >> $(STATSUBDIR)/index.html   echo '<br /><a href="#commit">Number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html
  echo '<br />Number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html   echo '<br /><a href="#commitsum">Aggregate sum of number of commits to software repository per month</a>' >> $(STATSUBDIR)/index.html
  echo '<br />Aggregating sum of number of commits to software repository per month' >> $(STATSUBDIR)/index.html   echo '<hr /><a name="loc"><h3>Lines of Code</h3>' >> $(STATSUBDIR)/index.html
  echo '<br />Aggregating sum of number of commits to software repository (*.pm only) per month' >> $(STATSUBDIR)/index.html   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
  echo '<br /><img src="loc.png" alt="lines of code" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="loc.png" alt="lines of code" />' >> $(STATSUBDIR)/index.html
  echo '<br /><img src="locpm.png" alt="lines of code, perl modules" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="locpm.png" alt="lines of code, perl modules" />' >> $(STATSUBDIR)/index.html
    echo '<hr /><a name="locsum"><h3>Aggregate Lines of Code</h3>' >> $(STATSUBDIR)/index.html
    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
  echo '<br /><img src="locsum.png" alt="aggregate lines of code" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="locsum.png" alt="aggregate lines of code" />' >> $(STATSUBDIR)/index.html
  echo '<br /><img src="locpmsum.png" alt="aggregate lines of code, perl modules" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="locpmsum.png" alt="aggregate lines of code, perl modules" />' >> $(STATSUBDIR)/index.html
    echo '<hr /><a name="commit"><h3>Commits to Repository</h3>' >> $(STATSUBDIR)/index.html
    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
  echo '<br /><img src="commit.png" alt="number of commits" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="commit.png" alt="number of commits" />' >> $(STATSUBDIR)/index.html
  echo '<br /><img src="commitpm.png" alt="number of commits, perl modules" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="commitpm.png" alt="number of commits, perl modules" />' >> $(STATSUBDIR)/index.html
    echo '<hr /><a name="commitsum"><h3>Aggregate Commits to Repository</h3>' >> $(STATSUBDIR)/index.html
    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
  echo '<br /><img src="commitsum.png" alt="aggregate number of commits" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="commitsum.png" alt="aggregate number of commits" />' >> $(STATSUBDIR)/index.html
  echo '<br /><img src="commitpmsum.png" alt="aggregate number of commits, perl modules" />' >> $(STATSUBDIR)/index.html   echo '<br /><img src="commitpmsum.png" alt="aggregate number of commits, perl modules" />' >> $(STATSUBDIR)/index.html
  echo '</body>' >> $(STATSUBDIR)/index.html   echo '</body>' >> $(STATSUBDIR)/index.html
Line 107  for ($$y=$$by; $$y<=$$ey; $$y++) {\ Line 106  for ($$y=$$by; $$y<=$$ey; $$y++) {\
 }' 20000101 `date +"%Y%m%d"` |\  }' 20000101 `date +"%Y%m%d"` |\
 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  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
  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   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
  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/locsum.png"\nset term png color\nplot "cvsstats/table.txt" using 1:3 with lines' | gnuplot   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
  cd ../..; perl -e ' \   cd ../..; perl -e ' \
 ($$begindate,$$enddate)=@ARGV;\  ($$begindate,$$enddate)=@ARGV;\
 ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\  ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
Line 125  perl -e "\@flag=(1);while(<>){if (/RCS f Line 124  perl -e "\@flag=(1);while(<>){if (/RCS f
  egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt   egrep \"^> .*[^ \t]\" | sed \"s/^> //g\" | sort | uniq | wc -l`;chomp $$loc;$$locsum+=$$loc;print "$$d2\t$$loc\t$$locsum";' > $(STATDIR)/tablepm.txt
 # process counts, generate table  # process counts, generate table
  # pass table to gnuplot   # pass table to gnuplot
  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/locpm.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:2 with lines' | gnuplot   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
  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/locpmsum.png"\nset term png color\nplot "cvsstats/tablepm.txt" using 1:3 with lines' | gnuplot   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
   
 cvscommit:  cvscommit:
    install -d cvsstats
  # for all, and for .pm   # for all, and for .pm
  # get date array   # get date array
  # process counts, generate table   cd ../..; perl -e ' \
   ($$begindate,$$enddate)=@ARGV;\
   ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
   ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
   for ($$y=$$by; $$y<=$$ey; $$y++) {\
       if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
       if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
       for ($$m; $$m<=$$m2; $$m++) {\
    printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
    $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
       }\
   }' 20000101 `date +"%Y%m%d"` |\
   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
    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
    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
    cd ../..; perl -e ' \
   ($$begindate,$$enddate)=@ARGV;\
   ($$by,$$bm,$$bd)=($$begindate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
   ($$ey,$$em,$$ed)=($$enddate=~/(\d{4,4})(\d{2,2})(\d{2,2})/);\
   for ($$y=$$by; $$y<=$$ey; $$y++) {\
       if ($$y==$$by) {$$m=$$bm;} else {$$m=1;}\
       if ($$y==$$ey) {$$m2=$$em;} else {$$m2=12;}\
       for ($$m; $$m<=$$m2; $$m++) {\
    printf("$$odate\t%4.4d%2.2d%2.2d\n",$$y,$$m,$$bd) if $$odate; \
    $$odate=sprintf("%4.4d%2.2d%2.2d",$$y,$$m,$$bd);\
       }\
   }' 20000101 `date +"%Y%m%d"` |\
   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
   # process counts, generate table
  # pass table to gnuplot   # pass table to gnuplot
    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
    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
   
 clean:  clean:
  rm -Rf cvsstats   rm -Rf cvsstats

Removed from v.1.1  
changed lines
  Added in v.1.9


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>