29 |
os => 'RPMS/', |
os => 'RPMS/', |
30 |
builds => '/builds/smeserver-7-core/', |
builds => '/builds/smeserver-7-core/', |
31 |
contribs => '/builds/smeserver-7-contribs/', |
contribs => '/builds/smeserver-7-contribs/', |
|
qa => '/builds/smeserver-7-qa/', |
|
32 |
stage => '/stage/7/', |
stage => '/stage/7/', |
33 |
}, |
}, |
34 |
'8' => { active => 1, |
'8' => { active => 1, |
38 |
os => '', |
os => '', |
39 |
builds => '/builds/smeserver-8-core/', |
builds => '/builds/smeserver-8-core/', |
40 |
contribs => '/builds/smeserver-8-contribs/', |
contribs => '/builds/smeserver-8-contribs/', |
|
qa => '/builds/smeserver-8-qa/', |
|
41 |
stage => '/stage/8/', |
stage => '/stage/8/', |
42 |
}, |
}, |
43 |
}; |
}; |
47 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
48 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
49 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
50 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 2 }, |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
51 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
52 |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
53 |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
95 |
} |
} |
96 |
|
|
97 |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
98 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent' ) }, |
99 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
100 |
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
101 |
}, |
}, |
102 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
103 |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
104 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent', 'smolt' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent', 'smolt' ) }, |
105 |
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
106 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
107 |
}, |
}, |
141 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
142 |
} |
} |
143 |
} |
} |
144 |
find( { wanted => sub { process_rpm($_, $smever, 'builds'); }, no_chdir => 1, follow_fast => 1 }, ( $distrepo->{$smever}->{'builds'}, $distrepo->{$smever}->{'qa'} ) ); |
find( { wanted => sub { process_rpm($_, $smever, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'builds'} ); |
145 |
find( { wanted => sub { process_rpm($_, $smever, 'contribs'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'contribs'} ); |
find( { wanted => sub { process_rpm($_, $smever, 'contribs'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'contribs'} ); |
146 |
|
|
147 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
148 |
|
next unless $rpms->{$base}->{rpms}; |
149 |
my %track = (); |
my %track = (); |
150 |
my %seen = (); |
my %seen = (); |
151 |
my %counts = (); |
my %counts = (); |
232 |
} |
} |
233 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
234 |
$cmp->{repo} = $dest; |
$cmp->{repo} = $dest; |
235 |
|
if ( ! $cmp->{src} || $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
236 |
|
$track{repo} = $dest; |
237 |
|
} |
238 |
} |
} |
239 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
240 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
244 |
if ( $track{repo} eq $cmp->{repo} ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
245 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
246 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
247 |
|
} elsif ( $cmp->{src} ) { |
248 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
249 |
} else { |
} else { |
250 |
$track{svr} = $cmp->{svr}; |
$track{svr} = $cmp->{svr}; |
251 |
} |
} |
252 |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
253 |
$cmp->{delete}++; |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
254 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
255 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
256 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
257 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
258 |
|
if ( $cmp->{src} && ! $reposrc{$dest} ) { |
259 |
|
$cmp->{delete}++; |
260 |
|
} elsif ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
261 |
|
push @{$cmp->{repos}}, $dest; |
262 |
|
$orig{$cmp->{nvra}}++; |
263 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
264 |
|
$cmp->{repo} = $dest; |
265 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
266 |
|
} else { |
267 |
|
$cmp->{delete}++; |
268 |
|
} |
269 |
|
} else { |
270 |
|
$cmp->{delete}++; |
271 |
|
} |
272 |
} |
} |
273 |
} |
} |
274 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
293 |
} |
} |
294 |
} |
} |
295 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
296 |
print "\n * missing source (", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
297 |
} |
} |
298 |
print "\n * missing originals (", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
print "\n * missing originals (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
299 |
} |
} |
300 |
|
|
301 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
327 |
|
|
328 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
329 |
if ( $pkg->{nosig} ) { |
if ( $pkg->{nosig} ) { |
330 |
print "sign package (", $pkg->{repo}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
331 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
332 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
333 |
if ($?) { |
if ($?) { |
371 |
} |
} |
372 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
373 |
} elsif ( $pkg->{delete} ) { |
} elsif ( $pkg->{delete} ) { |
374 |
print "delete from ", $pkg->{repo}, " (", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
375 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
376 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
377 |
} |
} |
390 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
391 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
392 |
if ( -f "$dir/repodata/comps.xml" ) { |
if ( -f "$dir/repodata/comps.xml" ) { |
393 |
qx(createrepo -g $dir/repodata/comps.xml $dir); |
qx(createrepo -g repodata/comps.xml $dir); |
394 |
} else { |
} else { |
395 |
qx(createrepo $dir); |
qx(createrepo $dir); |
396 |
} |
} |
401 |
} |
} |
402 |
} |
} |
403 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
404 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs','qa'); |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
405 |
} |
} |
406 |
} |
} |
407 |
|
|
460 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
461 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
462 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
463 |
|
my $arch = 'unknown'; |
464 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
465 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
466 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
467 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
468 |
|
|
469 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
470 |
name => $pkg->name, |
name => $pkg->name, |
472 |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
473 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
474 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
475 |
|
arch => $arch, |
476 |
ver => $version, |
ver => $version, |
477 |
rel => $release, |
rel => $release, |
478 |
rpm => $pkg, |
rpm => $pkg, |