--- loncom/build/lpml_parse.pl 2001/12/06 23:14:33 1.28 +++ loncom/build/lpml_parse.pl 2001/12/07 04:45:16 1.29 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # lpml_parse.pl - Linux Packaging Markup Language parser # -# $Id: lpml_parse.pl,v 1.28 2001/12/06 23:14:33 harris41 Exp $ +# $Id: lpml_parse.pl,v 1.29 2001/12/07 04:45:16 harris41 Exp $ # # Written by Scott Harrison, harris41@msu.edu # @@ -225,6 +225,7 @@ $cleanstring=~s/\>\s*\n\s*\\\n"; + # START TEMP WAY +# my $totallinecount; +# my $totalbytecount; +# map {$totallinecount+=$linecount{$_}; +# $totalbytecount+=$bytecount{$_}} +# @categorynamelist; + # END TEMP WAY + return "
 
". + "Summary of Source Repository". + "". + "
 
". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "". + "
Files, Directories, and Symbolic Links
Files (not referenced by globs)$file_count
Files (referenced by globs)$fileglobnames_count
Total Files".($fileglobnames_count+$file_count)."
File globs".$fileglob_count."
Directories".$directory_count."
Symbolic links".$link_count."
". + "". + "". + "". + join("\n",(map {"". + ""} + @categorynamelist)). + "
File Category Count
IconNameNumber of Occurrences
$_$categorycount{$_}
". + "\n"; + +# START TEMP WAY +# join("\n",(map {"". +# "$_$categorycount{$_}$linecount{$_}$bytecount{$_}"} +# @categorynamelist)). +# "
 
". +# "Total Lines of Code: $totallinecount". +# "
 
". +# "Total Bytes: $totalbytecount". +# END TEMP WAY } if ($mode eq 'install') { return ''; @@ -392,6 +453,7 @@ Descriptions
  • Software Package Description
  • Directory Structure
  • Files
  • +
  • Summary of Source Repository
  • END $lpml .=<get_text('/directory'); $parser->get_tag('/directory'); + $directory_count++; + $categorycount{$categoryname}++; if ($mode eq 'html') { my @a; @a=($targetdir=~/\//g); @@ -822,7 +887,7 @@ sub format_directory { my ($chmod,$chown)=split(/\s/,$categoryhash{$categoryname}); return $directory="\n". "$categoryname". - " ". + " ". "$chmod
    $chown". "$thtml". "". @@ -982,12 +1047,21 @@ sub format_file { $note=''; $build=''; $status=''; $dependencies=''; my $text=&trim($parser->get_text('/file')); my $buildtest; + $file_count++; + $categorycount{$categoryname}++; + # START TEMP WAY +# if (-T "$sourcerootarg/$source") { +# $linecount{$categoryname}+=`wc -l $sourcerootarg/$source`; +# } +# my $bytesize=(-s "$sourcerootarg/$source"); +# $bytecount{$categoryname}+=$bytesize; + # END TEMP WAY if ($source) { $parser->get_tag('/file'); if ($mode eq 'html') { return ($file="\n". "". - " ". @@ -1108,14 +1182,17 @@ sub format_link { $link=''; $linkto=''; $source=''; $target=''; $categoryname=''; $description=''; $note=''; $build=''; $status=''; $dependencies=''; my $text=&trim($parser->get_text('/link')); + my @links; if ($linkto) { $parser->get_tag('/link'); if ($mode eq 'html') { my @targets=map {s/^\s*//;s/\s$//;$_} split(/\;/,$target); + $link_count+=scalar(@targets); foreach my $tgt (@targets) { + $categorycount{$categoryname}++; push @links,("\n". "". - " ". "get_text('/fileglob')); my $filenames2=$filenames;$filenames2=~s/\s//g; + $fileglob_count++; + my @semi=($filenames2=~/(\;)/g); + $fileglobnames_count+=scalar(@semi)+1; + $categorycount{$categoryname}+=scalar(@semi)+1; + # START TEMP WAY +# for my $f (split(/\;/,$filenames2)) { +# if (-T "$sourcerootarg/$sourcedir/$f") { +# $linecount{$categoryname}+=`wc -l $sourcerootarg/$sourcedir/$f`; +# open OUT,">>/tmp/junk123"; +# print OUT "$linecount{$categoryname} $categoryname $sourcerootarg/$sourcedir/$f\n"; +# close OUT; +# } +# my $bytesize=(-s "$sourcerootarg/$sourcedir/$f"); +# $bytecount{$categoryname}+=$bytesize; +# } + # END TEMP WAY if ($sourcedir) { $parser->get_tag('/fileglob'); if ($mode eq 'html') { return $fileglob="\n". - " ".