#!/usr/bin/perl -w # Checks all the RPM files on the system, finds differences between what # they think and what the system is if( -d "report"){ die "Report already exists";} mkdir("report", 0755) || die "Ack! can't make reportdir"; print "Getting list of rpms\n"; @rpms = `rpm -qa`; chomp(@rpms); $count = 1; $rpmsize = $#rpms; print "Gathering rpm info\n"; foreach $rpm (@rpms) { print "Checking $rpm (" . $count++ . "/$rpmsize)\n"; $info = `rpm -V $rpm`; next if($info =~ /^\s*$/sm); # Don't make empty logs $stuff{$rpm} = $info; } print "\nMaking reports\n"; foreach $rpm (@rpms) { next if(! exists($stuff{$rpm}) ); # More of the same on not making empty logs chomp($rpm); open(REP, ">report/$rpm") || die "Can't make report [report/$rpm]"; print REP $stuff{$rpm}; close(REP); } print "Done\n";