11 |
|
|
12 |
my $releasedir = '/releases'; |
my $releasedir = '/releases'; |
13 |
my $smerel = '7'; |
my $smerel = '7'; |
|
my $arch = 'i386'; |
|
14 |
my $centosrel = '4'; |
my $centosrel = '4'; |
15 |
my $fedorarel = '3'; |
my $fedorarel = '3'; |
16 |
my $builds = '/builds/rpms'; |
my $builds = '/builds/rpms'; |
17 |
my $stagedir = '/builds'; |
my $stagedir = '/builds'; |
18 |
|
my $arch = `uname -i`; |
19 |
|
chomp $arch; |
20 |
|
|
21 |
my @repos = ( |
my @repos = ( |
22 |
"$releasedir/$smerel/smeos/$arch/CentOS/RPMS", |
"$releasedir/$smerel/smeos/$arch/CentOS/RPMS", |
23 |
|
"$releasedir/$smerel/smeos/$arch/SME/RPMS", |
24 |
|
"$releasedir/$smerel/smeos/$arch/RPMS", |
25 |
|
"$releasedir/$smerel/smeos/$arch/SME", |
26 |
"$releasedir/$smerel/smeupdates/$arch/RPMS", |
"$releasedir/$smerel/smeupdates/$arch/RPMS", |
27 |
"$releasedir/$smerel/smeupdates-testing/$arch/RPMS", |
"$releasedir/$smerel/smeupdates-testing/$arch/RPMS", |
28 |
"$releasedir/$smerel/smeextras/$arch/RPMS", |
"$releasedir/$smerel/smeextras/$arch/RPMS", |
43 |
"/mirrors/centos/$centosrel/extras/SRPMS", |
"/mirrors/centos/$centosrel/extras/SRPMS", |
44 |
"/mirrors/rpmforge/dag/source", |
"/mirrors/rpmforge/dag/source", |
45 |
"/mirrors/atrpms/src/el$centosrel-$arch/atrpms/stable", |
"/mirrors/atrpms/src/el$centosrel-$arch/atrpms/stable", |
46 |
|
"/mirrors/fedora/epel/$centosrel/SRPMS", |
47 |
"/mirrors/fedora/core/updates/$fedorarel/SRPMS", |
"/mirrors/fedora/core/updates/$fedorarel/SRPMS", |
48 |
"/mirrors/fedora/core/$fedorarel/source/SRPMS", |
"/mirrors/fedora/core/$fedorarel/source/SRPMS", |
49 |
"/mirrors/fedora/extras/$fedorarel/SRPMS", |
"/mirrors/fedora/extras/$fedorarel/SRPMS", |
128 |
@{$repohash{$pkg}{$pos}} = grep { $_ gt $repohash{$pkg}{latest} } @{$repohash{$pkg}{$pos}}; |
@{$repohash{$pkg}{$pos}} = grep { $_ gt $repohash{$pkg}{latest} } @{$repohash{$pkg}{$pos}}; |
129 |
delete $repohash{$pkg}{$pos}; |
delete $repohash{$pkg}{$pos}; |
130 |
} |
} |
131 |
} else { |
} elsif ( ref($repohash{$pkg}{$pos}) eq 'ARRAY' ) { |
132 |
my ($latest, @rest) = sort { $b cmp $a } @{$repohash{$pkg}{$pos}}; |
my ($latest, @rest) = sort { $b cmp $a } @{$repohash{$pkg}{$pos}}; |
133 |
delete $repohash{$pkg}{$pos}; |
delete $repohash{$pkg}{$pos}; |
134 |
if ( $repohash{$pkg}{latest} && $repohash{$pkg}{latest} ge $latest ) { |
if ( $repohash{$pkg}{latest} && $repohash{$pkg}{latest} ge $latest ) { |
185 |
foreach my $pkg ( sort grep { $repohash{$_}{$repo} } keys %repohash ) { |
foreach my $pkg ( sort grep { $repohash{$_}{$repo} } keys %repohash ) { |
186 |
my @rpms = ref($repohash{$pkg}{$repo}) eq "ARRAY" ? @{$repohash{$pkg}{$repo}} : ($repohash{$pkg}{$repo}); |
my @rpms = ref($repohash{$pkg}{$repo}) eq "ARRAY" ? @{$repohash{$pkg}{$repo}} : ($repohash{$pkg}{$repo}); |
187 |
foreach my $rpm ( sort @rpms ) { |
foreach my $rpm ( sort @rpms ) { |
188 |
my $src = $rpm->tag("SOURCERPM"); |
my $src; |
189 |
|
|
190 |
my @sources = (); |
my @sources = (); |
191 |
push @sources, $src; |
push @sources, ($src = $rpm->tag("SOURCERPM")); |
192 |
push @sources, $src if ($src =~ s/\.\d+\.el\d+\.rf\./\.rf\./); |
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.el\d\.rf\./\.rf\./); |
193 |
push @sources, $src if ($src =~ s/\.el\d\.rf\./\.rf\./); |
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.[0-3]\.el\d+\.rf\./\.rf\./); |
194 |
push @sources, $src if ($src =~ s/\.el\d\.at\./\.at\./); |
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.(el|fc)\d\.at//); |
195 |
push @sources, $src if ($src =~ s/\.fc\d\.at\./\.at\./); |
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.at//); |
196 |
push @sources, $src if ($src =~ s/\.rf\./\.dag\./); |
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.(el|fc)\d//); |
197 |
|
push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.\d+\.(el|fc)\d//); |
198 |
|
$src = $rpm->tag("SOURCERPM"); |
199 |
|
|
200 |
my $found = 0; |
my $found = 0; |
201 |
foreach my $source ( @sources ) { |
foreach my $source ( @sources ) { |
243 |
foreach my $repo ( sort keys %changed ) { |
foreach my $repo ( sort keys %changed ) { |
244 |
next if $repo =~ m{^$stagedir}; |
next if $repo =~ m{^$stagedir}; |
245 |
|
|
246 |
print "rebuilding $repo/$arch...\n"; |
my $dir=`readlink -f $repo/$arch`; |
247 |
system(qw(createrepo), "$repo/$arch"); |
chomp $dir; |
248 |
system(qw(repoview), "$repo/$arch"); |
print "rebuilding $dir...\n"; |
249 |
|
system(qw(createrepo), "$dir"); |
250 |
|
system(qw(repoview), "$dir"); |
251 |
} |
} |
252 |
|
|