8 |
my $rpm_flags = RPM2->vsf_nodsa; |
my $rpm_flags = RPM2->vsf_nodsa; |
9 |
my $build_dir = "/builds/RPMS"; |
my $build_dir = "/builds/RPMS"; |
10 |
my @repositories = qw( |
my @repositories = qw( |
11 |
/mirrors/centos/4/updates/i386/RPMS/ |
/mirrors/centos/4/updates/i386/RPMS/ |
12 |
/mirrors/centos/4/os/i386/CentOS/RPMS/ |
/mirrors/centos/4/os/i386/CentOS/RPMS/ |
13 |
/mirrors/centos/4/dag/i386/RPMS.dag/ |
/mirrors/dag/redhat/el4/en/i386/dag/RPMS/ |
14 |
/mirrors/centos/4/atrpms/i386/RPMS.stable/ |
/mirrors/atrpms/el4-i386/atrpms/stable/ |
15 |
/mirrors/centos/4/dries/i386/RPMS.dries/ |
/mirrors/dries/redhat/el3/en/i386/RPMS.dries |
16 |
/mirrors/fedora/updates/3/i386/ |
/mirrors/fedora/updates/3/i386/ |
17 |
/mirrors/fedora/3/i386/os/Fedora/RPMS/ |
/mirrors/fedora/3/i386/os/Fedora/RPMS/ |
18 |
/mirrors/mitel/devel/repo/RPMS/ |
/builds/rpms/RPMS/i686/ |
19 |
/builds/rpms/RPMS/i686/ |
/mirrors/mitel/devel/repo/RPMS |
20 |
/builds/rpms/RPMS/i586/ |
/builds/rpms/RPMS/i586/ |
21 |
/builds/rpms/RPMS/i386/ |
/builds/rpms/RPMS/i386/ |
22 |
/builds/rpms/RPMS/noarch/ |
/builds/rpms/RPMS/noarch/ |
23 |
); |
); |
24 |
|
|
25 |
opendir RPMS, $build_dir or die "Couldn't opendir $build_dir"; |
opendir RPMS, $build_dir or die "Couldn't opendir $build_dir"; |
26 |
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("$build_dir/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS; |
50 |
} |
} |
51 |
} |
} |
52 |
@headers = reverse sort { $a cmp $b } @headers; |
@headers = reverse sort { $a cmp $b } @headers; |
53 |
if (grep { $_->filename =~ m#/centos.*/updates/# } @headers) |
if (grep { $_->filename =~ m#/centos/[\d.]+/updates/# } @headers) |
54 |
{ |
{ |
55 |
@headers = grep { $_->filename !~ m#/centos.*/os/# } @headers; |
@headers = grep { $_->filename !~ m#/centos/[\d.]+/os/# } @headers; |
56 |
} |
} |
57 |
if (grep { $_->filename =~ m#/centos.*/(updates|os|dag)/# } @headers) |
if (grep { $_->filename =~ m#/centos/[\d.]+/(updates|os)/# || $_->filename =~ m#/dag/# } @headers) |
58 |
{ |
{ |
59 |
@headers = grep { $_->filename !~ m#/fedora.*/(updates|os)/# } @headers; |
@headers = grep { $_->filename !~ m#/fedora/# } @headers; |
60 |
@headers = grep { $_->filename !~ m#/centos.*/atrpms/# } @headers; |
@headers = grep { $_->filename !~ m#/atrpms/# } @headers; |
61 |
} |
} |
62 |
if ($#headers < 0) |
if ($#headers < 0) |
63 |
{ |
{ |
64 |
print "$rpm\n"; |
print "$rpm\n"; |
65 |
print " ***** can't find $rpm in any repository *****\n"; |
print " ***** can't find $rpm in any repository *****\n"; |
66 |
} |
} |
67 |
elsif ( $headers[0]->filename !~ m#/centos.*/(updates|os)/# || $headers[0] ne $rpms{$rpm} ) |
elsif ( $headers[0]->filename !~ m#/centos/[\d.]+/(updates|os)/# || $headers[0] ne $rpms{$rpm} ) |
68 |
{ |
{ |
69 |
if (grep { $_ ne $rpms{$rpm} } @headers) |
if (grep { $_ ne $rpms{$rpm} } @headers) |
70 |
{ |
{ |