Diff for /loncom/build/lpml_parse.pl between versions 1.10 and 1.12

version 1.10, 2001/09/17 18:25:15 version 1.12, 2001/09/18 13:18:33
Line 228  my $dependency; Line 228  my $dependency;
 my @links;  my @links;
 my %categoryhash;  my %categoryhash;
   
   my @buildall;
   my @buildinfo;
   
   my @configall;
   
 # Make new parser with distribution specific input  # Make new parser with distribution specific input
 undef $parser;  undef $parser;
 $parser = HTML::TokeParser->new(\$cleanstring) or  $parser = HTML::TokeParser->new(\$cleanstring) or
Line 325  sub format_lpml { Line 330  sub format_lpml {
  print '# This file was automatically generated on '.`date`;   print '# This file was automatically generated on '.`date`;
  print "\n".$invocation;   print "\n".$invocation;
     }      }
       elsif ($mode eq 'build') {
    $lpml = "# Dynamic Makefile generated by LON-CAPA build process\n";
    $lpml .= '# This file was automatically generated on '.`date`;
    $lpml .= "\n";
    $lpml .= "SHELL=\"/bin/sh\"\n\n";
       }
     else {      else {
  return '';   return '';
     }      }
Line 340  sub format_targetroot { Line 351  sub format_targetroot {
     elsif ($mode eq 'install') {      elsif ($mode eq 'install') {
  return '# TARGET INSTALL LOCATION is "'.$targetroot."\"\n";   return '# TARGET INSTALL LOCATION is "'.$targetroot."\"\n";
     }      }
       elsif ($mode eq 'build') {
    return '# TARGET INSTALL LOCATION is "'.$targetroot."\"\n";
       }
     else {      else {
  return '';   return '';
     }      }
Line 355  sub format_sourceroot { Line 369  sub format_sourceroot {
     elsif ($mode eq 'install') {      elsif ($mode eq 'install') {
  return '# SOURCE CODE LOCATION IS "'.$sourceroot."\"\n";;   return '# SOURCE CODE LOCATION IS "'.$sourceroot."\"\n";;
     }      }
       elsif ($mode eq 'build') {
    return '# SOURCE CODE LOCATION IS "'.$sourceroot."\"\n";;
       }
     else {      else {
  return '';   return '';
     }      }
Line 634  sub format_files { Line 651  sub format_files {
  return "\n".'files:'."\n".$text.   return "\n".'files:'."\n".$text.
     "\n".'links:'."\n".join('',@links);      "\n".'links:'."\n".join('',@links);
     }      }
       elsif ($mode eq 'configinstall') {
    return "\n".'configfiles: '.
    join(' ',@configall).
    "\n\n".$text;
       }
       elsif ($mode eq 'build') {
    my $binfo;
    my $tword;
    my $command2;
    my @deps;
    foreach my $bi (@buildinfo) {
       my ($source,$command,$trigger,@deps)=split(/\;/,$bi);
       $tword=''; $tword=' alwaysrun' if $trigger eq 'always run'; 
       $command=~s/\/([^\/]*)$//;
       $command2="cd $command; sh ./$1;\\";
       my $depstring;
       foreach my $dep (@deps) {
    $depstring.="\telif !(test -r $command/$dep);\\\n";
    $depstring.="\t\tthen echo ".
    "\"**** LON-CAPA WARNING **** missing the file: ".
            "$command/$dep\";\\\n";
       }
       $binfo.="$source: $tword\n".
    "\t\@if !(echo \"\");\\\n\t\tthen echo ".
    "\"**** LON-CAPA WARNING **** Strange shell. ".
            "Check your path settings.\";\\\n".
    $depstring.
    "\telse \\\n\t\t$command2\n\tfi\n\n";
    }
    return 'all: '.join(' ',@buildall)."\n\n".
            $text.
    $binfo."\n".
    "alwaysrun:\n\n";
       }
     else {      else {
  return '';   return '';
     }      }
Line 681  sub format_file { Line 732  sub format_file {
  '**** CVS source file does not exist: '.$sourceroot.'/'.   '**** CVS source file does not exist: '.$sourceroot.'/'.
  $source.'"'."\n";   $source.'"'."\n";
  }   }
    elsif ($mode eq 'configinstall' && $categoryname eq 'conf') {
       push @configall,$targetroot.'/'.$target;
       return $targetroot.'/'.$target.':'."\n".
    "\t".'@install '.$categoryhash{$categoryname}.' '.
    $sourceroot.'/'.$source.' '.
    $targetroot.'/'.$target.'.lpmlnewconf'.
    ' && echo "*** CONFIGURATION FILE CHANGE ***" && echo "'.
    'You likely need to compare contents of "'.
    "$targetroot/$target with the new ".
                   "$targetroot/$target.lpmlnewconf".
    "\n\n";
    }
    elsif ($mode eq 'build' && $build) {
       push @buildall,$sourceroot.'/'.$source;
       push @buildinfo,$sourceroot.'/'.$source.';'.$build.';'.
    $dependencies;
   #    return '# need to build '.$source.";
    }
  else {   else {
     return '';      return '';
  }   }
Line 795  sub format_build { Line 864  sub format_build {
     my $text=&trim($parser->get_text('/build'));      my $text=&trim($parser->get_text('/build'));
     if ($text) {      if ($text) {
  $parser->get_tag('/build');   $parser->get_tag('/build');
  $build=$text;   $build=$sourceroot.'/'.$text.';'.$tokeninfo[2]{'trigger'};
     }      }
     return '';      return '';
 }  }
Line 817  sub format_dependencies { Line 886  sub format_dependencies {
     my $text=&trim($parser->get_text('/dependencies'));      my $text=&trim($parser->get_text('/dependencies'));
     if ($text) {      if ($text) {
  $parser->get_tag('/dependencies');   $parser->get_tag('/dependencies');
  $dependencies=$text;   $dependencies=join(';',
         (map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)));
     }      }
     return '';      return '';
 }  }

Removed from v.1.10  
changed lines
  Added in v.1.12


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