4 |
use warnings; |
use warnings; |
5 |
use RPM2; |
use RPM2; |
6 |
use Data::Dumper; |
use Data::Dumper; |
7 |
|
use Getopt::Std; |
8 |
|
|
9 |
|
my %opts; |
10 |
|
getopts( "s:", \%opts ); |
11 |
|
my $src = $opts{s} || '/builds/RPMS'; |
12 |
|
|
13 |
my $rpm_flags = RPM2->vsf_nodsa; |
my $rpm_flags = RPM2->vsf_nodsa; |
|
my $build_dir = "/builds/RPMS"; |
|
14 |
my @repositories = qw( |
my @repositories = qw( |
15 |
/mirrors/centos/4/fasttrack/i386/RPMS/ |
/mirrors/centos/4/fasttrack/i386/RPMS/ |
16 |
/mirrors/centos/4/updates/i386/RPMS/ |
/mirrors/centos/4/updates/i386/RPMS/ |
27 |
/builds/rpms/RPMS/noarch/ |
/builds/rpms/RPMS/noarch/ |
28 |
); |
); |
29 |
|
|
30 |
opendir RPMS, $build_dir or die "Couldn't opendir $build_dir"; |
opendir RPMS, $src or die "Couldn't opendir $src"; |
31 |
my %rpms = map { my $x = RPM2->open_package("$build_dir/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS; |
my %rpms = map { my $x = RPM2->open_package("$src/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS; |
32 |
closedir RPMS; |
closedir RPMS; |
33 |
|
|
34 |
my %repos; |
my %repos; |
82 |
my $filename = $rpms{$rpm}->filename; |
my $filename = $rpms{$rpm}->filename; |
83 |
$filename =~ s@^.*/(.*)@$1@; |
$filename =~ s@^.*/(.*)@$1@; |
84 |
print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n"; |
print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n"; |
85 |
#print " - rm $build_dir/$filename; cp ". $header->filename . " $build_dir\n"; |
#print " - rm $src/$filename; cp ". $header->filename . " $src\n"; |
86 |
} |
} |
87 |
} |
} |
88 |
} |
} |