File:  [LON-CAPA] / loncom / build / rpmparse.pl
Revision 1.8: download - view: text, annotated - select for diffs
Thu May 3 15:18:06 2001 UTC (23 years, 1 month ago) by harris41
Branches: MAIN
CVS tags: HEAD
adding in more information for the rpmstatus target

    1: #!/usr/bin/perl
    2: 
    3: my ($standard,$current,$expected)=@ARGV;
    4: 
    5: $standard=~s/[^\/\w\.]//g;
    6: $current=~s/[^\/\w\.]//g;
    7: $expected=~s/[^\/\w\.]//g;
    8: my %svhash;
    9: my %sbhash;
   10: my %chash;
   11: 
   12: my @oldrpms;
   13: my @badversionrpms;
   14: my @newrpms;
   15: my @externalrpms;
   16: my @barerpms;
   17: my @developrpms;
   18: 
   19: open IN, "<$standard";
   20: while(<IN>) {
   21:     chop;
   22:     my ($name,$version,$buildtime)=split(/\s+/);
   23:     $svhash{$name}=$version;
   24:     $sbhash{$name}=$buildtime;
   25: }
   26: close IN;
   27: 
   28: open IN, "<$current";
   29: while(<IN>) {
   30:     chop;
   31:     my ($name,$version,$buildtime)=split(/\s+/);
   32:     $chash{$name}=1;
   33:     if ($svhash{$name}) {
   34: 	unless ($svhash{$name} eq $version) {
   35: 	    push @badversionrpms,"$name is version $version, should be $svhash{$name}\n";
   36: 	}
   37: 	if ($sbhash{$name}<$buildtime) {
   38: 	    push @newrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\n";
   39: 	}
   40: 	if ($sbhash{$name}>$buildtime) {
   41: 	    push @oldrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\n";
   42: 	}
   43:     }
   44:     else {
   45: 	push @externalrpms,"$name (built ".localtime($buildtime).") is an RPM not expected to ever be on a LON-CAPA system\n";
   46:     }
   47: }
   48: close IN;
   49: 
   50: open IN,"<$expected";
   51: while(<IN>) {
   52:     chop;
   53:     next unless /^[YN] \w/;
   54:     /(.).(.*)/;
   55:     my $type=$1;
   56:     my $package=$2;
   57:     $package=~s/\-[^\-]*\-[^\-]*$//;
   58:     print "<br>$type $package\n";
   59:     if (!$chash{$package}) {
   60: 	push @barerpms,"$package is missing and is of basic necessity to a LON-CAPA system\n" if $type eq 'Y';
   61: 	push @developrpms,"$package is missing and may be useful for a LON-CAPA system\n" if $type eq 'N';
   62:     }
   63: }
   64: close IN;
   65: 
   66: my $date=`date`; chop $date;
   67: my $hostname=`hostname`; chop $hostname;
   68: print <<END;
   69: <html>
   70: <head>
   71: <title>LON-CAPA Software RPM Status Page</title>
   72: </head>
   73: <body>
   74: <font size="+2">LON-CAPA Software RPM Status Page
   75: (done on $date for $hostname)</font>
   76: <br />Michigan State University
   77: <br />Learning Online with CAPA
   78: <br />Contact korte\@lon-capa.org
   79: <ul>
   80: <li>Important warnings</li>
   81: <li>About this file</li>
   82: <li>Bad RPM Versions</li>
   83: <li>Out-of-date RPMS</li>
   84: <li>Newer than expected RPMS</li>
   85: <li>RPMS external to LON-CAPA</li>
   86: <li>RPMS from the "bare minimum" set that you are missing</li>
   87: <li>RPMS from the "development" set that you are missing</li>
   88: </ul>
   89: <font size="+2">Important warnings</font>
   90: <p>
   91: <b>Never install LON-CAPA-setup</b> on a running LON-CAPA machine.
   92: This RPM package contains pre-installation files such as 
   93: /etc/group and /etc/passwd.  You will lose all access to your
   94: machine if you install this RPM.
   95: </p>
   96: <p>
   97: If you are doing CVS-based upgrades of your LON-CAPA
   98: software, then you do not need to upgrade your LON-CAPA-base
   99: RPM.  Upgrading with the LON-CAPA-base RPM
  100: will cause you to lose many of your system-specific
  101: configuration settings.
  102: </p>
  103: <p>
  104: DO NOT UPGRADE YOUR KERNEL UNLESS YOU KNOW WHAT YOU ARE DOING.
  105: Kernel upgrading involves packages beginning with the word
  106: "kernel".
  107: </p>
  108: <font size="+2">About this file</font>
  109: <p>
  110: This file is generated dynamically by <tt>make rpmstatuspost</tt>
  111: when this command is entered in the CVS:loncom/build directory.
  112: </p>
  113: <p>
  114: Managing software packages on any system, testing different
  115: sets of software packages, tracking their dependencies, and maintaining
  116: configuration information is an inexact science.  While the LON-CAPA
  117: recommended set of RPMs is a tested set with no missing dependencies,
  118: we still highly recommend that RPM upgrades are only performed
  119: by those with significant knowledge about standard Linux operating
  120: systems.
  121: </p>
  122: END
  123:     print <<END;
  124: <font size="+2">Differing RPM Versions</font>
  125: <pre>
  126: END
  127: foreach my $rpminfo (@badversionrpms) {
  128:     print $rpminfo;
  129: }
  130: print <<END;
  131: </pre>
  132: END
  133: print <<END;
  134: <font size="+2">Out-of-date RPMS</font>
  135: <pre>
  136: END
  137: foreach my $rpminfo (@oldrpms) {
  138:     print $rpminfo;
  139: }
  140: print <<END;
  141: </pre>
  142: END
  143: print <<END;
  144: <font size="+2">Newer than expected RPMS</font>
  145: <pre>
  146: END
  147: foreach my $rpminfo (@newrpms) {
  148:     print $rpminfo;
  149: }
  150: print <<END;
  151: </pre>
  152: END
  153: print <<END;
  154: <font size="+2">RPMS external to LON-CAPA</font>
  155: <pre>
  156: END
  157: foreach my $rpminfo (@externalrpms) {
  158:     print $rpminfo;
  159: }
  160: print <<END;
  161: </pre>
  162: END
  163: print <<END;
  164: <font size="+2">RPMS from the "bare minimum" set that you are missing</font>
  165: <pre>
  166: END
  167: foreach my $rpminfo (@barerpms) {
  168:     print $rpminfo;
  169: }
  170: print <<END;
  171: </pre>
  172: END
  173: print <<END;
  174: <font size="+2">RPMS from the "development" set that you are missing</font>
  175: <pre>
  176: END
  177: foreach my $rpminfo (@developrpms) {
  178:     print $rpminfo;
  179: }
  180: print <<END;
  181: </pre>
  182: END

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