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 |
|
$track{repo} = $dest unless $dest eq $track{repo}; |
236 |
} |
} |
237 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
238 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
242 |
if ( $track{repo} eq $cmp->{repo} ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
243 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
244 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
245 |
|
} elsif ( $cmp->{src} ) { |
246 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
247 |
} else { |
} else { |
248 |
$track{svr} = $cmp->{svr}; |
$track{svr} = $cmp->{svr}; |
249 |
} |
} |
250 |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
251 |
$cmp->{delete}++; |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
252 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
253 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
254 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
255 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
256 |
|
unless ( verrel($cmp, $dest, \%counts) ) { |
257 |
|
push @{$cmp->{repos}}, $dest; |
258 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
259 |
|
$orig{$cmp->{nvra}}++; |
260 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
261 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
262 |
|
} else { |
263 |
|
$cmp->{delete}++; |
264 |
|
} |
265 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
266 |
|
$cmp->{repo} = $dest; |
267 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
268 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
269 |
|
} |
270 |
|
} else { |
271 |
|
$cmp->{delete}++; |
272 |
|
} |
273 |
|
} else { |
274 |
|
$cmp->{delete}++; |
275 |
|
} |
276 |
} |
} |
277 |
} |
} |
278 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
297 |
} |
} |
298 |
} |
} |
299 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
300 |
print "\n * missing source (", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
301 |
} |
} |
302 |
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; |
303 |
} |
} |
304 |
|
|
305 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
331 |
|
|
332 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
333 |
if ( $pkg->{nosig} ) { |
if ( $pkg->{nosig} ) { |
334 |
print "sign package (", $pkg->{repo}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
335 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
336 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
337 |
if ($?) { |
if ($?) { |
375 |
} |
} |
376 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
377 |
} elsif ( $pkg->{delete} ) { |
} elsif ( $pkg->{delete} ) { |
378 |
print "delete from ", $pkg->{repo}, " (", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
379 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
380 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
381 |
} |
} |
394 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
395 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
396 |
if ( -f "$dir/repodata/comps.xml" ) { |
if ( -f "$dir/repodata/comps.xml" ) { |
397 |
qx(createrepo -g $dir/repodata/comps.xml $dir); |
qx(createrepo -g repodata/comps.xml $dir); |
398 |
} else { |
} else { |
399 |
qx(createrepo $dir); |
qx(createrepo $dir); |
400 |
} |
} |
405 |
} |
} |
406 |
} |
} |
407 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
408 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs','qa'); |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
409 |
} |
} |
410 |
} |
} |
411 |
|
|
464 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
465 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
466 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
467 |
|
my $arch = 'unknown'; |
468 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
469 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
470 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
471 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
472 |
|
|
473 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
474 |
name => $pkg->name, |
name => $pkg->name, |
476 |
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') ), |
477 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
478 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
479 |
|
arch => $arch, |
480 |
ver => $version, |
ver => $version, |
481 |
rel => $release, |
rel => $release, |
482 |
rpm => $pkg, |
rpm => $pkg, |