--- loncom/build/lpml_parse.pl 2002/01/09 22:18:16 1.35 +++ loncom/build/lpml_parse.pl 2002/03/22 02:09:41 1.42 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # lpml_parse.pl - Linux Packaging Markup Language parser # -# $Id: lpml_parse.pl,v 1.35 2002/01/09 22:18:16 harris41 Exp $ +# $Id: lpml_parse.pl,v 1.42 2002/03/22 02:09:41 harris41 Exp $ # # Written by Scott Harrison, harris41@msu.edu # @@ -37,8 +37,7 @@ # 11/4,11/5,11/6,11/7,11/16,11/17 - Scott Harrison # 12/2,12/3,12/4,12/5,12/6,12/13,12/19,12/29 - Scott Harrison # YEAR=2002 -# 1/8,1/9 - Scott Harrison -# +# 1/8,1/9,1/29,1/31,2/5,3/21 - Scott Harrison ### ############################################################################### @@ -130,8 +129,8 @@ if ($mode eq 'install' or $mode eq 'conf # 1st argument (mode) is: $mode # 2nd argument (category type) is: $categorytype # 3rd argument (distribution) is: $dist -# 4th argument (targetroot) is: described below -# 5th argument (sourceroot) is: described below +# 4th argument (sourceroot) is: described below +# 5th argument (targetroot) is: described below END } @@ -208,7 +207,7 @@ while ($token = $parser->get_token()) { $cleanstring.=$token->[4]; } if ($token->[4]=~/\/>$/) { - $hloc--; +# $hloc--; } } if ($token->[0] eq 'E') { @@ -281,10 +280,6 @@ my $link_count; my $fileglob_count; my $fileglobnames_count; my %categorycount; -# START TEMP WAY -#my %bytecount; # TEMP WAY TO COUNT INFORMATION -#my %linecount; # TEMP WAY TO COUNT INFORMATION -# END TEMP WAY my @buildall; my @buildinfo; @@ -370,13 +365,6 @@ exit; # ------------------------ Final output at end of markup parsing and formatting sub end { if ($mode eq 'html') { - # START TEMP WAY -# my $totallinecount; -# my $totalbytecount; -# map {$totallinecount+=$linecount{$_}; -# $totalbytecount+=$bytecount{$_}} -# @categorynamelist; - # END TEMP WAY return "
 
". "Summary of Source Repository". "". @@ -414,16 +402,6 @@ sub end { "". "\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 ''; @@ -970,7 +948,9 @@ sub format_directory { my ($chmod,$chown)=split(/\s/,$categoryhash{$categoryname}); return $directory="\n". "$categoryname". - " ". + "". + " ". "$chmod
$chown". "$thtml". "". @@ -1144,19 +1124,12 @@ sub format_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". "". - " ". @@ -1256,7 +1229,8 @@ END $logcmd.' && echo "'. 'Configuration source file does not exist '. ''.$sourceroot.'/'.$source.'"'. - "$logcmd); } && perl verifymodown.pl ${targetroot}/${target} \"$categoryhash{$categoryname}\"$logcmd;\n\n"; + "$logcmd); } && perl verifymodown.pl ${targetroot}/${target} \"". + "$categoryhash{$categoryname}\"$logcmd;\n\n"; } elsif ($mode eq 'build' && $build) { push @buildall,$sourceroot.'/'.$source; @@ -1361,23 +1335,11 @@ sub format_fileglob { 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". - " ". @@ -1493,6 +1455,7 @@ sub format_build { if ($text) { $parser->get_tag('/build'); $build=$sourceroot.'/'.$text.';'.$tokeninfo[2]{'trigger'}; + $build=~s/([^\\])\\\s+/$1/g; # allow for lines split onto new lines } return ''; } @@ -1551,7 +1514,7 @@ sub format_filenames { } return ''; } -# ------------------------------------------------ Format specialnotice section +# ----------------------------------------------- Format specialnotices section sub format_specialnotices { $parser->get_tag('/specialnotices'); return '';