Annotation of loncom/build/lpml_parse.pl, revision 1.31

1.1       harris41    1: #!/usr/bin/perl
1.2       albertel    2: 
1.28      harris41    3: # The LearningOnline Network with CAPA
                      4: # lpml_parse.pl - Linux Packaging Markup Language parser
                      5: #
1.31    ! harris41    6: # $Id: lpml_parse.pl,v 1.30 2001/12/12 23:20:47 harris41 Exp $
1.28      harris41    7: #
                      8: # Written by Scott Harrison, harris41@msu.edu
                      9: #
                     10: # Copyright Michigan State University Board of Trustees
                     11: #
                     12: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                     13: #
                     14: # LON-CAPA is free software; you can redistribute it and/or modify
                     15: # it under the terms of the GNU General Public License as published by
                     16: # the Free Software Foundation; either version 2 of the License, or
                     17: # (at your option) any later version.
                     18: #
                     19: # LON-CAPA is distributed in the hope that it will be useful,
                     20: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     21: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     22: # GNU General Public License for more details.
                     23: #
                     24: # You should have received a copy of the GNU General Public License
                     25: # along with LON-CAPA; if not, write to the Free Software
                     26: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     27: #
                     28: # /home/httpd/html/adm/gpl.txt
                     29: #
                     30: # http://www.lon-capa.org/
                     31: #
1.4       harris41   32: # YEAR=2001
1.2       albertel   33: # May 2001
1.3       harris41   34: # 06/19/2001,06/20,06/24 - Scott Harrison
1.5       harris41   35: # 9/5/2001,9/6,9/7,9/8 - Scott Harrison
1.14      harris41   36: # 9/17,9/18 - Scott Harrison
1.21      harris41   37: # 11/4,11/5,11/6,11/7,11/16,11/17 - Scott Harrison
1.31    ! harris41   38: # 12/2,12/3,12/4,12/5,12/6,12/13 - Scott Harrison
1.28      harris41   39: #
1.18      harris41   40: ###
1.3       harris41   41: 
1.4       harris41   42: ###############################################################################
                     43: ##                                                                           ##
                     44: ## ORGANIZATION OF THIS PERL SCRIPT                                          ##
                     45: ## 1. Notes                                                                  ##
                     46: ## 2. Get command line arguments                                             ##
                     47: ## 3. First pass through (grab distribution-specific information)            ##
                     48: ## 4. Second pass through (parse out what is not necessary)                  ##
                     49: ## 5. Third pass through (translate markup according to specified mode)      ##
1.14      harris41   50: ## 6. Functions (most all just format contents of different markup tags)     ##
                     51: ## 7. POD (plain old documentation, CPAN style)                              ##
1.4       harris41   52: ##                                                                           ##
                     53: ###############################################################################
                     54: 
                     55: # ----------------------------------------------------------------------- Notes
                     56: #
1.3       harris41   57: # I am using a multiple pass-through approach to parsing
                     58: # the lpml file.  This saves memory and makes sure the server
                     59: # will never be overloaded.
1.4       harris41   60: #
                     61: # This is meant to parse files meeting the lpml document type.
                     62: # See lpml.dtd.  LPML=Linux Packaging Markup Language.
1.2       albertel   63: 
1.1       harris41   64: use HTML::TokeParser;
1.2       albertel   65: 
1.3       harris41   66: my $usage=<<END;
                     67: **** ERROR ERROR ERROR ERROR ****
                     68: Usage is for lpml file to come in through standard input.
                     69: 1st argument is the mode of parsing.
1.4       harris41   70: 2nd argument is the category permissions to use (runtime or development)
                     71: 3rd argument is the distribution (default,redhat6.2,debian2.2,redhat7.1,etc).
                     72: 4th argument is to manually specify a sourceroot.
                     73: 5th argument is to manually specify a targetroot.
1.3       harris41   74: 
                     75: Only the 1st argument is mandatory for the program to run.
                     76: 
                     77: Example:
                     78: 
                     79: cat ../../doc/loncapafiles.lpml |\\
1.25      harris41   80: perl lpml_parse.pl html development default /home/sherbert/loncapa /tmp/install
1.3       harris41   81: END
                     82: 
                     83: # ------------------------------------------------- Grab command line arguments
                     84: 
                     85: my $mode;
1.4       harris41   86: if (@ARGV==5) {
1.3       harris41   87:     $mode = shift @ARGV;
                     88: }
                     89: else {
1.4       harris41   90:     @ARGV=();shift @ARGV;
1.3       harris41   91:     while(<>){} # throw away the input to avoid broken pipes
                     92:     print $usage;
                     93:     exit -1; # exit with error status
                     94: }
                     95: 
1.4       harris41   96: my $categorytype;
                     97: if (@ARGV) {
                     98:     $categorytype = shift @ARGV;
                     99: }
                    100: 
1.3       harris41  101: my $dist;
                    102: if (@ARGV) {
                    103:     $dist = shift @ARGV;
                    104: }
1.2       albertel  105: 
1.3       harris41  106: my $targetroot;
                    107: my $sourceroot;
1.27      harris41  108: my $targetrootarg;
                    109: my $sourcerootarg;
1.3       harris41  110: if (@ARGV) {
1.4       harris41  111:     $sourceroot = shift @ARGV;
1.3       harris41  112: }
                    113: if (@ARGV) {
1.4       harris41  114:     $targetroot = shift @ARGV;
1.3       harris41  115: }
1.4       harris41  116: $sourceroot=~s/\/$//;
                    117: $targetroot=~s/\/$//;
1.27      harris41  118: $sourcerootarg=$sourceroot;
                    119: $targetrootarg=$targetroot;
1.3       harris41  120: 
1.19      harris41  121: my $logcmd='| tee -a WARNINGS';
                    122: 
1.5       harris41  123: my $invocation;
                    124: # --------------------------------------------------- Record program invocation
1.17      harris41  125: if ($mode eq 'install' or $mode eq 'configinstall' or $mode eq 'build') {
1.5       harris41  126:     $invocation=(<<END);
                    127: # Invocation: STDINPUT | lpml_parse.pl
                    128: #             1st argument (mode) is: $mode
                    129: #             2nd argument (category type) is: $categorytype
                    130: #             3rd argument (distribution) is: $dist
                    131: #             4th argument (targetroot) is: described below
                    132: #             5th argument (sourceroot) is: described below
                    133: END
                    134: }
                    135: 
1.3       harris41  136: # ---------------------------------------------------- Start first pass through
1.2       albertel  137: my @parsecontents = <>;
                    138: my $parsestring = join('',@parsecontents);
                    139: my $outstring;
                    140: 
1.3       harris41  141: # Need to make a pass through and figure out what defaults are
                    142: # overrided.  Top-down overriding strategy (leaves don't know
                    143: # about distant leaves).
                    144: 
                    145: my @hierarchy;
                    146: $hierarchy[0]=0;
                    147: my $hloc=0;
                    148: my $token;
                    149: $parser = HTML::TokeParser->new(\$parsestring) or
                    150:     die('can\'t create TokeParser object');
                    151: $parser->xml_mode('1');
                    152: my %hash;
                    153: my $key;
                    154: while ($token = $parser->get_token()) {
                    155:     if ($token->[0] eq 'S') {
                    156: 	$hloc++;
                    157: 	$hierarchy[$hloc]++;
                    158: 	$key=$token->[1].join(',',@hierarchy[0..($hloc-1)]);
                    159: 	my $thisdist=' '.$token->[2]{'dist'}.' ';
                    160: 	if ($thisdist eq ' default ') {
                    161: 	    $hash{$key}=1; # there is a default setting for this key
                    162: 	}
                    163: 	elsif ($dist && $hash{$key}==1 && $thisdist=~/\s$dist\s/) {
                    164: 	    $hash{$key}=2; # disregard default setting for this key if
                    165: 	                   # there is a directly requested distribution match
                    166: 	}
                    167:     }
                    168:     if ($token->[0] eq 'E') {
                    169: 	$hloc--;
                    170:     }
                    171: }
                    172: 
                    173: # --------------------------------------------------- Start second pass through
                    174: undef $hloc;
                    175: undef @hierarchy;
                    176: undef $parser;
                    177: $hierarchy[0]=0;
                    178: $parser = HTML::TokeParser->new(\$parsestring) or
                    179:     die('can\'t create TokeParser object');
                    180: $parser->xml_mode('1');
                    181: my $cleanstring;
                    182: while ($token = $parser->get_token()) {
                    183:     if ($token->[0] eq 'S') {
                    184: 	$hloc++;
                    185: 	$hierarchy[$hloc]++;
                    186: 	$key=$token->[1].join(',',@hierarchy[0..($hloc-1)]);
                    187: 	my $thisdist=' '.$token->[2]{'dist'}.' ';
1.4       harris41  188: 	# This conditional clause is set up to ignore two sets
                    189: 	# of invalid conditions before accepting entry into
                    190: 	# the cleanstring.
1.3       harris41  191: 	if ($hash{$key}==2 and
                    192: 	    !($thisdist eq '  ' or $thisdist =~/\s$dist\s/)) {
                    193: 	    if ($token->[4]!~/\/>$/) {
                    194: 		$parser->get_tag('/'.$token->[1]);
                    195: 		$hloc--;
                    196: 	    }
                    197: 	}
                    198: 	elsif ($thisdist ne '  ' and $thisdist!~/\s$dist\s/ and
                    199: 	       !($thisdist eq ' default ' and $hash{$key}!=2)) {
                    200: 	    if ($token->[4]!~/\/>$/) {
                    201: 		$parser->get_tag('/'.$token->[1]);
                    202: 		$hloc--;
                    203: 	    }
                    204: 	}
                    205: 	else {
                    206: 	    $cleanstring.=$token->[4];
                    207: 	}
                    208: 	if ($token->[4]=~/\/>$/) {
                    209: 	    $hloc--;
                    210: 	}
                    211:     }
                    212:     if ($token->[0] eq 'E') {
                    213: 	$cleanstring.=$token->[2];
                    214: 	$hloc--;
                    215:     }
                    216:     if ($token->[0] eq 'T') {
                    217: 	$cleanstring.=$token->[1];
                    218:     }
                    219: }
                    220: $cleanstring=&trim($cleanstring);
1.10      harris41  221: $cleanstring=~s/\>\s*\n\s*\</\>\</g;
                    222: 
1.3       harris41  223: # ---------------------------------------------------- Start final pass through
                    224: 
                    225: # storage variables
                    226: my $lpml;
                    227: my $categories;
1.29      harris41  228: my @categorynamelist;
1.3       harris41  229: my $category;
                    230: my $category_att_name;
                    231: my $category_att_type;
                    232: my $chown;
                    233: my $chmod;
1.25      harris41  234: my $abbreviation; # space-free abbreviation; esp. for image names
1.3       harris41  235: my $rpm;
                    236: my $rpmSummary;
                    237: my $rpmName;
                    238: my $rpmVersion;
                    239: my $rpmRelease;
                    240: my $rpmVendor;
                    241: my $rpmBuildRoot;
                    242: my $rpmCopyright;
                    243: my $rpmGroup;
                    244: my $rpmSource;
                    245: my $rpmAutoReqProv;
                    246: my $rpmdescription;
                    247: my $rpmpre;
                    248: my $directories;
                    249: my $directory;
                    250: my $targetdirs;
                    251: my $targetdir;
                    252: my $categoryname;
                    253: my $description;
                    254: my $files;
                    255: my $fileglobs;
                    256: my $links;
                    257: my $file;
                    258: my $link;
                    259: my $fileglob;
                    260: my $sourcedir;
                    261: my $targets;
                    262: my $target;
                    263: my $source;
                    264: my $note;
                    265: my $build;
1.14      harris41  266: my $buildlink;
1.3       harris41  267: my $commands;
                    268: my $command;
                    269: my $status;
                    270: my $dependencies;
                    271: my $dependency;
1.4       harris41  272: my @links;
                    273: my %categoryhash;
1.26      harris41  274: my $dpathlength;
                    275: my %fab; # file category abbreviation
1.29      harris41  276: my $directory_count;
                    277: my $file_count;
                    278: my $link_count;
                    279: my $fileglob_count;
                    280: my $fileglobnames_count;
                    281: my %categorycount;
                    282: # START TEMP WAY
                    283: #my %bytecount;  # TEMP WAY TO COUNT INFORMATION
                    284: #my %linecount;  # TEMP WAY TO COUNT INFORMATION
                    285: # END TEMP WAY
1.3       harris41  286: 
1.11      harris41  287: my @buildall;
1.12      harris41  288: my @buildinfo;
                    289: 
                    290: my @configall;
1.11      harris41  291: 
1.3       harris41  292: # Make new parser with distribution specific input
                    293: undef $parser;
                    294: $parser = HTML::TokeParser->new(\$cleanstring) or
                    295:     die('can\'t create TokeParser object');
                    296: $parser->xml_mode('1');
                    297: 
                    298: # Define handling methods for mode-dependent text rendering
1.26      harris41  299: 
1.3       harris41  300: $parser->{textify}={
1.31    ! harris41  301:     specialnotices => \&format_specialnotices,
        !           302:     specialnotice => \&format_specialnotice,
1.3       harris41  303:     targetroot => \&format_targetroot,
                    304:     sourceroot => \&format_sourceroot,
                    305:     categories => \&format_categories,
                    306:     category => \&format_category,
1.25      harris41  307:     abbreviation => \&format_abbreviation,
1.3       harris41  308:     targetdir => \&format_targetdir,
                    309:     chown => \&format_chown,
                    310:     chmod => \&format_chmod,
                    311:     rpm => \&format_rpm,
                    312:     rpmSummary => \&format_rpmSummary,
                    313:     rpmName => \&format_rpmName,
                    314:     rpmVersion => \&format_rpmVersion,
                    315:     rpmRelease => \&format_rpmRelease,
                    316:     rpmVendor => \&format_rpmVendor,
                    317:     rpmBuildRoot => \&format_rpmBuildRoot,
                    318:     rpmCopyright => \&format_rpmCopyright,
                    319:     rpmGroup => \&format_rpmGroup,
                    320:     rpmSource => \&format_rpmSource,
                    321:     rpmAutoReqProv => \&format_rpmAutoReqProv,
                    322:     rpmdescription => \&format_rpmdescription,
                    323:     rpmpre => \&format_rpmpre,
                    324:     directories => \&format_directories,
                    325:     directory => \&format_directory,
                    326:     categoryname => \&format_categoryname,
                    327:     description => \&format_description,
                    328:     files => \&format_files,
                    329:     file => \&format_file,
                    330:     fileglob => \&format_fileglob,
1.4       harris41  331:     links => \&format_links,
1.3       harris41  332:     link => \&format_link,
                    333:     linkto => \&format_linkto,
                    334:     source => \&format_source,
                    335:     target => \&format_target,
                    336:     note => \&format_note,
                    337:     build => \&format_build,
                    338:     status => \&format_status,
                    339:     dependencies => \&format_dependencies,
1.14      harris41  340:     buildlink => \&format_buildlink,
1.3       harris41  341:     glob => \&format_glob,
                    342:     sourcedir => \&format_sourcedir,
                    343:     filenames => \&format_filenames,
                    344:     };
                    345: 
                    346: my $text;
                    347: my $token;
                    348: undef $hloc;
                    349: undef @hierarchy;
                    350: my $hloc;
                    351: my @hierarchy2;
                    352: while ($token = $parser->get_tag('lpml')) {
                    353:     &format_lpml(@{$token});
                    354:     $text = &trim($parser->get_text('/lpml'));
                    355:     $token = $parser->get_tag('/lpml');
                    356:     print $lpml; 
                    357:     print "\n";
1.4       harris41  358: #    $text=~s/\s*\n\s*\n\s*/\n/g;
1.3       harris41  359:     print $text;
                    360:     print "\n";
                    361:     print &end();
                    362: }
                    363: exit;
                    364: 
1.14      harris41  365: # ---------- Functions (most all just format contents of different markup tags)
                    366: 
                    367: # ------------------------ Final output at end of markup parsing and formatting
1.3       harris41  368: sub end {
                    369:     if ($mode eq 'html') {
1.29      harris41  370: 	# START TEMP WAY
                    371: #	my $totallinecount;
                    372: #	my $totalbytecount;
                    373: #	map {$totallinecount+=$linecount{$_};
                    374: #	     $totalbytecount+=$bytecount{$_}}
                    375: # 	  @categorynamelist;
                    376:         # END TEMP WAY
                    377: 	return "<br />&nbsp;<br />".
                    378: 	    "<a name='summary' /><font size='+2'>Summary of Source Repository".
                    379: 	    "</font>".
                    380: 	    "<br />&nbsp;<br />".
                    381: 	    "<table border='1' cellpadding='5'>".
                    382: 	    "<caption>Files, Directories, and Symbolic Links</caption>".
                    383: 	    "<tr><td>Files (not referenced by globs)</td><td>$file_count</td>".
                    384: 	    "</tr>".
                    385: 	    "<tr><td>Files (referenced by globs)</td>".
                    386: 	    "<td>$fileglobnames_count</td>".
                    387: 	    "</tr>".
                    388: 	    "<tr><td>Total Files</td>".
                    389: 	    "<td>".($fileglobnames_count+$file_count)."</td>".
                    390: 	    "</tr>".
                    391: 	    "<tr><td>File globs</td>".
                    392: 	    "<td>".$fileglob_count."</td>".
                    393: 	    "</tr>".
                    394: 	    "<tr><td>Directories</td>".
                    395: 	    "<td>".$directory_count."</td>".
                    396: 	    "</tr>".
                    397: 	    "<tr><td>Symbolic links</td>".
                    398: 	    "<td>".$link_count."</td>".
                    399: 	    "</tr>".
                    400: 	    "</table>".
                    401: 	    "<table border='1' cellpadding='5'>".
                    402: 	    "<caption>File Category Count</caption>".
                    403: 	    "<tr><th>Icon</th><th>Name</th><th>Number of Occurrences</th>".
                    404: 	    join("\n",(map {"<tr><td><img src='$fab{$_}.gif' ".
                    405: 		 "alt='$_ icon' /></td>".
                    406:  	         "<td>$_</td><td>$categorycount{$_}</td></tr>"}
                    407: 		@categorynamelist)).
                    408: 	    "</table>".
                    409: 	    "</body></html>\n";
                    410: 
                    411: # START TEMP WAY
                    412: #	    join("\n",(map {"<tr><td><img src='$fab{$_}.gif' ".
                    413: #		 "alt='$_ icon' /></td>".
                    414: # 	         "<td>$_</td><td>$categorycount{$_}</td><td>$linecount{$_}</td><td>$bytecount{$_}</td></tr>"}
                    415: #		@categorynamelist)).
                    416: #	    "<br />&nbsp;<br />".
                    417: #	    "Total Lines of Code: $totallinecount".
                    418: #	    "<br />&nbsp;<br />".
                    419: #	    "Total Bytes: $totalbytecount".
                    420: # END TEMP WAY
1.3       harris41  421:     }
1.4       harris41  422:     if ($mode eq 'install') {
                    423: 	return '';
                    424:     }
1.3       harris41  425: }
                    426: 
                    427: # ----------------------- Take in string to parse and the separation expression
                    428: sub extract_array {
                    429:     my ($stringtoparse,$sepexp) = @_;
                    430:     my @a=split(/$sepexp/,$stringtoparse);
                    431:     return \@a;
                    432: }
                    433: 
                    434: # --------------------------------------------------------- Format lpml section
                    435: sub format_lpml {
                    436:     my (@tokeninfo)=@_;
                    437:     my $date=`date`; chop $date;
                    438:     if ($mode eq 'html') {
1.24      harris41  439: 	$lpml=<<END;
                    440: <html>
                    441: <head>
1.25      harris41  442: <title>LPML Description Page
                    443: (dist=$dist, categorytype=$categorytype, $date)</title>
1.24      harris41  444: </head>
                    445: <body>
                    446: END
                    447: 	$lpml .= "<br /><font size='+2'>LPML Description Page (dist=$dist, ".
1.25      harris41  448: 	    "categorytype=$categorytype, $date)".
1.23      harris41  449: 	    "</font>";
                    450: 	$lpml .=<<END;
                    451: <ul>
1.24      harris41  452: <li><a href='#about'>About this file</a></li>
                    453: <li><a href='#ownperms'>File Type Ownership and Permissions
                    454: Descriptions</a></li>
                    455: <li><a href='#package'>Software Package Description</a></li>
                    456: <li><a href='#directories'>Directory Structure</a></li>
1.26      harris41  457: <li><a href='#files'>Files</a></li>
1.29      harris41  458: <li><a href='#summary'>Summary of Source Repository</a></li>
1.23      harris41  459: </ul>
                    460: END
                    461:         $lpml .=<<END;
1.24      harris41  462: <br />&nbsp;<br /><a name='about' />
1.23      harris41  463: <font size='+2'>About this file</font>
                    464: <p>
                    465: This file is generated dynamically by <tt>lpml_parse.pl</tt> as
1.28      harris41  466: part of a development compilation process.</p>
                    467: <p>LPML written by Scott Harrison (harris41\@msu.edu).
1.23      harris41  468: </p>
                    469: END
                    470:     }
                    471:     elsif ($mode eq 'text') {
                    472: 	$lpml = "LPML Description Page (dist=$dist, $date)";
                    473: 	$lpml .=<<END;
                    474: 
                    475: * About this file
                    476: * Software Package Description
                    477: * Directory Structure
                    478: * File Type Ownership and Permissions
1.26      harris41  479: * Files
1.23      harris41  480: END
                    481:         $lpml .=<<END;
                    482: 
                    483: About this file
                    484: 
                    485: This file is generated dynamically by lpml_parse.pl as
                    486: part of a development compilation process.  Author: Scott
                    487: Harrison (harris41\@msu.edu).
                    488: 
                    489: END
1.3       harris41  490:     }
1.4       harris41  491:     elsif ($mode eq 'install') {
                    492: 	print '# LPML install targets. Linux Packaging Markup Language,';
                    493: 	print ' by Scott Harrison 2001'."\n";
                    494: 	print '# This file was automatically generated on '.`date`;
1.5       harris41  495: 	print "\n".$invocation;
1.14      harris41  496: 	$lpml .= "SHELL=\"/bin/bash\"\n\n";
1.4       harris41  497:     }
1.16      harris41  498:     elsif ($mode eq 'configinstall') {
1.17      harris41  499: 	print '# LPML configuration file targets (configinstall).'."\n";
                    500: 	print '# Linux Packaging Markup Language,';
1.16      harris41  501: 	print ' by Scott Harrison 2001'."\n";
                    502: 	print '# This file was automatically generated on '.`date`;
                    503: 	print "\n".$invocation;
                    504: 	$lpml .= "SHELL=\"/bin/bash\"\n\n";
                    505:     }
1.11      harris41  506:     elsif ($mode eq 'build') {
1.14      harris41  507: 	$lpml = "# LPML build targets. Linux Packaging Markup Language,";
                    508: 	$lpml .= ' by Scott Harrison 2001'."\n";
1.11      harris41  509: 	$lpml .= '# This file was automatically generated on '.`date`;
1.17      harris41  510: 	$lpml .= "\n".$invocation;
1.11      harris41  511: 	$lpml .= "SHELL=\"/bin/sh\"\n\n";
                    512:     }
1.4       harris41  513:     else {
                    514: 	return '';
                    515:     }
1.3       harris41  516: }
                    517: # --------------------------------------------------- Format targetroot section
                    518: sub format_targetroot {
                    519:     my $text=&trim($parser->get_text('/targetroot'));
                    520:     $text=$targetroot if $targetroot;
                    521:     $parser->get_tag('/targetroot');
                    522:     if ($mode eq 'html') {
1.10      harris41  523: 	return $targetroot="\n<br />TARGETROOT: $text";
1.3       harris41  524:     }
1.17      harris41  525:     elsif ($mode eq 'install' or $mode eq 'build' or
                    526: 	   $mode eq 'configinstall') {
1.11      harris41  527: 	return '# TARGET INSTALL LOCATION is "'.$targetroot."\"\n";
                    528:     }
1.3       harris41  529:     else {
                    530: 	return '';
                    531:     }
                    532: }
                    533: # --------------------------------------------------- Format sourceroot section
                    534: sub format_sourceroot {
                    535:     my $text=&trim($parser->get_text('/sourceroot'));
                    536:     $text=$sourceroot if $sourceroot;
                    537:     $parser->get_tag('/sourceroot');
                    538:     if ($mode eq 'html') {
1.10      harris41  539: 	return $sourceroot="\n<br />SOURCEROOT: $text";
1.3       harris41  540:     }
1.17      harris41  541:     elsif ($mode eq 'install' or $mode eq 'build' or
                    542: 	   $mode eq 'configinstall') {
1.11      harris41  543: 	return '# SOURCE CODE LOCATION IS "'.$sourceroot."\"\n";;
                    544:     }
1.3       harris41  545:     else {
                    546: 	return '';
                    547:     }
                    548: }
                    549: # --------------------------------------------------- Format categories section
                    550: sub format_categories {
                    551:     my $text=&trim($parser->get_text('/categories'));
                    552:     $parser->get_tag('/categories');
                    553:     if ($mode eq 'html') {
1.24      harris41  554: 	return $categories="\n<br />&nbsp;<br />".
                    555: 	    "\n<a name='ownperms'>".
                    556: 	    "\n<font size='+2'>File Type Ownership and Permissions".
                    557: 	    " Descriptions</font>".
1.25      harris41  558: 	    "\n<p>This table shows what permissions and ownership settings ".
                    559: 	    "correspond to each category.</p>".
                    560: 	    "\n<table border='1' cellpadding='5' width='60%'>\n".
                    561: 	    "<tr>".
                    562: 	    "<th align='left' bgcolor='#ffffff'>Icon</th>".
                    563: 	    "<th align='left' bgcolor='#ffffff'>Category Name</th>".
                    564: 	    "<th align='left' bgcolor='#ffffff'>Permissions ".
                    565: 	    "($categorytype)</th>".
                    566: 	    "</tr>".
                    567: 	    "\n$text\n".
1.24      harris41  568: 	    "</table>\n";
                    569:     }
                    570:     elsif ($mode eq 'text') {
                    571: 	return $categories="\n".
                    572: 	    "\nFile Type Ownership and Permissions".
                    573: 	    " Descriptions".
1.25      harris41  574: 	    "\n$text".
1.24      harris41  575: 	    "\n";
1.3       harris41  576:     }
                    577:     else {
                    578: 	return '';
                    579:     }
                    580: }
                    581: # --------------------------------------------------- Format categories section
                    582: sub format_category {
                    583:     my (@tokeninfo)=@_;
                    584:     $category_att_name=$tokeninfo[2]->{'name'};
                    585:     $category_att_type=$tokeninfo[2]->{'type'};
1.25      harris41  586:     $abbreviation=''; $chmod='';$chown='';
1.3       harris41  587:     $parser->get_text('/category');
                    588:     $parser->get_tag('/category');
1.26      harris41  589:     $fab{$category_att_name}=$abbreviation;
1.3       harris41  590:     if ($mode eq 'html') {
1.25      harris41  591: 	if ($category_att_type eq $categorytype) {
1.29      harris41  592: 	    push @categorynamelist,$category_att_name;
1.27      harris41  593: 	    $categoryhash{$category_att_name}="$chmod $chown";
1.25      harris41  594: 	    return $category="<tr>".
                    595: 		"<td><img src='$abbreviation.gif' ".
                    596:    	        "alt='${category_att_name}' /></td>\n".
                    597: 		"<td>${category_att_name}</td>\n".
                    598: 		"<td>$chmod $chown</td>\n".
                    599: 		"</tr>".
                    600: 		"\n";
                    601: #	return $category="\n<br />CATEGORY $category_att_name ".
                    602: #	    "$category_att_type $chmod $chown";
                    603: 	}
1.3       harris41  604:     }
                    605:     else {
1.4       harris41  606: 	if ($category_att_type eq $categorytype) {
                    607: 	    my ($user,$group)=split(/\:/,$chown);
                    608: 	    $categoryhash{$category_att_name}='-o '.$user.' -g '.$group.
                    609: 		' -m '.$chmod;
                    610: 	}
1.3       harris41  611: 	return '';
                    612:     }
                    613: }
1.25      harris41  614: # --------------------------------------------------- Format categories section
                    615: sub format_abbreviation {
                    616:     my @tokeninfo=@_;
                    617:     $abbreviation='';
                    618:     my $text=&trim($parser->get_text('/abbreviation'));
                    619:     if ($text) {
                    620: 	$parser->get_tag('/abbreviation');
                    621: 	$abbreviation=$text;
                    622:     }
                    623:     return '';
                    624: }
1.3       harris41  625: # -------------------------------------------------------- Format chown section
                    626: sub format_chown {
                    627:     my @tokeninfo=@_;
                    628:     $chown='';
                    629:     my $text=&trim($parser->get_text('/chown'));
                    630:     if ($text) {
                    631: 	$parser->get_tag('/chown');
                    632: 	$chown=$text;
                    633:     }
                    634:     return '';
                    635: }
                    636: # -------------------------------------------------------- Format chmod section
                    637: sub format_chmod {
                    638:     my @tokeninfo=@_;
                    639:     $chmod='';
                    640:     my $text=&trim($parser->get_text('/chmod'));
                    641:     if ($text) {
                    642: 	$parser->get_tag('/chmod');
                    643: 	$chmod=$text;
                    644:     }
                    645:     return '';
                    646: }
                    647: # ---------------------------------------------------------- Format rpm section
                    648: sub format_rpm {
                    649:     my $text=&trim($parser->get_text('/rpm'));
                    650:     $parser->get_tag('/rpm');
                    651:     if ($mode eq 'html') {
1.23      harris41  652: 	return $rpm=<<END;
1.24      harris41  653: <br />&nbsp;<br />
                    654: <a name='package' />
1.23      harris41  655: <font size='+2'>Software Package Description</font>
                    656: <p>
                    657: <table bgcolor='#ffffff' border='0' cellpadding='10' cellspacing='0'>
                    658: <tr><td><pre>
                    659: $text
                    660: </pre></td></tr>
                    661: </table>
                    662: END
                    663:     }
                    664:     elsif ($mode eq 'text') {
                    665: 	return $rpm=<<END;
                    666: Software Package Description
                    667: 
                    668: $text
                    669: END
1.3       harris41  670:     }
                    671:     else {
                    672: 	return '';
                    673:     }
                    674: }
                    675: # --------------------------------------------------- Format rpmSummary section
                    676: sub format_rpmSummary {
                    677:     my $text=&trim($parser->get_text('/rpmSummary'));
                    678:     $parser->get_tag('/rpmSummary');
                    679:     if ($mode eq 'html') {
1.23      harris41  680: 	return $rpmSummary="\nSummary     : $text";
                    681:     }
                    682:     elsif ($mode eq 'text') {
                    683: 	return $rpmSummary="\nSummary     : $text";
1.3       harris41  684:     }
                    685:     else {
                    686: 	return '';
                    687:     }
                    688: }
                    689: # ------------------------------------------------------ Format rpmName section
                    690: sub format_rpmName {
                    691:     my $text=&trim($parser->get_text('/rpmName'));
                    692:     $parser->get_tag('/rpmName');
                    693:     if ($mode eq 'html') {
1.24      harris41  694: 	return $rpmName="\nName        : $text";
                    695:     }
                    696:     elsif ($mode eq 'text') {
                    697: 	return $rpmName="\nName        : $text";
1.3       harris41  698:     }
                    699:     else {
                    700: 	return '';
                    701:     }
                    702: }
                    703: # --------------------------------------------------- Format rpmVersion section
                    704: sub format_rpmVersion {
                    705:     my $text=$parser->get_text('/rpmVersion');
                    706:     $parser->get_tag('/rpmVersion');
                    707:     if ($mode eq 'html') {
1.24      harris41  708: 	return $rpmVersion="\nVersion     : $text";
                    709:     }
                    710:     elsif ($mode eq 'text') {
                    711: 	return $rpmVersion="\nVersion     : $text";
1.3       harris41  712:     }
                    713:     else {
                    714: 	return '';
                    715:     }
                    716: }
                    717: # --------------------------------------------------- Format rpmRelease section
                    718: sub format_rpmRelease {
                    719:     my $text=$parser->get_text('/rpmRelease');
                    720:     $parser->get_tag('/rpmRelease');
                    721:     if ($mode eq 'html') {
1.24      harris41  722: 	return $rpmRelease="\nRelease     : $text";
                    723:     }
                    724:     elsif ($mode eq 'text') {
                    725: 	return $rpmRelease="\nRelease     : $text";
1.3       harris41  726:     }
                    727:     else {
                    728: 	return '';
                    729:     }
                    730: }
                    731: # ---------------------------------------------------- Format rpmVendor section
                    732: sub format_rpmVendor {
                    733:     my $text=$parser->get_text('/rpmVendor');
                    734:     $parser->get_tag('/rpmVendor');
                    735:     if ($mode eq 'html') {
1.24      harris41  736: 	return $rpmVendor="\nVendor      : $text";
                    737:     }
                    738:     elsif ($mode eq 'text') {
                    739: 	return $rpmVendor="\nVendor      : $text";
1.3       harris41  740:     }
                    741:     else {
                    742: 	return '';
                    743:     }
                    744: }
                    745: # ------------------------------------------------- Format rpmBuildRoot section
                    746: sub format_rpmBuildRoot {
                    747:     my $text=$parser->get_text('/rpmBuildRoot');
                    748:     $parser->get_tag('/rpmBuildRoot');
                    749:     if ($mode eq 'html') {
1.24      harris41  750: 	return $rpmBuildRoot="\nBuild Root  : $text";
                    751:     }
                    752:     elsif ($mode eq 'text') {
                    753: 	return $rpmBuildRoot="\nBuild Root  : $text";
1.3       harris41  754:     }
                    755:     else {
                    756: 	return '';
                    757:     }
                    758: }
                    759: # ------------------------------------------------- Format rpmCopyright section
                    760: sub format_rpmCopyright {
                    761:     my $text=$parser->get_text('/rpmCopyright');
                    762:     $parser->get_tag('/rpmCopyright');
                    763:     if ($mode eq 'html') {
1.24      harris41  764: 	return $rpmCopyright="\nLicense     : $text";
                    765:     }
                    766:     elsif ($mode eq 'text') {
                    767: 	return $rpmCopyright="\nLicense     : $text";
1.3       harris41  768:     }
                    769:     else {
                    770: 	return '';
                    771:     }
                    772: }
                    773: # ----------------------------------------------------- Format rpmGroup section
                    774: sub format_rpmGroup {
                    775:     my $text=$parser->get_text('/rpmGroup');
                    776:     $parser->get_tag('/rpmGroup');
                    777:     if ($mode eq 'html') {
1.24      harris41  778: 	return $rpmGroup="\nGroup       : $text";
                    779:     }
                    780:     elsif ($mode eq 'text') {
                    781: 	return $rpmGroup="\nGroup       : $text";
1.3       harris41  782:     }
                    783:     else {
                    784: 	return '';
                    785:     }
                    786: }
                    787: # ---------------------------------------------------- Format rpmSource section
                    788: sub format_rpmSource {
                    789:     my $text=$parser->get_text('/rpmSource');
                    790:     $parser->get_tag('/rpmSource');
                    791:     if ($mode eq 'html') {
1.24      harris41  792: 	return $rpmSource="\nSource      : $text";
                    793:     }
                    794:     elsif ($mode eq 'text') {
                    795: 	return $rpmSource="\nSource      : $text";
1.3       harris41  796:     }
                    797:     else {
                    798: 	return '';
                    799:     }
                    800: }
                    801: # ----------------------------------------------- Format rpmAutoReqProv section
                    802: sub format_rpmAutoReqProv {
                    803:     my $text=$parser->get_text('/rpmAutoReqProv');
                    804:     $parser->get_tag('/rpmAutoReqProv');
                    805:     if ($mode eq 'html') {
1.24      harris41  806: 	return $rpmAutoReqProv="\nAutoReqProv : $text";
                    807:     }
                    808:     if ($mode eq 'text') {
                    809: 	return $rpmAutoReqProv="\nAutoReqProv : $text";
1.3       harris41  810:     }
                    811:     else {
                    812: 	return '';
                    813:     }
                    814: }
                    815: # ----------------------------------------------- Format rpmdescription section
                    816: sub format_rpmdescription {
                    817:     my $text=$parser->get_text('/rpmdescription');
                    818:     $parser->get_tag('/rpmdescription');
                    819:     if ($mode eq 'html') {
1.25      harris41  820: 	$text=~s/\n//g;
                    821: 	$text=~s/\\n/\n/g;
1.24      harris41  822: 	return $rpmdescription="\nDescription : $text";
                    823:     }
                    824:     elsif ($mode eq 'text') {
1.25      harris41  825: 	$text=~s/\n//g;
                    826: 	$text=~s/\\n/\n/g;
1.24      harris41  827: 	return $rpmdescription="\nDescription : $text";
1.3       harris41  828:     }
                    829:     else {
                    830: 	return '';
                    831:     }
                    832: }
                    833: # ------------------------------------------------------- Format rpmpre section
                    834: sub format_rpmpre {
                    835:     my $text=$parser->get_text('/rpmpre');
                    836:     $parser->get_tag('/rpmpre');
                    837:     if ($mode eq 'html') {
1.24      harris41  838: #	return $rpmpre="\n<br />RPMPRE $text";
                    839: 	return '';
1.3       harris41  840:     }
                    841:     else {
                    842: 	return '';
                    843:     }
                    844: }
                    845: # -------------------------------------------------- Format directories section
                    846: sub format_directories {
1.4       harris41  847:     my $text=$parser->get_text('/directories');
1.3       harris41  848:     $parser->get_tag('/directories');
                    849:     if ($mode eq 'html') {
1.26      harris41  850: 	$text=~s/\[\{\{\{\{\{DPATHLENGTH\}\}\}\}\}\]/$dpathlength/g;
1.24      harris41  851: 	return $directories="\n<br />&nbsp;<br />".
                    852: 	    "<a name='directories' />".
                    853: 	    "<font size='+2'>Directory Structure</font>".
1.26      harris41  854: 	    "\n<br />&nbsp;<br />".
                    855: 	    "<table border='1' cellpadding='3' cellspacing='0'>\n".
                    856: 	    "<tr><th bgcolor='#ffffff'>Category</th>".
                    857: 	    "<th bgcolor='#ffffff'>Status</th>\n".
                    858: 	    "<th bgcolor='#ffffff'>Expected Permissions & Ownership</th>\n".
                    859: 	    "<th bgcolor='#ffffff' colspan='$dpathlength'>Target Directory ".
                    860: 	    "Path</th></tr>\n".
                    861:  	    "\n$text\n</table><br />"."\n";
1.24      harris41  862:     }
                    863:     elsif ($mode eq 'text') {
                    864: 	return $directories="\nDirectory Structure\n$text\n".
                    865: 	    "\n";
1.3       harris41  866:     }
1.4       harris41  867:     elsif ($mode eq 'install') {
                    868: 	return "\n".'directories:'."\n".$text;
                    869:    }
1.3       harris41  870:     else {
                    871: 	return '';
                    872:     }
                    873: }
                    874: # ---------------------------------------------------- Format directory section
                    875: sub format_directory {
                    876:     my (@tokeninfo)=@_;
                    877:     $targetdir='';$categoryname='';$description='';
                    878:     $parser->get_text('/directory');
                    879:     $parser->get_tag('/directory');
1.29      harris41  880:     $directory_count++;
                    881:     $categorycount{$categoryname}++;
1.3       harris41  882:     if ($mode eq 'html') {
1.26      harris41  883: 	my @a;
                    884: 	@a=($targetdir=~/\//g);
                    885: 	my $d=scalar(@a)+1;
                    886: 	$dpathlength=$d if $d>$dpathlength;
                    887: 	my $thtml=$targetdir;
                    888: 	$thtml=~s/\//\<\/td\>\<td bgcolor='#ffffff'\>/g;
1.28      harris41  889: 	my ($chmod,$chown)=split(/\s/,$categoryhash{$categoryname});
1.26      harris41  890: 	return $directory="\n<tr><td rowspan='2' bgcolor='#ffffff'>".
                    891: 	    "$categoryname</td>".
1.29      harris41  892: 	    "<td rowspan='2' bgcolor='#ffffff'><!-- POSTEVAL verify.pl directory /$targetdir $categoryhash{$categoryname} -->&nbsp;</td>".
1.26      harris41  893: 	    "<td rowspan='2' bgcolor='#ffffff'>$chmod<br />$chown</td>".
                    894: 	    "<td bgcolor='#ffffff'>$thtml</td></tr>".
                    895: 	    "<tr><td bgcolor='#ffffff' colspan='[{{{{{DPATHLENGTH}}}}}]'>".
                    896: 	    "$description</td></tr>";
                    897:     }
                    898:     if ($mode eq 'text') {
                    899: 	return $directory="\nDIRECTORY $targetdir $categoryname ".
1.10      harris41  900: 	    "$description";
1.3       harris41  901:     }
1.4       harris41  902:     elsif ($mode eq 'install') {
1.8       harris41  903: 	return "\t".'install '.$categoryhash{$categoryname}.' -d '.
                    904: 	    $targetroot.'/'.$targetdir."\n";
1.4       harris41  905:     }
1.3       harris41  906:     else {
                    907: 	return '';
                    908:     }
                    909: }
                    910: # ---------------------------------------------------- Format targetdir section
                    911: sub format_targetdir {
                    912:     my @tokeninfo=@_;
                    913:     $targetdir='';
                    914:     my $text=&trim($parser->get_text('/targetdir'));
                    915:     if ($text) {
                    916: 	$parser->get_tag('/targetdir');
                    917: 	$targetdir=$text;
                    918:     }
                    919:     return '';
                    920: }
                    921: # ------------------------------------------------- Format categoryname section
                    922: sub format_categoryname {
                    923:     my @tokeninfo=@_;
                    924:     $categoryname='';
                    925:     my $text=&trim($parser->get_text('/categoryname'));
                    926:     if ($text) {
                    927: 	$parser->get_tag('/categoryname');
                    928: 	$categoryname=$text;
                    929:     }
                    930:     return '';
                    931: }
                    932: # -------------------------------------------------- Format description section
                    933: sub format_description {
                    934:     my @tokeninfo=@_;
                    935:     $description='';
1.10      harris41  936:     my $text=&htmlsafe(&trim($parser->get_text('/description')));
1.3       harris41  937:     if ($text) {
                    938: 	$parser->get_tag('/description');
                    939: 	$description=$text;
                    940:     }
                    941:     return '';
                    942: }
                    943: # -------------------------------------------------------- Format files section
                    944: sub format_files {
1.4       harris41  945:     my $text=$parser->get_text('/files');
1.3       harris41  946:     $parser->get_tag('/files');
                    947:     if ($mode eq 'html') {
1.24      harris41  948: 	return $directories="\n<br />&nbsp;<br />".
                    949: 	    "<a name='files' />".
1.26      harris41  950: 	    "<font size='+2'>Files</font><br />&nbsp;<br />".
                    951: 	    "<p>All source and target locations are relative to the ".
                    952: 	    "sourceroot and targetroot values at the beginning of this ".
                    953: 	    "document.</p>".
                    954: 	    "\n<table border='1' cellpadding='5'>".
                    955: 	    "<tr><th>Status</th><th colspan='2'>Category</th>".
                    956: 	    "<th>Name/Location</th>".
                    957: 	    "<th>Description</th><th>Notes</th></tr>".
                    958: 	    "$text</table>\n".
1.24      harris41  959: 	    "\n";
                    960:     }
                    961:     elsif ($mode eq 'text') {
                    962: 	return $directories="\n".
                    963: 	    "File and Directory Structure".
                    964: 	    "\n$text\n".
                    965: 	    "\n";
1.3       harris41  966:     }
1.4       harris41  967:     elsif ($mode eq 'install') {
                    968: 	return "\n".'files:'."\n".$text.
                    969: 	    "\n".'links:'."\n".join('',@links);
                    970:     }
1.12      harris41  971:     elsif ($mode eq 'configinstall') {
                    972: 	return "\n".'configfiles: '.
                    973: 	join(' ',@configall).
1.14      harris41  974: 	"\n\n".$text.
                    975: 	"\n\nalwaysrun:\n\n";
1.12      harris41  976:     }
1.11      harris41  977:     elsif ($mode eq 'build') {
                    978: 	my $binfo;
                    979: 	my $tword;
                    980: 	my $command2;
                    981: 	my @deps;
                    982: 	foreach my $bi (@buildinfo) {
1.14      harris41  983: 	    my ($target,$source,$command,$trigger,@deps)=split(/\;/,$bi);
1.11      harris41  984: 	    $tword=''; $tword=' alwaysrun' if $trigger eq 'always run'; 
                    985: 	    $command=~s/\/([^\/]*)$//;
                    986: 	    $command2="cd $command; sh ./$1;\\";
                    987: 	    my $depstring;
1.14      harris41  988: 	    my $depstring2="\t\t\@echo '';\\\n";
                    989: 	    my $olddep;
1.11      harris41  990: 	    foreach my $dep (@deps) {
1.14      harris41  991: 		unless ($olddep) {
                    992: 		    $olddep=$deps[$#deps];
                    993: 		}
1.11      harris41  994: 		$depstring.="\telif !(test -r $command/$dep);\\\n";
                    995: 		$depstring.="\t\tthen echo ".
1.14      harris41  996: 		"\"**** WARNING **** missing the file: ".
1.19      harris41  997:  	        "$command/$dep\"$logcmd;\\\n";
1.14      harris41  998: 		$depstring.="\t\ttest -e $source || test -e $target || echo ".
                    999: 		    "'**** ERROR **** neither source=$source nor target=".
1.19      harris41 1000: 		    "$target exist and they cannot be built'$logcmd;\\\n";
1.14      harris41 1001: 		$depstring.="\t\tmake -f Makefile.build ${source}___DEPS;\\\n";
                   1002: 		if ($olddep) {
                   1003: 		    $depstring2.="\t\tECODE=0;\\\n";
                   1004: 		    $depstring2.="\t\t! test -e $source && test -r $command/$olddep &&".
1.19      harris41 1005: 			" { perl filecompare.pl -b2 $command/$olddep $target ||  ECODE=\$\$?; } && { [ \$\$ECODE != \"2\" ] || echo \"**** WARNING **** dependency $command/$olddep is newer than target file $target; SOMETHING MAY BE WRONG\"$logcmd; };\\\n";
1.14      harris41 1006: 		}
                   1007: 		$olddep=$dep;
1.11      harris41 1008: 	    }
                   1009: 	    $binfo.="$source: $tword\n".
                   1010: 		"\t\@if !(echo \"\");\\\n\t\tthen echo ".
1.14      harris41 1011: 		"\"**** WARNING **** Strange shell. ".
1.19      harris41 1012:  	        "Check your path settings.\"$logcmd;\\\n".
1.11      harris41 1013: 		$depstring.
                   1014: 		"\telse \\\n\t\t$command2\n\tfi\n\n";
1.14      harris41 1015: 	    $binfo.="${source}___DEPS:\n".$depstring2."\t\tECODE=0;\n\n";
1.11      harris41 1016: 	}
                   1017: 	return 'all: '.join(' ',@buildall)."\n\n".
                   1018:   	        $text.
                   1019: 		$binfo."\n".
                   1020: 		"alwaysrun:\n\n";
                   1021:     }
1.3       harris41 1022:     else {
                   1023: 	return '';
                   1024:     }
                   1025: }
                   1026: # ---------------------------------------------------- Format fileglobs section
                   1027: sub format_fileglobs {
                   1028: 
                   1029: }
                   1030: # -------------------------------------------------------- Format links section
1.4       harris41 1031: # deprecated.. currently <link></link>'s are included in <files></files>
1.3       harris41 1032: sub format_links {
1.4       harris41 1033:     my $text=$parser->get_text('/links');
                   1034:     $parser->get_tag('/links');
                   1035:     if ($mode eq 'html') {
1.10      harris41 1036: 	return $links="\n<br />BEGIN LINKS\n$text\n<br />END LINKS\n";
1.4       harris41 1037:     }
                   1038:     elsif ($mode eq 'install') {
                   1039: 	return "\n".'links:'."\n\t".$text;
                   1040:     }
                   1041:     else {
                   1042: 	return '';
                   1043:     }
1.1       harris41 1044: }
1.3       harris41 1045: # --------------------------------------------------------- Format file section
                   1046: sub format_file {
                   1047:     my @tokeninfo=@_;
                   1048:     $file=''; $source=''; $target=''; $categoryname=''; $description='';
                   1049:     $note=''; $build=''; $status=''; $dependencies='';
                   1050:     my $text=&trim($parser->get_text('/file'));
1.14      harris41 1051:     my $buildtest;
1.29      harris41 1052:     $file_count++;
                   1053:     $categorycount{$categoryname}++;
                   1054:     # START TEMP WAY
                   1055: #    if (-T "$sourcerootarg/$source") {
                   1056: #	$linecount{$categoryname}+=`wc -l $sourcerootarg/$source`;
                   1057: #    }
                   1058: #    my $bytesize=(-s "$sourcerootarg/$source");
                   1059: #    $bytecount{$categoryname}+=$bytesize;
                   1060:     # END TEMP WAY
1.3       harris41 1061:     if ($source) {
                   1062: 	$parser->get_tag('/file');
                   1063: 	if ($mode eq 'html') {
1.26      harris41 1064: 	    return ($file="\n<!-- FILESORT:$target -->".
                   1065: 		    "<tr>".
1.29      harris41 1066: 		    "<td><!-- POSTEVAL verify.pl file '$sourcerootarg' ".
1.28      harris41 1067: 		    "'$targetrootarg' ".
                   1068: 		    "'$source' '$target' ".
                   1069: 		    "$categoryhash{$categoryname} -->&nbsp;</td><td>".
1.27      harris41 1070: 		    "<img src='$fab{$categoryname}.gif' ".
1.26      harris41 1071: 		    "alt='$categoryname icon' /></td>".
1.27      harris41 1072: 		    "<td>$categoryname<br /><font size='-1'>".
                   1073: 		    $categoryhash{$categoryname}."</font></td>".
1.26      harris41 1074: 		    "<td>SOURCE: $source<br />TARGET: $target</td>".
                   1075: 		    "<td>$description</td>".
                   1076: 		    "<td>$note</td>".
                   1077: 		    "</tr>");
                   1078: #	    return ($file="\n<br />BEGIN FILE\n".
                   1079: #		"$source $target $categoryname $description $note " .
                   1080: #		"$build $status $dependencies" .
                   1081: #		"\nEND FILE");
1.3       harris41 1082: 	}
1.5       harris41 1083: 	elsif ($mode eq 'install' && $categoryname ne 'conf') {
1.14      harris41 1084: 	    if ($build) {
                   1085: 		my $bi=$sourceroot.'/'.$source.';'.$build.';'.
                   1086: 		    $dependencies;
                   1087: 		my ($source2,$command,$trigger,@deps)=split(/\;/,$bi);
                   1088: 		$tword=''; $tword=' alwaysrun' if $trigger eq 'always run'; 
                   1089: 		$command=~s/\/([^\/]*)$//;
                   1090: 		$command2="cd $command; sh ./$1;\\";
                   1091: 		my $depstring;
                   1092: 		foreach my $dep (@deps) {
                   1093: 		    $depstring.=<<END;
                   1094: 		ECODE=0; DEP=''; \\
1.19      harris41 1095: 		test -e $command/$dep || (echo '**** WARNING **** cannot evaluate status of dependency $command/$dep (for building ${sourceroot}/${source} with)'$logcmd); DEP="1"; \\
1.18      harris41 1096: 		[ -n DEP ] && { perl filecompare.pl -b2 $command/$dep ${targetroot}/${target} || ECODE=\$\$?; } || DEP="1"; \\
1.14      harris41 1097: 		case "\$\$ECODE" in \\
1.19      harris41 1098: 			2) echo "**** WARNING **** dependency $command/$dep is newer than target file ${targetroot}/${target}; you may want to run make build"$logcmd;; \\
1.14      harris41 1099: 		esac; \\
                   1100: END
                   1101: 		}
                   1102:                 chomp $depstring;
                   1103: 		$buildtest=<<END;
                   1104: 	\@if !(test -e "${sourceroot}/${source}") && !(test -e "${targetroot}/${target}"); then \\
1.19      harris41 1105: 		echo "**** ERROR **** ${sourceroot}/${source} is missing and is also not present at target location ${targetroot}/${target}; you must run make build"$logcmd; exit; \\
1.14      harris41 1106: END
                   1107:                 $buildtest.=<<END if $depstring;
                   1108: 	elif !(test -e "${sourceroot}/${source}"); then \\
                   1109: $depstring
                   1110: END
                   1111:                 $buildtest.=<<END;
                   1112: 	fi
                   1113: END
                   1114: 	    }
1.18      harris41 1115:             my $bflag='-b1';
                   1116:             $bflag='-b3' if $dependencies or $buildlink;
1.14      harris41 1117: 	    return <<END;
1.19      harris41 1118: $buildtest	\@if !(test -e "${sourceroot}/${source}") && !(test -e "${targetroot}/${target}"); then \\
                   1119: 		echo "**** ERROR **** CVS source file does not exist: ${sourceroot}/${source} and neither does target: ${targetroot}/${target}"$logcmd; \\
                   1120: 	elif !(test -e "${sourceroot}/${source}"); then \\
                   1121: 		echo "**** WARNING **** CVS source file does not exist: ${sourceroot}/${source}"$logcmd; \\
1.21      harris41 1122: 		perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
1.14      harris41 1123: 	else \\
                   1124: 		ECODE=0; \\
                   1125: 		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\
                   1126: 		case "\$\$ECODE" in \\
                   1127: 			1) echo "${targetroot}/${target} is unchanged";; \\
1.21      harris41 1128: 			2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; saving current (old) target file to ${targetroot}/${target}.lpmlsave and then overwriting"$logcmd && install -o www -g www -m 0600 ${targetroot}/${target} ${targetroot}/${target}.lpmlsave && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
1.27      harris41 1129: 			0) echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
1.14      harris41 1130: 		esac; \\
1.21      harris41 1131: 		perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
1.14      harris41 1132: 	fi
                   1133: END
1.12      harris41 1134: 	}
                   1135: 	elsif ($mode eq 'configinstall' && $categoryname eq 'conf') {
                   1136: 	    push @configall,$targetroot.'/'.$target;
1.14      harris41 1137: 	    return $targetroot.'/'.$target.': alwaysrun'."\n".
1.20      harris41 1138: 		"\t".'@echo -n ""; ECODE=0 && { perl filecompare.pl -b4 '.
                   1139: 		$sourceroot.'/'.$source.' '.$targetroot.'/'.$target.
                   1140: 		' || ECODE=$$?; } && '.
                   1141: 		'{ [ $$ECODE != "2" ] || (install '.
                   1142:                 $categoryhash{$categoryname}.' '.
1.12      harris41 1143: 		$sourceroot.'/'.$source.' '.
1.21      harris41 1144: 		$targetroot.'/'.$target.'.lpmlnew'.
1.19      harris41 1145: 		' && echo "**** NOTE: CONFIGURATION FILE CHANGE ****"'.
                   1146: 		$logcmd.' && echo "'.
1.14      harris41 1147: 		'You likely need to compare contents of '.
                   1148: 		''.$targetroot.'/'.$target.' with the new '.
1.21      harris41 1149:                 ''.$targetroot.'/'.$target.'.lpmlnew"'.
1.20      harris41 1150: 		"$logcmd); } && ".
                   1151: 		'{ [ $$ECODE != "3" ] || (install '.
                   1152:                 $categoryhash{$categoryname}.' '.
                   1153: 		$sourceroot.'/'.$source.' '.
                   1154: 		$targetroot.'/'.$target.''.
                   1155: 		' && echo "**** WARNING: NEW CONFIGURATION FILE ADDED ****"'.
                   1156: 		$logcmd.' && echo "'.
                   1157: 		'You likely need to review the contents of '.
                   1158: 		''.$targetroot.'/'.$target.' to make sure its '.
                   1159:                 'settings are compatible with your overall system"'.
                   1160: 		"$logcmd); } && ".
                   1161: 		'{ [ $$ECODE != "1" ] || ('.
                   1162: 		'echo "**** ERROR ****"'.
                   1163: 		$logcmd.' && echo "'.
                   1164: 		'Configuration source file does not exist '.
                   1165: 		''.$sourceroot.'/'.$source.'"'.
1.22      harris41 1166: 		"$logcmd); } && perl verifymodown.pl ${targetroot}/${target} \"$categoryhash{$categoryname}\"$logcmd;\n\n";
1.4       harris41 1167: 	}
1.11      harris41 1168: 	elsif ($mode eq 'build' && $build) {
                   1169: 	    push @buildall,$sourceroot.'/'.$source;
1.14      harris41 1170: 	    push @buildinfo,$targetroot.'/'.$target.';'.$sourceroot.'/'.
                   1171: 		$source.';'.$build.';'.
1.11      harris41 1172: 		$dependencies;
                   1173: #	    return '# need to build '.$source.";
                   1174: 	}
1.3       harris41 1175: 	else {
                   1176: 	    return '';
                   1177: 	}
                   1178:     }
                   1179:     return '';
                   1180: }
                   1181: # --------------------------------------------------------- Format link section
                   1182: sub format_link {
                   1183:     my @tokeninfo=@_;
1.27      harris41 1184:     $link=''; $linkto=''; $source=''; $target=''; $categoryname=''; 
                   1185:     $description=''; $note=''; $build=''; $status=''; $dependencies='';
1.3       harris41 1186:     my $text=&trim($parser->get_text('/link'));
1.29      harris41 1187:     my @links;
1.3       harris41 1188:     if ($linkto) {
                   1189: 	$parser->get_tag('/link');
                   1190: 	if ($mode eq 'html') {
1.27      harris41 1191: 	    my @targets=map {s/^\s*//;s/\s$//;$_} split(/\;/,$target);
1.29      harris41 1192: 	    $link_count+=scalar(@targets);
1.27      harris41 1193: 	    foreach my $tgt (@targets) {
1.29      harris41 1194: 		$categorycount{$categoryname}++;
1.27      harris41 1195: 		push @links,("\n<!-- FILESORT:$tgt -->".
                   1196: 		    "<tr>".
1.29      harris41 1197: 		    "<td><!-- POSTEVAL verify.pl link ".
1.28      harris41 1198: 		    "'/$targetrootarg$linkto' '/$targetrootarg$tgt' ".
                   1199: 		    "$categoryhash{$categoryname} -->&nbsp;</td><td>".
1.27      harris41 1200: 		    "<img src='$fab{$categoryname}.gif' ".
                   1201: 		    "alt='$categoryname icon' /></td>".
                   1202: 		    "<td><font size='-1'>$categoryname</font></td>".
                   1203: 		    "<td>LINKTO: $linkto<br />TARGET: $tgt</td>".
                   1204: 		    "<td>$description</td>".
                   1205: 		    "<td>$note</td>".
                   1206: 		    "</tr>");
                   1207: #		push @links,"\t".'ln -fs /'.$linkto.' /'.$targetroot.$tgt.
                   1208: #		    "\n";
                   1209: 	    }
                   1210: 	    return join('',@links);
                   1211: #	    return ($link="\n<!-- FILESORT:$target -->".
                   1212: #		    "<tr>".
                   1213: #		    "<td>&nbsp;</td><td><img src='$fab{$categoryname}.gif' ".
                   1214: #		    "alt='$categoryname icon' /></td>".
                   1215: #		    "<td>$categoryname</td>".
                   1216: #		    "<td>LINKTO: $linkto<br />TARGET: $target</td>".
                   1217: #		    "<td>$description</td>".
                   1218: #		    "<td>$note</td>".
                   1219: #		    "</tr>");
                   1220: #	    return $link="\n<tr><td colspan='6'>BEGIN LINK\n".
                   1221: #		"$linkto $target $categoryname $description $note " .
                   1222: #		"$build $status $dependencies" .
                   1223: #		    "\nEND LINK</td></tr>";
1.4       harris41 1224: 	}
                   1225: 	elsif ($mode eq 'install') {
1.10      harris41 1226: 	    my @targets=map {s/^\s*//;s/\s$//;$_} split(/\;/,$target);
1.5       harris41 1227: 	    foreach my $tgt (@targets) {
                   1228: 		push @links,"\t".'ln -fs /'.$linkto.' /'.$targetroot.$tgt.
                   1229: 		    "\n";
                   1230: 	    }
1.4       harris41 1231: 	    return '';
1.3       harris41 1232: 	}
                   1233: 	else {
                   1234: 	    return '';
                   1235: 	}
                   1236:     }
                   1237:     return '';
                   1238: }
                   1239: # ----------------------------------------------------- Format fileglob section
                   1240: sub format_fileglob {
                   1241:     my @tokeninfo=@_;
                   1242:     $fileglob=''; $glob=''; $sourcedir='';
                   1243:     $targetdir=''; $categoryname=''; $description='';
                   1244:     $note=''; $build=''; $status=''; $dependencies='';
                   1245:     $filenames='';
                   1246:     my $text=&trim($parser->get_text('/fileglob'));
1.27      harris41 1247:     my $filenames2=$filenames;$filenames2=~s/\s//g;
1.29      harris41 1248:     $fileglob_count++;
                   1249:     my @semi=($filenames2=~/(\;)/g);
                   1250:     $fileglobnames_count+=scalar(@semi)+1;
                   1251:     $categorycount{$categoryname}+=scalar(@semi)+1;
                   1252:     # START TEMP WAY
                   1253: #    for my $f (split(/\;/,$filenames2)) {
                   1254: #	if (-T "$sourcerootarg/$sourcedir/$f") {
                   1255: #	    $linecount{$categoryname}+=`wc -l $sourcerootarg/$sourcedir/$f`;
                   1256: #	    open OUT,">>/tmp/junk123";
                   1257: #	    print OUT "$linecount{$categoryname} $categoryname $sourcerootarg/$sourcedir/$f\n";
                   1258: #	    close OUT;
                   1259: #	}
                   1260: #	my $bytesize=(-s "$sourcerootarg/$sourcedir/$f");
                   1261: #	$bytecount{$categoryname}+=$bytesize;
                   1262: #    }
                   1263:     # END TEMP WAY
1.3       harris41 1264:     if ($sourcedir) {
                   1265: 	$parser->get_tag('/fileglob');
                   1266: 	if ($mode eq 'html') {
1.27      harris41 1267: 	    return $fileglob="\n<tr>".
1.29      harris41 1268: 		"<td><!-- POSTEVAL verify.pl fileglob '$sourcerootarg' ".
1.27      harris41 1269: 		"'$targetrootarg' ".
                   1270: 		"'$glob' '$sourcedir' '$filenames2' '$targetdir' ".
                   1271: 		"$categoryhash{$categoryname} -->&nbsp;</td>".
                   1272: 		"<td>"."<img src='$fab{$categoryname}.gif' ".
                   1273: 	        "alt='$categoryname icon' /></td>".
                   1274: 		"<td>$categoryname<br />".
                   1275: 		"<font size='-1'>".$categoryhash{$categoryname}."</font></td>".
                   1276: 		"<td>SOURCEDIR: $sourcedir<br />".
                   1277: 		"TARGETDIR: $targetdir<br />".
                   1278:                 "GLOB: $glob<br />".
                   1279:                 "FILENAMES: $filenames".
                   1280: 		"</td>".
                   1281: 		"<td>$description</td>".
                   1282: 		"<td>$note</td>".
                   1283: 		"</tr>";
                   1284: #	    return $fileglob="\n<tr><td colspan='6'>BEGIN FILEGLOB\n".
                   1285: #		"$glob sourcedir $targetdir $categoryname $description $note ".
                   1286: #		"$build $status $dependencies $filenames" .
                   1287: #		"\nEND FILEGLOB</td></tr>";
1.3       harris41 1288: 	}
1.5       harris41 1289: 	elsif ($mode eq 'install') {
1.30      harris41 1290: 	    my $eglob=$glob;
                   1291: 	    if ($glob eq '*') {
                   1292: 		$eglob='[^C][^V][^S]'.$glob;
                   1293: 	    }
1.5       harris41 1294: 	    return "\t".'install '.
                   1295: 		$categoryhash{$categoryname}.' '.
1.30      harris41 1296: 		$sourceroot.'/'.$sourcedir.$eglob.' '.
1.5       harris41 1297: 		$targetroot.'/'.$targetdir.'.'."\n";
                   1298: 	}
1.3       harris41 1299: 	else {
                   1300: 	    return '';
                   1301: 	}
                   1302:     }
                   1303:     return '';
                   1304: }
                   1305: # ---------------------------------------------------- Format sourcedir section
                   1306: sub format_sourcedir {
                   1307:     my @tokeninfo=@_;
                   1308:     $sourcedir='';
                   1309:     my $text=&trim($parser->get_text('/sourcedir'));
                   1310:     if ($text) {
                   1311: 	$parser->get_tag('/sourcedir');
                   1312: 	$sourcedir=$text;
                   1313:     }
                   1314:     return '';
                   1315: }
                   1316: # ------------------------------------------------------- Format target section
                   1317: sub format_target {
                   1318:     my @tokeninfo=@_;
                   1319:     $target='';
                   1320:     my $text=&trim($parser->get_text('/target'));
                   1321:     if ($text) {
                   1322: 	$parser->get_tag('/target');
                   1323: 	$target=$text;
                   1324:     }
                   1325:     return '';
                   1326: }
                   1327: # ------------------------------------------------------- Format source section
                   1328: sub format_source {
                   1329:     my @tokeninfo=@_;
                   1330:     $source='';
                   1331:     my $text=&trim($parser->get_text('/source'));
                   1332:     if ($text) {
                   1333: 	$parser->get_tag('/source');
                   1334: 	$source=$text;
                   1335:     }
                   1336:     return '';
                   1337: }
                   1338: # --------------------------------------------------------- Format note section
                   1339: sub format_note {
                   1340:     my @tokeninfo=@_;
                   1341:     $note='';
1.26      harris41 1342: #    my $text=&trim($parser->get_text('/note'));
                   1343:     my $aref;
                   1344:     my $text;
                   1345:     while ($aref=$parser->get_token()) {
                   1346: 	if ($aref->[0] eq 'E' && $aref->[1] eq 'note') {
                   1347: 	    last;
                   1348: 	}
                   1349: 	elsif ($aref->[0] eq 'S') {
                   1350: 	    $text.=$aref->[4];
                   1351: 	}
                   1352: 	elsif ($aref->[0] eq 'E') {
                   1353: 	    $text.=$aref->[2];
                   1354: 	}
                   1355: 	else {
                   1356: 	    $text.=$aref->[1];
                   1357: 	}
                   1358:     }
1.3       harris41 1359:     if ($text) {
1.26      harris41 1360: #	$parser->get_tag('/note');
1.3       harris41 1361: 	$note=$text;
                   1362:     }
                   1363:     return '';
                   1364: 
                   1365: }
                   1366: # -------------------------------------------------------- Format build section
                   1367: sub format_build {
                   1368:     my @tokeninfo=@_;
                   1369:     $build='';
                   1370:     my $text=&trim($parser->get_text('/build'));
                   1371:     if ($text) {
                   1372: 	$parser->get_tag('/build');
1.11      harris41 1373: 	$build=$sourceroot.'/'.$text.';'.$tokeninfo[2]{'trigger'};
1.3       harris41 1374:     }
                   1375:     return '';
                   1376: }
1.14      harris41 1377: # -------------------------------------------------------- Format build section
                   1378: sub format_buildlink {
                   1379:     my @tokeninfo=@_;
                   1380:     $buildlink='';
                   1381:     my $text=&trim($parser->get_text('/buildlink'));
                   1382:     if ($text) {
                   1383: 	$parser->get_tag('/buildlink');
                   1384: 	$buildlink=$sourceroot.'/'.$text;
                   1385:     }
                   1386:     return '';
                   1387: }
1.3       harris41 1388: # ------------------------------------------------------- Format status section
                   1389: sub format_status {
                   1390:     my @tokeninfo=@_;
                   1391:     $status='';
                   1392:     my $text=&trim($parser->get_text('/status'));
                   1393:     if ($text) {
                   1394: 	$parser->get_tag('/status');
                   1395: 	$status=$text;
                   1396:     }
                   1397:     return '';
                   1398: }
                   1399: # ------------------------------------------------- Format dependencies section
                   1400: sub format_dependencies {
                   1401:     my @tokeninfo=@_;
                   1402:     $dependencies='';
                   1403:     my $text=&trim($parser->get_text('/dependencies'));
                   1404:     if ($text) {
                   1405: 	$parser->get_tag('/dependencies');
1.11      harris41 1406: 	$dependencies=join(';',
                   1407: 			      (map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)));
1.3       harris41 1408:     }
                   1409:     return '';
                   1410: }
                   1411: # --------------------------------------------------------- Format glob section
                   1412: sub format_glob {
                   1413:     my @tokeninfo=@_;
                   1414:     $glob='';
                   1415:     my $text=&trim($parser->get_text('/glob'));
                   1416:     if ($text) {
                   1417: 	$parser->get_tag('/glob');
                   1418: 	$glob=$text;
                   1419:     }
                   1420:     return '';
                   1421: }
                   1422: # ---------------------------------------------------- Format filenames section
                   1423: sub format_filenames {
                   1424:     my @tokeninfo=@_;
                   1425:     my $text=&trim($parser->get_text('/filenames'));
                   1426:     if ($text) {
                   1427: 	$parser->get_tag('/filenames');
                   1428: 	$filenames=$text;
                   1429:     }
1.31    ! harris41 1430:     return '';
        !          1431: }
        !          1432: # ------------------------------------------------ Format specialnotice section
        !          1433: sub format_specialnotices {
        !          1434:     $parser->get_tag('/specialnotices');
        !          1435:     return '';
        !          1436: }
        !          1437: # ------------------------------------------------ Format specialnotice section
        !          1438: sub format_specialnotice {
        !          1439:     $parser->get_tag('/specialnotice');
1.3       harris41 1440:     return '';
                   1441: }
                   1442: # ------------------------------------------------------- Format linkto section
                   1443: sub format_linkto {
                   1444:     my @tokeninfo=@_;
                   1445:     my $text=&trim($parser->get_text('/linkto'));
                   1446:     if ($text) {
                   1447: 	$parser->get_tag('/linkto');
                   1448: 	$linkto=$text;
                   1449:     }
                   1450:     return '';
1.10      harris41 1451: }
                   1452: # ------------------------------------- Render less-than and greater-than signs
                   1453: sub htmlsafe {
                   1454:     my $text=@_[0];
                   1455:     $text =~ s/</&lt;/g;
                   1456:     $text =~ s/>/&gt;/g;
                   1457:     return $text;
1.3       harris41 1458: }
                   1459: # --------------------------------------- remove starting and ending whitespace
                   1460: sub trim {
                   1461:     my ($s)=@_; $s=~s/^\s*//; $s=~s/\s*$//; return $s;
                   1462: } 
1.14      harris41 1463: 
                   1464: # ----------------------------------- POD (plain old documentation, CPAN style)
1.18      harris41 1465: 
                   1466: =head1 NAME
                   1467: 
                   1468: lpml_parse.pl - This is meant to parse files meeting the lpml document type.
                   1469: See lpml.dtd.  LPML=Linux Packaging Markup Language.
                   1470: 
                   1471: =head1 SYNOPSIS
                   1472: 
                   1473: Usage is for lpml file to come in through standard input.
                   1474: 
                   1475: =over 4
                   1476: 
                   1477: =item *
                   1478: 
                   1479: 1st argument is the mode of parsing.
                   1480: 
                   1481: =item * 
                   1482: 
                   1483: 2nd argument is the category permissions to use (runtime or development)
                   1484: 
                   1485: =item *
                   1486: 
                   1487: 3rd argument is the distribution
                   1488: (default,redhat6.2,debian2.2,redhat7.1,etc).
                   1489: 
                   1490: =item *
                   1491: 
                   1492: 4th argument is to manually specify a sourceroot.
                   1493: 
                   1494: =item *
                   1495: 
                   1496: 5th argument is to manually specify a targetroot.
                   1497: 
                   1498: =back
                   1499: 
                   1500: Only the 1st argument is mandatory for the program to run.
                   1501: 
                   1502: Example:
                   1503: 
                   1504: cat ../../doc/loncapafiles.lpml |\\
                   1505: perl lpml_parse.pl html default /home/sherbert/loncapa /tmp/install
                   1506: 
                   1507: =head1 DESCRIPTION
                   1508: 
                   1509: I am using a multiple pass-through approach to parsing
                   1510: the lpml file.  This saves memory and makes sure the server
                   1511: will never be overloaded.
                   1512: 
                   1513: =head1 README
                   1514: 
                   1515: I am using a multiple pass-through approach to parsing
                   1516: the lpml file.  This saves memory and makes sure the server
                   1517: will never be overloaded.
                   1518: 
                   1519: =head1 PREREQUISITES
                   1520: 
                   1521: HTML::TokeParser
                   1522: 
                   1523: =head1 COREQUISITES
                   1524: 
                   1525: =head1 OSNAMES
                   1526: 
                   1527: linux
                   1528: 
                   1529: =head1 SCRIPT CATEGORIES
                   1530: 
                   1531: Packaging/Administrative
                   1532: 
                   1533: =cut

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