Diff for /loncom/build/lpml_parse.pl between versions 1.4 and 1.8

version 1.4, 2001/09/07 16:49:18 version 1.8, 2001/09/08 22:51:26
Line 4 Line 4
 # YEAR=2001  # YEAR=2001
 # May 2001  # May 2001
 # 06/19/2001,06/20,06/24 - Scott Harrison  # 06/19/2001,06/20,06/24 - Scott Harrison
 # 9/5/2001,9/6 - Scott Harrison  # 9/5/2001,9/6,9/7,9/8 - Scott Harrison
   
 ###############################################################################  ###############################################################################
 ##                                                                           ##  ##                                                                           ##
Line 79  if (@ARGV) { Line 79  if (@ARGV) {
 $sourceroot=~s/\/$//;  $sourceroot=~s/\/$//;
 $targetroot=~s/\/$//;  $targetroot=~s/\/$//;
   
   my $invocation;
   # --------------------------------------------------- Record program invocation
   if ($mode eq 'install') {
       $invocation=(<<END);
   # Invocation: STDINPUT | lpml_parse.pl
   #             1st argument (mode) is: $mode
   #             2nd argument (category type) is: $categorytype
   #             3rd argument (distribution) is: $dist
   #             4th argument (targetroot) is: described below
   #             5th argument (sourceroot) is: described below
   END
   }
   
 # ---------------------------------------------------- Start first pass through  # ---------------------------------------------------- Start first pass through
 my @parsecontents = <>;  my @parsecontents = <>;
 my $parsestring = join('',@parsecontents);  my $parsestring = join('',@parsecontents);
Line 309  sub format_lpml { Line 322  sub format_lpml {
  print '# LPML install targets. Linux Packaging Markup Language,';   print '# LPML install targets. Linux Packaging Markup Language,';
  print ' by Scott Harrison 2001'."\n";   print ' by Scott Harrison 2001'."\n";
  print '# This file was automatically generated on '.`date`;   print '# This file was automatically generated on '.`date`;
    print "\n".$invocation;
     }      }
     else {      else {
  return '';   return '';
Line 566  sub format_directory { Line 580  sub format_directory {
     }      }
     elsif ($mode eq 'install') {      elsif ($mode eq 'install') {
  return "\t".'install '.$categoryhash{$categoryname}.' -d '.   return "\t".'install '.$categoryhash{$categoryname}.' -d '.
     $targetroot.$targetdir."\n";      $targetroot.'/'.$targetdir."\n";
     }      }
     else {      else {
  return '';   return '';
Line 653  sub format_file { Line 667  sub format_file {
  "$build $status $dependencies" .   "$build $status $dependencies" .
  "\nEND FILE");   "\nEND FILE");
  }   }
  elsif ($mode eq 'install') {   elsif ($mode eq 'install' && $categoryname ne 'conf') {
     return "\t".'@test -e '.$sourceroot.$source.      return "\t".'@test -e '.$sourceroot.'/'.$source.
  '/loncom/html/index.html && install '.   ' && install '.
  $categoryhash{$categoryname}.' '.   $categoryhash{$categoryname}.' '.
  $sourceroot.$source.'/loncom/html/index.html '.   $sourceroot.'/'.$source.' '.
  $targetroot.$target.   $targetroot.'/'.$target.
  '/home/httpd/html/index.html || echo "**** LON-CAPA WARNING '.   ' || echo "**** LON-CAPA WARNING '.
  '**** CVS source file does not exist: '.$sourceroot.$source.   '**** CVS source file does not exist: '.$sourceroot.'/'.
         '/loncom/html/index.html"'."\n";   $source.'"'."\n";
  }   }
  else {   else {
     return '';      return '';
Line 684  sub format_link { Line 698  sub format_link {
     "\nEND LINK";      "\nEND LINK";
  }   }
  elsif ($mode eq 'install') {   elsif ($mode eq 'install') {
     push @links,"\t".'ln -s /'.$linkto.' /'.$targetroot.$target.' '.      my @targets=split(/\;/,$target);
  $categoryname."\n";      foreach my $tgt (@targets) {
    push @links,"\t".'ln -fs /'.$linkto.' /'.$targetroot.$tgt.
       "\n";
       }
     return '';      return '';
  }   }
  else {   else {
Line 710  sub format_fileglob { Line 727  sub format_fileglob {
  "$build $status $dependencies $filenames" .   "$build $status $dependencies $filenames" .
     "\nEND FILEGLOB";      "\nEND FILEGLOB";
  }   }
    elsif ($mode eq 'install') {
       return "\t".'install '.
    $categoryhash{$categoryname}.' '.
    $sourceroot.'/'.$sourcedir.$glob.' '.
    $targetroot.'/'.$targetdir.'.'."\n";
    }
  else {   else {
     return '';      return '';
  }   }
Line 808  sub format_glob { Line 831  sub format_glob {
 # ---------------------------------------------------- Format filenames section  # ---------------------------------------------------- Format filenames section
 sub format_filenames {  sub format_filenames {
     my @tokeninfo=@_;      my @tokeninfo=@_;
     $glob='';  
     my $text=&trim($parser->get_text('/filenames'));      my $text=&trim($parser->get_text('/filenames'));
     if ($text) {      if ($text) {
  $parser->get_tag('/filenames');   $parser->get_tag('/filenames');
Line 819  sub format_filenames { Line 841  sub format_filenames {
 # ------------------------------------------------------- Format linkto section  # ------------------------------------------------------- Format linkto section
 sub format_linkto {  sub format_linkto {
     my @tokeninfo=@_;      my @tokeninfo=@_;
     $glob='';  
     my $text=&trim($parser->get_text('/linkto'));      my $text=&trim($parser->get_text('/linkto'));
     if ($text) {      if ($text) {
  $parser->get_tag('/linkto');   $parser->get_tag('/linkto');

Removed from v.1.4  
changed lines
  Added in v.1.8


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