--- loncom/build/lpml_parse.pl 2001/11/17 18:35:21 1.19 +++ loncom/build/lpml_parse.pl 2001/11/29 19:00:56 1.24 @@ -6,9 +6,9 @@ # 06/19/2001,06/20,06/24 - Scott Harrison # 9/5/2001,9/6,9/7,9/8 - Scott Harrison # 9/17,9/18 - Scott Harrison -# 11/4,11/5,11/6,11/7,11/16 - Scott Harrison +# 11/4,11/5,11/6,11/7,11/16,11/17 - Scott Harrison # -# $Id: lpml_parse.pl,v 1.19 2001/11/17 18:35:21 harris41 Exp $ +# $Id: lpml_parse.pl,v 1.24 2001/11/29 19:00:56 harris41 Exp $ ### ############################################################################### @@ -317,7 +317,7 @@ exit; # ------------------------ Final output at end of markup parsing and formatting sub end { if ($mode eq 'html') { - return "
THE END\n"; + return "\n"; } if ($mode eq 'install') { return ''; @@ -336,7 +336,55 @@ sub format_lpml { my (@tokeninfo)=@_; my $date=`date`; chop $date; if ($mode eq 'html') { - $lpml = "
LPML BEGINNING: $date"; + $lpml=< + +LPML Description Page (dist=$dist, $date) + + +END + $lpml .= "
LPML Description Page (dist=$dist, ". + "$date)". + ""; + $lpml .=< +
  • About this file
  • +
  • File Type Ownership and Permissions +Descriptions
  • +
  • Software Package Description
  • +
  • Directory Structure
  • +
  • File and Directory Structure
  • + +END + $lpml .=< 
    +About this file +

    +This file is generated dynamically by lpml_parse.pl as +part of a development compilation process. Author: Scott +Harrison (harris41\@msu.edu). +

    +END + } + elsif ($mode eq 'text') { + $lpml = "LPML Description Page (dist=$dist, $date)"; + $lpml .=<get_text('/categories')); $parser->get_tag('/categories'); if ($mode eq 'html') { - return $categories="\n
    BEGIN CATEGORIES\n$text\n". - "
    END CATEGORIES\n"; + return $categories="\n
     
    ". + "\n
    ". + "\nFile Type Ownership and Permissions". + " Descriptions". + "\n\n". + "
    \n$text\n". + "
    \n"; + } + elsif ($mode eq 'text') { + return $categories="\n". + "\nFile Type Ownership and Permissions". + " Descriptions". + "\n"; } else { return ''; @@ -456,7 +515,24 @@ sub format_rpm { my $text=&trim($parser->get_text('/rpm')); $parser->get_tag('/rpm'); if ($mode eq 'html') { - return $rpm="\n
    BEGIN RPM\n$text\n
    END RPM"; + return $rpm=< 
    +
    +Software Package Description +

    + + +
    +$text
    +
    +END + } + elsif ($mode eq 'text') { + return $rpm=<get_text('/rpmSummary')); $parser->get_tag('/rpmSummary'); if ($mode eq 'html') { - return $rpmSummary="\n
    RPMSUMMARY $text"; + return $rpmSummary="\nSummary : $text"; + } + elsif ($mode eq 'text') { + return $rpmSummary="\nSummary : $text"; } else { return ''; @@ -478,7 +557,10 @@ sub format_rpmName { my $text=&trim($parser->get_text('/rpmName')); $parser->get_tag('/rpmName'); if ($mode eq 'html') { - return $rpmName="\n
    RPMNAME $text"; + return $rpmName="\nName : $text"; + } + elsif ($mode eq 'text') { + return $rpmName="\nName : $text"; } else { return ''; @@ -489,7 +571,10 @@ sub format_rpmVersion { my $text=$parser->get_text('/rpmVersion'); $parser->get_tag('/rpmVersion'); if ($mode eq 'html') { - return $rpmVersion="\n
    RPMVERSION $text"; + return $rpmVersion="\nVersion : $text"; + } + elsif ($mode eq 'text') { + return $rpmVersion="\nVersion : $text"; } else { return ''; @@ -500,7 +585,10 @@ sub format_rpmRelease { my $text=$parser->get_text('/rpmRelease'); $parser->get_tag('/rpmRelease'); if ($mode eq 'html') { - return $rpmRelease="\n
    RPMRELEASE $text"; + return $rpmRelease="\nRelease : $text"; + } + elsif ($mode eq 'text') { + return $rpmRelease="\nRelease : $text"; } else { return ''; @@ -511,7 +599,10 @@ sub format_rpmVendor { my $text=$parser->get_text('/rpmVendor'); $parser->get_tag('/rpmVendor'); if ($mode eq 'html') { - return $rpmVendor="\n
    RPMVENDOR $text"; + return $rpmVendor="\nVendor : $text"; + } + elsif ($mode eq 'text') { + return $rpmVendor="\nVendor : $text"; } else { return ''; @@ -522,7 +613,10 @@ sub format_rpmBuildRoot { my $text=$parser->get_text('/rpmBuildRoot'); $parser->get_tag('/rpmBuildRoot'); if ($mode eq 'html') { - return $rpmBuildRoot="\n
    RPMBUILDROOT $text"; + return $rpmBuildRoot="\nBuild Root : $text"; + } + elsif ($mode eq 'text') { + return $rpmBuildRoot="\nBuild Root : $text"; } else { return ''; @@ -533,7 +627,10 @@ sub format_rpmCopyright { my $text=$parser->get_text('/rpmCopyright'); $parser->get_tag('/rpmCopyright'); if ($mode eq 'html') { - return $rpmCopyright="\n
    RPMCOPYRIGHT $text"; + return $rpmCopyright="\nLicense : $text"; + } + elsif ($mode eq 'text') { + return $rpmCopyright="\nLicense : $text"; } else { return ''; @@ -544,7 +641,10 @@ sub format_rpmGroup { my $text=$parser->get_text('/rpmGroup'); $parser->get_tag('/rpmGroup'); if ($mode eq 'html') { - return $rpmGroup="\n
    RPMGROUP $text"; + return $rpmGroup="\nGroup : $text"; + } + elsif ($mode eq 'text') { + return $rpmGroup="\nGroup : $text"; } else { return ''; @@ -555,7 +655,10 @@ sub format_rpmSource { my $text=$parser->get_text('/rpmSource'); $parser->get_tag('/rpmSource'); if ($mode eq 'html') { - return $rpmSource="\n
    RPMSOURCE $text"; + return $rpmSource="\nSource : $text"; + } + elsif ($mode eq 'text') { + return $rpmSource="\nSource : $text"; } else { return ''; @@ -566,7 +669,10 @@ sub format_rpmAutoReqProv { my $text=$parser->get_text('/rpmAutoReqProv'); $parser->get_tag('/rpmAutoReqProv'); if ($mode eq 'html') { - return $rpmAutoReqProv="\n
    RPMAUTOREQPROV $text"; + return $rpmAutoReqProv="\nAutoReqProv : $text"; + } + if ($mode eq 'text') { + return $rpmAutoReqProv="\nAutoReqProv : $text"; } else { return ''; @@ -576,8 +682,13 @@ sub format_rpmAutoReqProv { sub format_rpmdescription { my $text=$parser->get_text('/rpmdescription'); $parser->get_tag('/rpmdescription'); + $text=~s/\n//g; + $text=~s/\\n/\n/g; if ($mode eq 'html') { - return $rpmdescription="\n
    RPMDESCRIPTION $text"; + return $rpmdescription="\nDescription : $text"; + } + elsif ($mode eq 'text') { + return $rpmdescription="\nDescription : $text"; } else { return ''; @@ -588,7 +699,8 @@ sub format_rpmpre { my $text=$parser->get_text('/rpmpre'); $parser->get_tag('/rpmpre'); if ($mode eq 'html') { - return $rpmpre="\n
    RPMPRE $text"; +# return $rpmpre="\n
    RPMPRE $text"; + return ''; } else { return ''; @@ -599,8 +711,15 @@ sub format_directories { my $text=$parser->get_text('/directories'); $parser->get_tag('/directories'); if ($mode eq 'html') { - return $directories="\n
    BEGIN DIRECTORIES\n$text\n
    ". - "END DIRECTORIES\n"; + return $directories="\n
     
    ". + "
    ". + "Directory Structure". + "\n$text\n
    ". + "\n"; + } + elsif ($mode eq 'text') { + return $directories="\nDirectory Structure\n$text\n". + "\n"; } elsif ($mode eq 'install') { return "\n".'directories:'."\n".$text; @@ -665,7 +784,17 @@ sub format_files { my $text=$parser->get_text('/files'); $parser->get_tag('/files'); if ($mode eq 'html') { - return $directories="\n
    BEGIN FILES\n$text\n
    END FILES\n"; + return $directories="\n
     
    ". + "
    ". + "File and Directory Structure". + "\n$text\n
    ". + "\n"; + } + elsif ($mode eq 'text') { + return $directories="\n". + "File and Directory Structure". + "\n$text\n". + "\n"; } elsif ($mode eq 'install') { return "\n".'files:'."\n".$text. @@ -799,14 +928,16 @@ $buildtest \@if !(test -e "${sourceroot} echo "**** ERROR **** CVS source file does not exist: ${sourceroot}/${source} and neither does target: ${targetroot}/${target}"$logcmd; \\ elif !(test -e "${sourceroot}/${source}"); then \\ echo "**** WARNING **** CVS source file does not exist: ${sourceroot}/${source}"$logcmd; \\ + perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\ else \\ ECODE=0; \\ perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\ case "\$\$ECODE" in \\ 1) echo "${targetroot}/${target} is unchanged";; \\ - 2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; creating ${targetroot}/${target}.lpmlnewfile instead"$logcmd && install -o www -g www -m 0500 ${sourceroot}/${source} ${targetroot}/${target}.lpmlnewfile;; \\ - 0) echo "install -o www -g www -m 0500 ${sourceroot}/${source} ${targetroot}/${target}" && install -o www -g www -m 0500 ${sourceroot}/${source} ${targetroot}/${target};; \\ + 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};; \\ + 0) echo "install $categoryhash{$categorname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\ esac; \\ + perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\ fi END # return "\t".'@test -e '.$sourceroot.'/'.$source. @@ -823,15 +954,35 @@ END elsif ($mode eq 'configinstall' && $categoryname eq 'conf') { push @configall,$targetroot.'/'.$target; return $targetroot.'/'.$target.': alwaysrun'."\n". - "\t".'@echo -n ""; ECODE=0 && { perl filecompare.pl -b4 '.$sourceroot.'/'.$source.' '.$targetroot.'/'.$target.' || ECODE=$$?; } && { [ $$ECODE != "2" ] || (install '.$categoryhash{$categoryname}.' '. + "\t".'@echo -n ""; ECODE=0 && { perl filecompare.pl -b4 '. + $sourceroot.'/'.$source.' '.$targetroot.'/'.$target. + ' || ECODE=$$?; } && '. + '{ [ $$ECODE != "2" ] || (install '. + $categoryhash{$categoryname}.' '. $sourceroot.'/'.$source.' '. - $targetroot.'/'.$target.'.lpmlnewconf'. + $targetroot.'/'.$target.'.lpmlnew'. ' && echo "**** NOTE: CONFIGURATION FILE CHANGE ****"'. $logcmd.' && echo "'. 'You likely need to compare contents of '. ''.$targetroot.'/'.$target.' with the new '. - ''.$targetroot.'/'.$target.'.lpmlnewconf"'. - "$logcmd); };\n\n"; + ''.$targetroot.'/'.$target.'.lpmlnew"'. + "$logcmd); } && ". + '{ [ $$ECODE != "3" ] || (install '. + $categoryhash{$categoryname}.' '. + $sourceroot.'/'.$source.' '. + $targetroot.'/'.$target.''. + ' && echo "**** WARNING: NEW CONFIGURATION FILE ADDED ****"'. + $logcmd.' && echo "'. + 'You likely need to review the contents of '. + ''.$targetroot.'/'.$target.' to make sure its '. + 'settings are compatible with your overall system"'. + "$logcmd); } && ". + '{ [ $$ECODE != "1" ] || ('. + 'echo "**** ERROR ****"'. + $logcmd.' && echo "'. + 'Configuration source file does not exist '. + ''.$sourceroot.'/'.$source.'"'. + "$logcmd); } && perl verifymodown.pl ${targetroot}/${target} \"$categoryhash{$categoryname}\"$logcmd;\n\n"; } elsif ($mode eq 'build' && $build) { push @buildall,$sourceroot.'/'.$source;