Diff for /loncom/build/rpmparse.pl between versions 1.2 and 1.10

version 1.2, 2001/04/03 13:25:39 version 1.10, 2001/11/08 00:17:09
Line 1 Line 1
 #!/usr/bin/perl  #!/usr/bin/perl
   
 my ($standard,$current)=@ARGV;  my ($standard,$current,$expected)=@ARGV;
   
 $standard=~s/[^\/\w]//g;  $standard=~s/[^\/\w\.]//g; # cd_rpms.txt
 $current=~s/[^\/\w]//g;  $current=~s/[^\/\w\.]//g; # rpm -qa --queryformat \
                             # '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}'
   $expected=~s/[^\/\w\.]//g; # rpm_list.txt
 my %svhash;  my %svhash;
 my %sbhash;  my %sbhash;
   my %chash;
   
 my @oldrpms;  my @oldrpms;
 my @badversionrpms;  my @badversionrpms;
 my @newrpms;  my @newrpms;
 my @externalrpms;  my @externalrpms;
   my @barerpms;
   my @developrpms;
   
 open IN, $standard;  my %ignore=(
       'LON-CAPA-setup' => 1,
       'LON-CAPA-base' => 1,
       );
   
   open IN, "<$standard";
 while(<IN>) {  while(<IN>) {
     chop;      chop;
     my ($name,$version,$buildtime)=split(/\s+/);      my ($name,$version,$release,$buildtime,$arch)=split(/\s+/);
       next if $ignore{$name};
       $download='<a href="'.
    'http://install.lon-capa.org/3.1/latestRPMS/'.$name.'-'.
    $version.'-'.$release.'.'.$arch.'.rpm'.'">[download]</a>';
       $version="$version-$release";
     $svhash{$name}=$version;      $svhash{$name}=$version;
     $sbhash{$name}=$buildtime;      $sbhash{$name}=$buildtime;
       $dhash{$name}=$download;
 }  }
 close IN;  close IN;
   
 open IN, $current;  open IN, "<$current";
 while(<IN>) {  while(<IN>) {
     chop;      chop;
     my ($name,$version,$buildtime)=split(/\s+/);      my ($name,$version,$release,$buildtime)=split(/\s+/);
       next if $ignore{$name};
       $version="$version-$release";
       $chash{$name}=1;
     if ($svhash{$name}) {      if ($svhash{$name}) {
  unless ($svhash{$name} eq $version) {   unless ($svhash{$name} eq $version) {
     push @badversionrpms,"$name is version $version, should be $svhash{$name}\n";      push @badversionrpms,sprintf("$dhash{$name} %-25s %s",($name,"is version $version, should be $svhash{$name}"))."\n";
  }   }
  if ($sbhash{$name}<$buildtime) {   if ($sbhash{$name}<$buildtime) {
     push @newrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\n";      push @newrpms,sprintf("$dhash{$name} %-25s %s",($name,"was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})))."\n";
  }   }
  if ($sbhash{$name}>$buildtime) {   if ($sbhash{$name}>$buildtime) {
     push @newrpms,"$name was built ".localtime($sbhash{$name})." when the expected build time was ".localtime($buildtime)."\n";      push @oldrpms,sprintf("$dhash{$name} %-25s %s",($name,"was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})))."\n";
  }   }
     }      }
     else {      else {
  push @externalrpms,"$name (built ".localtime($buildtime).") is an RPM not expected to ever be on a LON-CAPA system\n";   push @externalrpms,sprintf("$dhash{$name} %-25s %s",($name,"(built ".localtime($buildtime).") is an RPM not expected to ever be on a LON-CAPA system"))."\n";
       }
   }
   close IN;
   
   open IN,"<$expected";
   while(<IN>) {
       chop;
       next unless /^[YN] \w/;
       /(.).(.*)/;
       my $type=$1;
       my $package=$2;
       $package=~s/\-[^\-]*\-[^\-]*$//;
       next if $ignore{$package};
       if (!$chash{$package}) {
    push @barerpms,sprintf("$dhash{$package} %-25s %s",($package,"is missing and is of basic necessity to a LON-CAPA system"))."\n" if $type eq 'Y';
    push @developrpms,sprintf("$dhash{$package} %-25s %s",($package,"is missing and may be useful for a LON-CAPA system"))."\n" if $type eq 'N';
     }      }
 }  }
 close IN;  close IN;
   
 my $date=`date`; chop $date;  my $date=`date`; chop $date;
 my $hostname=`hostname`;  my $hostname=`hostname`; chop $hostname;
 print <<END;  print <<END;
 <HTML>  <html>
 <HEAD>  <head>
 <TITLE>LON-CAPA Software RPM Status Page</TITLE>  <title>LON-CAPA Software RPM Status Page</title>
 </HEAD>  </head>
 <BODY>  <body>
 <FONT SIZE=+2>LON-CAPA Software RPM Status Page (done on $date for $hostname)</FONT>  <font size="+2">LON-CAPA Software RPM Status Page
 <BR>Michigan State University  (done on $date for $hostname)</font>
 <BR>Learning Online with CAPA  <br />Michigan State University
 <BR>Contact korte@lon-capa.org  <br />Learning Online with CAPA
 <UL>  <br />Contact korte\@lon-capa.org
 <LI>About this file</LI>  <ul>
 <LI>Bad RPM Versions</LI>  <li>Important warnings</li>
 <LI>Out-of-date RPMS</LI>  <li>About this file</li>
 <LI>Newer than expected RPMS</LI>  <li>Bad RPM Versions</li>
 <LI>RPMS external to LON-CAPA</LI>  <li>Out-of-date RPMS</li>
 </UL>  <li>Newer than expected RPMS</li>
 <FONT SIZE=+2>About this file</FONT>  <li>RPMS external to LON-CAPA</li>
 <P>  <li>RPMS from the "bare minimum" set that you are missing</li>
   <li>RPMS from the "development" set that you are missing</li>
   </ul>
   <font size="+2">Important warnings</font>
   <p>
   <b>Never install LON-CAPA-setup</b> on a running LON-CAPA machine.
   This RPM package contains pre-installation files such as 
   /etc/group and /etc/passwd.  You will lose all access to your
   machine if you install this RPM.
   </p>
   <p>
   If you are doing CVS-based upgrades of your LON-CAPA
   software, then you do not need to upgrade your LON-CAPA-base
   RPM.  Upgrading with the LON-CAPA-base RPM
   will cause you to lose many of your system-specific
   configuration settings.
   </p>
   <p>
   DO NOT UPGRADE YOUR KERNEL UNLESS YOU KNOW WHAT YOU ARE DOING.
   Kernel upgrading involves packages beginning with the word
   "kernel".
   </p>
   <font size="+2">About this file</font>
   <p>
 This file is generated dynamically by <tt>make rpmstatuspost</tt>  This file is generated dynamically by <tt>make rpmstatuspost</tt>
 when this command is entered in the CVS:loncom/build directory.  when this command is entered in the CVS:loncom/build directory.
 </P>  </p>
   <p>
   Managing software packages on any system, testing different
   sets of software packages, tracking their dependencies, and maintaining
   configuration information is an inexact science.  While the LON-CAPA
   recommended set of RPMs is a tested set with no missing dependencies,
   we still highly recommend that RPM upgrades are only performed
   by those with significant knowledge about standard Linux operating
   systems.
   </p>
 END  END
     print <<END;      print <<END;
 <FONT SIZE=+2>Bad RPM Versions</FONT>  <font size="+2">Differing RPM Versions</font>
 <PRE>  <pre>
 END  END
 foreach my $rpminfo (@badversionrpms) {  foreach my $rpminfo (@badversionrpms) {
     print $rpminfo;      print $rpminfo;
 }  }
 print <<END;  print <<END;
 </PRE>  </pre>
 END  END
 print <<END;  print <<END;
 <FONT SIZE=+2>Out-of-date RPMS</FONT>  <font size="+2">Out-of-date RPMS</font>
 <PRE>  <pre>
 END  END
 foreach my $rpminfo (@oldrpms) {  foreach my $rpminfo (@oldrpms) {
     print $rpminfo;      print $rpminfo;
 }  }
 print <<END;  print <<END;
 </PRE>  </pre>
 END  END
 print <<END;  print <<END;
 <FONT SIZE=+2>Newer than expected RPMS</FONT>  <font size="+2">Newer than expected RPMS</font>
 <PRE>  <pre>
 END  END
 foreach my $rpminfo (@newrpms) {  foreach my $rpminfo (@newrpms) {
     print $rpminfo;      print $rpminfo;
 }  }
 print <<END;  print <<END;
 </PRE>  </pre>
 END  END
 print <<END;  print <<END;
 <FONT SIZE=+2>RPMS external to LON-CAPA</FONT>  <font size="+2">RPMS external to LON-CAPA</font>
 <PRE>  <pre>
 END  END
 foreach my $rpminfo (@externalrpms) {  foreach my $rpminfo (@externalrpms) {
     print $rpminfo;      print $rpminfo;
 }  }
 print <<END;  print <<END;
 </PRE>  </pre>
   END
   print <<END;
   <font size="+2">RPMS from the "bare minimum" set that you are missing</font>
   <pre>
   END
   foreach my $rpminfo (@barerpms) {
       print $rpminfo;
   }
   print <<END;
   </pre>
   END
   print <<END;
   <font size="+2">RPMS from the "development" set that you are missing</font>
   <pre>
   END
   foreach my $rpminfo (@developrpms) {
       print $rpminfo;
   }
   print <<END;
   </pre>
 END  END

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


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