1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#!/usr/bin/perl -w
$Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
if ( $Debug >= 5 ) {
print STDERR "\n\nDEBUG: Inside YUM Filter \n\n";
$DebugCounter = 1;
}
while (defined($ThisLine = <STDIN>)) {
if ( $Debug >= 5 ) {
print STDERR "DEBUG($DebugCounter): $ThisLine";
$DebugCounter++;
}
$ThisLine =~ s/^[^ ]* [^ ]* //;
if ( $ThisLine =~ s/^Updated: ([^ ]+)/$1/ ) {
$PackageUpdated{$ThisLine}++;
} elsif ( $ThisLine =~ s/^Installed: ([^ ]+)/$1/ ) {
$PackageInstalled{$ThisLine}++;
} elsif ( $ThisLine =~ s/^Dep Installed: ([^ ]+)/$1/ ) {
$PackageDepInstalled{$ThisLine}++;
} else {
# Report any unmatched entries...
push @OtherList,$ThisLine;
}
}
if (keys %PackageInstalled) {
print "\nPackage Installed:\n";
foreach $ThisOne (keys %PackageInstalled) {
print " " . $ThisOne;
}
}
if (keys %PackageDepInstalled) {
print "\nPackage Dependency Installed:\n";
foreach $ThisOne (keys %PackageDepInstalled) {
print " " . $ThisOne;
}
}
if (keys %PackageUpdated) {
print "\nPackage Updated:\n";
foreach $ThisOne (keys %PackageUpdated) {
print " ". $ThisOne;
}
}
if ($#OtherList >= 0) {
print "\n**Unmatched Entries**\n";
print @OtherList;
}
exit(0);
# vi: shiftwidth=3 tabstop=3 et
|