#!/usr/bin/perl my ($standard,$current)=@ARGV; $standard=~s/[^\/\w\.]//g; $current=~s/[^\/\w\.]//g; my %svhash; my %sbhash; my @oldrpms; my @badversionrpms; my @newrpms; my @externalrpms; open IN, "<$standard"; while() { chop; my ($name,$version,$buildtime)=split(/\s+/); $svhash{$name}=$version; $sbhash{$name}=$buildtime; } close IN; open IN, "<$current"; while() { chop; my ($name,$version,$buildtime)=split(/\s+/); if ($svhash{$name}) { unless ($svhash{$name} eq $version) { push @badversionrpms,"$name is version $version, should be $svhash{$name}\n"; } if ($sbhash{$name}<$buildtime) { push @newrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\n"; } if ($sbhash{$name}>$buildtime) { push @oldrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\n"; } } else { push @externalrpms,"$name (built ".localtime($buildtime).") is an RPM not expected to ever be on a LON-CAPA system\n"; } } close IN; my $date=`date`; chop $date; my $hostname=`hostname`; chop $hostname; print < LON-CAPA Software RPM Status Page LON-CAPA Software RPM Status Page (done on $date for $hostname)
Michigan State University
Learning Online with CAPA
Contact korte\@lon-capa.org
  • About this file
  • Bad RPM Versions
  • Out-of-date RPMS
  • Newer than expected RPMS
  • RPMS external to LON-CAPA
About this file

This file is generated dynamically by make rpmstatuspost when this command is entered in the CVS:loncom/build directory.

END print <Bad RPM Versions
END
foreach my $rpminfo (@badversionrpms) {
    print $rpminfo;
}
print <
END
print <Out-of-date RPMS
END
foreach my $rpminfo (@oldrpms) {
    print $rpminfo;
}
print <
END
print <Newer than expected RPMS
END
foreach my $rpminfo (@newrpms) {
    print $rpminfo;
}
print <
END
print <RPMS external to LON-CAPA
END
foreach my $rpminfo (@externalrpms) {
    print $rpminfo;
}
print <
END