Diff for /loncom/build/lpml_parse.pl between versions 1.58 and 1.62

version 1.58, 2012/01/23 03:32:43 version 1.62, 2020/10/07 19:55:39
Line 1230  sub format_file { Line 1230  sub format_file {
     my @tokeninfo=@_;      my @tokeninfo=@_;
     $file=''; $source=''; $target=''; $categoryname=''; $description='';      $file=''; $source=''; $target=''; $categoryname=''; $description='';
     $note=''; $build=''; $status=''; $dependencies=''; $installscript='';      $note=''; $build=''; $status=''; $dependencies=''; $installscript='';
       $buildlink = '';
     my $text=&trim($parser->get_text('/file'));      my $text=&trim($parser->get_text('/file'));
     my $buildtest;      my $buildtest;
     $file_count++;      $file_count++;
Line 1323  END Line 1324  END
  }   }
  return $result;   return $result;
     }      }
             my $bflag='-b1';      my $testtarget = $target;
             $bflag='-b3' if $dependencies or $buildlink;      if ($categoryname eq 'setuid script') {
    my ($path,$filename) = ($target =~ /^(.*\/)([^\/]+)$/);
    my $alttarget = $path.'.'.$filename;
    if ((-e "$targetroot/$target") && (-B "$targetroot/$target") &&
       (-e "$targetroot/$alttarget") && (-T "$targetroot/$alttarget")) {
       $testtarget = $alttarget;
    }
       }
               my $bflag='-b5';
               $bflag='-b3' if ($buildlink);
               $bflag='-b6' if (($dependencies) or
                                ($categoryname eq 'pdf manual'));
     if ($tokeninfo[2]{type} eq 'private') {      if ($tokeninfo[2]{type} eq 'private') {
  return <<END;   return <<END;
 $buildtest \@if (test -e "${sourceroot}/${source}") && (test -e "${targetroot}/${target}"); then \\  $buildtest \@if (test -e "${sourceroot}/${source}") && (test -e "${targetroot}/${target}"); then \\
  ECODE=0; \\   ECODE=0; \\
  perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\   perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${testtarget} || ECODE=\$\$?; \\
  case "\$\$ECODE" in \\   case "\$\$ECODE" in \\
  1) echo "${targetroot}/${target} is unchanged";; \\   1) echo "${targetroot}/${target} is unchanged";; \\
  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};; \\   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 -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
  0) echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\   0) echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
                 esac; \\                  esac; \\
  elif (test -e "${sourceroot}/${source}") && !(test -e "${targetroot}/${target}"); then\\   elif (test -e "${sourceroot}/${source}") && !(test -e "${targetroot}/${target}"); then\\
  echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\   echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\
  fi   fi
  \@if (test -e "${targetroot}/${target}"); then \\   \@if (test -e "${targetroot}/${target}"); then \\
  perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\   perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
Line 1349  $buildtest \@if !(test -e "${sourceroot} Line 1361  $buildtest \@if !(test -e "${sourceroot}
  elif !(test -e "${sourceroot}/${source}"); then \\   elif !(test -e "${sourceroot}/${source}"); then \\
  echo "**** WARNING **** CVS source file does not exist: ${sourceroot}/${source}"$logcmd; \\   echo "**** WARNING **** CVS source file does not exist: ${sourceroot}/${source}"$logcmd; \\
  perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\   perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
    elif !(test -e "${targetroot}/${target}"); then \\
    echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\
  else \\   else \\
  ECODE=0; \\   ECODE=0; \\
  perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\   perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${testtarget} || ECODE=\$\$?; \\
  case "\$\$ECODE" in \\   case "\$\$ECODE" in \\
  1) echo "${targetroot}/${target} is unchanged";; \\   1) echo "${targetroot}/${target} is unchanged";; \\
  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};; \\   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 -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
  0) echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\   0) echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
  esac; \\   esac; \\
  perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\   perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
  fi   fi
Line 1552  sub format_fileglob { Line 1566  sub format_fileglob {
     if ($glob eq '*') {      if ($glob eq '*') {
  $eglob='[^C][^V][^S]'.$glob;   $eglob='[^C][^V][^S]'.$glob;
     }      }
     return "\t".'install '.      return "\t".'install -p '.
  $categoryhash{$categoryname}.' '.   $categoryhash{$categoryname}.' '.
  $sourceroot.'/'.$sourcedir.$eglob.' '.   $sourceroot.'/'.$sourcedir.$eglob.' '.
  $targetroot.'/'.$targetdir.'.'."\n";   $targetroot.'/'.$targetdir.'.'."\n";
Line 1659  sub format_installscript { Line 1673  sub format_installscript {
 # -------------------------------------------------------- Format build section  # -------------------------------------------------------- Format build section
 sub format_buildlink {  sub format_buildlink {
     my @tokeninfo=@_;      my @tokeninfo=@_;
     $buildlink='';  
     my $text=&trim($parser->get_text('/buildlink'));      my $text=&trim($parser->get_text('/buildlink'));
     if ($text) {      if ($text) {
  $parser->get_tag('/buildlink');   $parser->get_tag('/buildlink');
  $buildlink=$sourceroot.'/'.$text;   $buildlink=$sourceroot.'/'.$text;
       } else {
           $buildlink='';
     }      }
     return '';      return '';
 }  }
Line 1681  sub format_status { Line 1696  sub format_status {
 # ------------------------------------------------- Format dependencies section  # ------------------------------------------------- Format dependencies section
 sub format_dependencies {  sub format_dependencies {
     my @tokeninfo=@_;      my @tokeninfo=@_;
     #$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=join(';',((map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)),$dependencies));   $dependencies=join(';',((map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)),$dependencies));
  $dependencies=~s/;$//;   $dependencies=~s/;$//;
       } else {
           $dependencies='';
     }      }
     return '';      return '';
 }  }

Removed from v.1.58  
changed lines
  Added in v.1.62


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