version 1.9, 2001/05/03 15:19:34
|
version 1.10, 2001/11/08 00:17:09
|
Line 2
|
Line 2
|
|
|
my ($standard,$current,$expected)=@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 \ |
$expected=~s/[^\/\w\.]//g; |
# '%{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 %chash; |
Line 16 my @externalrpms;
|
Line 17 my @externalrpms;
|
my @barerpms; |
my @barerpms; |
my @developrpms; |
my @developrpms; |
|
|
|
my %ignore=( |
|
'LON-CAPA-setup' => 1, |
|
'LON-CAPA-base' => 1, |
|
); |
|
|
open IN, "<$standard"; |
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; |
$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 @oldrpms,"$name was built ".localtime($buildtime)." when the expected build time was ".localtime($sbhash{$name})."\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; |
close IN; |
Line 55 while(<IN>) {
|
Line 69 while(<IN>) {
|
my $type=$1; |
my $type=$1; |
my $package=$2; |
my $package=$2; |
$package=~s/\-[^\-]*\-[^\-]*$//; |
$package=~s/\-[^\-]*\-[^\-]*$//; |
|
next if $ignore{$package}; |
if (!$chash{$package}) { |
if (!$chash{$package}) { |
push @barerpms,"$package is missing and is of basic necessity to a LON-CAPA system\n" if $type eq 'Y'; |
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,"$package is missing and may be useful for a LON-CAPA system\n" if $type eq 'N'; |
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; |