49 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
50 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
51 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
52 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 2 }, |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
53 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
54 |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
55 |
'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 }, |
97 |
} |
} |
98 |
|
|
99 |
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' ) }, |
100 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent' ) }, |
101 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
102 |
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
103 |
}, |
}, |
104 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
105 |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
106 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent', 'smolt' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent', 'smolt' ) }, |
107 |
'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' ) }, |
108 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
109 |
}, |
}, |
147 |
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'} ); |
148 |
|
|
149 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
150 |
|
next unless $rpms->{$base}->{rpms}; |
151 |
my %track = (); |
my %track = (); |
152 |
my %seen = (); |
my %seen = (); |
153 |
my %counts = (); |
my %counts = (); |
234 |
} |
} |
235 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
236 |
$cmp->{repo} = $dest; |
$cmp->{repo} = $dest; |
237 |
|
$track{repo} = $dest unless $dest eq $track{repo}; |
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 |
|
unless ( verrel($cmp, $dest, \%counts) ) { |
259 |
|
push @{$cmp->{repos}}, $dest; |
260 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
261 |
|
$orig{$cmp->{nvra}}++; |
262 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
263 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
264 |
|
} else { |
265 |
|
$cmp->{delete}++; |
266 |
|
} |
267 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
268 |
|
$cmp->{repo} = $dest; |
269 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
270 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
271 |
|
} |
272 |
|
} else { |
273 |
|
$cmp->{delete}++; |
274 |
|
} |
275 |
|
} else { |
276 |
|
$cmp->{delete}++; |
277 |
|
} |
278 |
} |
} |
279 |
} |
} |
280 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
299 |
} |
} |
300 |
} |
} |
301 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
302 |
print "\n * missing source (", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
303 |
} |
} |
304 |
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; |
305 |
} |
} |
306 |
|
|
307 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
333 |
|
|
334 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
335 |
if ( $pkg->{nosig} ) { |
if ( $pkg->{nosig} ) { |
336 |
print "sign package (", $pkg->{repo}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
337 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
338 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
339 |
if ($?) { |
if ($?) { |
377 |
} |
} |
378 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
379 |
} elsif ( $pkg->{delete} ) { |
} elsif ( $pkg->{delete} ) { |
380 |
print "delete from ", $pkg->{repo}, " (", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
381 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
382 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
383 |
} |
} |
396 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
397 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
398 |
if ( -f "$dir/repodata/comps.xml" ) { |
if ( -f "$dir/repodata/comps.xml" ) { |
399 |
qx(createrepo -g $dir/repodata/comps.xml $dir); |
qx(createrepo -g repodata/comps.xml $dir); |
400 |
} else { |
} else { |
401 |
qx(createrepo $dir); |
qx(createrepo $dir); |
402 |
} |
} |
466 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
467 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
468 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
469 |
|
my $arch = 'unknown'; |
470 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
471 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
472 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
473 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
474 |
|
|
475 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
476 |
name => $pkg->name, |
name => $pkg->name, |
478 |
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') ), |
479 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
480 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
481 |
|
arch => $arch, |
482 |
ver => $version, |
ver => $version, |
483 |
rel => $release, |
rel => $release, |
484 |
rpm => $pkg, |
rpm => $pkg, |