10 |
getopts( "s:", \%opts ); |
getopts( "s:", \%opts ); |
11 |
my $src = $opts{s} || '/builds/RPMS'; |
my $src = $opts{s} || '/builds/RPMS'; |
12 |
|
|
13 |
my $rpm_flags = RPM2->vsf_nodsa; |
my $arch = 'i386'; |
14 |
my @repositories = qw( |
my $centosrel = '4'; |
15 |
/mirrors/centos/4/fasttrack/i386/RPMS/ |
my $fedorarel = '3'; |
16 |
/mirrors/centos/4/updates/i386/RPMS/ |
my $builds = '/builds/rpms'; |
17 |
/mirrors/centos/4/os/i386/CentOS/RPMS/ |
|
18 |
/mirrors/centos/4/extras/i386/RPMS/ |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_nodsa; |
19 |
/mirrors/rpmforge/dag/redhat/el4/en/i386/dag/RPMS/ |
my @repos = ( |
20 |
/mirrors/atrpms/el4-i386/atrpms/stable/ |
"/mirrors/centos/$centosrel/fasttrack/$arch/RPMS", |
21 |
/mirrors/rpmforge/dag/dries/redhat/el4/en/i386/RPMS.dries/ |
"/mirrors/centos/$centosrel/updates/$arch/RPMS", |
22 |
/mirrors/fedora-legacy/fedora/3/updates/i386/ |
"/mirrors/centos/$centosrel/os/$arch/CentOS/RPMS", |
23 |
/mirrors/fedora-legacy/fedora/3/os/i386/ |
"/mirrors/centos/$centosrel/extras/$arch/RPMS", |
24 |
/builds/rpms/RPMS/i686/ |
"/mirrors/fedora/epel/$centosrel/$arch", |
25 |
/builds/rpms/RPMS/i586/ |
"/mirrors/rpmforge/dag/redhat/el$centosrel/en/$arch/dag/RPMS", |
26 |
/builds/rpms/RPMS/i386/ |
"/mirrors/atrpms/el$centosrel-$arch/atrpms/stable", |
27 |
/builds/rpms/RPMS/noarch/ |
"/mirrors/fedora/core/updates/$fedorarel/$arch", |
28 |
); |
"/mirrors/fedora/core/$fedorarel/$arch/os/Fedora/RPMS", |
29 |
|
"/mirrors/fedora/extras/$fedorarel/$arch", |
30 |
|
"$builds/RPMS/i686", |
31 |
|
"$builds/RPMS/i586", |
32 |
|
"$builds/RPMS/$arch", |
33 |
|
"$builds/RPMS/noarch", |
34 |
|
); |
35 |
|
|
36 |
opendir RPMS, $src or die "Couldn't opendir $src"; |
opendir RPMS, $src or die "Couldn't opendir $src"; |
37 |
my %rpms = map { my $x = RPM2->open_package("$src/$_", $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; |
38 |
closedir RPMS; |
closedir RPMS; |
39 |
|
|
40 |
my %repos; |
my %repos; |
41 |
foreach my $repo (reverse @repositories) |
foreach my $repo (reverse @repos) |
42 |
{ |
{ |
43 |
my %temp_repo = map { $_ => $repo } grep { /\.rpm$/ } readdir RPMS if ( opendir RPMS, $repo ); |
my %temp_repo = map { $_ => $repo } grep { /\.rpm$/ } readdir RPMS if ( opendir RPMS, $repo ); |
44 |
closedir RPMS; |
closedir RPMS; |