--- loncom/build/rpmparse.pl 2001/05/03 15:19:34 1.9 +++ loncom/build/rpmparse.pl 2001/11/08 00:17:09 1.10 @@ -2,9 +2,10 @@ my ($standard,$current,$expected)=@ARGV; -$standard=~s/[^\/\w\.]//g; -$current=~s/[^\/\w\.]//g; -$expected=~s/[^\/\w\.]//g; +$standard=~s/[^\/\w\.]//g; # cd_rpms.txt +$current=~s/[^\/\w\.]//g; # rpm -qa --queryformat \ + # '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}' +$expected=~s/[^\/\w\.]//g; # rpm_list.txt my %svhash; my %sbhash; my %chash; @@ -16,33 +17,46 @@ my @externalrpms; my @barerpms; my @developrpms; +my %ignore=( + 'LON-CAPA-setup' => 1, + 'LON-CAPA-base' => 1, + ); + open IN, "<$standard"; while() { chop; - my ($name,$version,$buildtime)=split(/\s+/); + my ($name,$version,$release,$buildtime,$arch)=split(/\s+/); + next if $ignore{$name}; + $download='[download]'; + $version="$version-$release"; $svhash{$name}=$version; $sbhash{$name}=$buildtime; + $dhash{$name}=$download; } close IN; open IN, "<$current"; while() { 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}) { 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) { - 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) { - 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 { - 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; @@ -55,9 +69,10 @@ while() { my $type=$1; my $package=$2; $package=~s/\-[^\-]*\-[^\-]*$//; + next if $ignore{$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 @developrpms,"$package is missing and may be useful for a LON-CAPA system\n" if $type eq 'N'; + 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;