14 |
$| = 1; |
$| = 1; |
15 |
|
|
16 |
my %opts; |
my %opts; |
17 |
getopts( 'otr:', \%opts ); |
getopts( 'osqtr:', \%opts ); |
18 |
$opts{r} ||= ''; |
$opts{r} ||= ''; |
19 |
|
|
20 |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
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 }, |
76 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
77 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
78 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
|
'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/' => 'centos', |
|
79 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
80 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
81 |
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
89 |
'/mirrors/fedora/core/updates/~F/~A/' => 'fedora', |
'/mirrors/fedora/core/updates/~F/~A/' => 'fedora', |
90 |
}; |
}; |
91 |
|
|
92 |
|
if ( $opts{q} ) { |
93 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
94 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
95 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
96 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
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 = (); |
158 |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
159 |
next if $pkg->{done}; |
next if $pkg->{done}; |
160 |
|
|
161 |
if ( $rpms->{$base}->{vers}->{$pkg->{svr}} ) { |
my $tmp = $pkg->{svr}; |
162 |
foreach my $tmp ( @{$rpms->{$base}->{vers}->{$pkg->{svr}}} ) { |
SRC: { |
163 |
|
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
164 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
165 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
166 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
167 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
168 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
169 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
170 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
171 |
|
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
172 |
|
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
173 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
174 |
|
} |
175 |
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
176 |
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
177 |
$tmp->{svr} = $pkg->{svr}; |
$tmp->{svr} = $pkg->{svr}; |
178 |
push @{$rpms->{$base}->{rpms}}, $tmp; |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
179 |
} |
$tmp->{added}++; |
|
} else { |
|
|
my $tmp = $pkg->{svr}; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
|
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
|
|
$tmp->{svr} = $pkg->{svr}; |
|
|
push @{$rpms->{$base}->{rpms}}, $tmp; |
|
|
} |
|
180 |
} |
} |
181 |
} |
} |
182 |
|
|
184 |
my %pkgs = (); |
my %pkgs = (); |
185 |
my %reposrc = (); |
my %reposrc = (); |
186 |
my $srpm = undef; |
my $srpm = undef; |
187 |
foreach my $cmp ( sort { $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} || $a->{src} <=> $b->{src} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
188 |
next unless $cmp->{svr} eq $pkg->{svr}; |
next unless $cmp->{svr} eq $pkg->{svr}; |
189 |
|
|
190 |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
|
$track{repo} = $cmp->{repo}; |
|
|
$track{svr} = $cmp->{svr}; |
|
|
} |
|
|
if ( $cmp->{svr} eq $track{svr} ) { |
|
191 |
if ( $cmp->{src} ) { |
if ( $cmp->{src} ) { |
192 |
$srpm = $cmp unless $srpm; |
if ( ! $track{repo} ) { |
|
if ( $reposrc{$cmp->{repo}} ) { |
|
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
|
|
$cmp->{latest}++ if $reposrc{$cmp->{repo}}->{latest}; |
|
|
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
|
193 |
$cmp->{delete}++; |
$cmp->{delete}++; |
194 |
|
$cmp->{done}++; |
195 |
|
next; |
196 |
} |
} |
197 |
} elsif ( $seen{$cmp->{nvra}} ) { |
} else { |
198 |
|
$track{repo} = $cmp->{repo}; |
199 |
|
$track{svr} = $cmp->{svr}; |
200 |
|
} |
201 |
|
} |
202 |
|
if ( $cmp->{svr} eq $track{svr} ) { |
203 |
|
if ( $seen{$cmp->{nvra}} ) { |
204 |
if ( $track{repo} ne $cmp->{repo} ) { |
if ( $track{repo} ne $cmp->{repo} ) { |
205 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
206 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
210 |
} |
} |
211 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
212 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
213 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
214 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
215 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
216 |
$cmp->{delete}++; |
$cmp->{delete}++; |
217 |
} |
} |
219 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
220 |
$cmp->{delete}++; |
$cmp->{delete}++; |
221 |
} else { |
} else { |
222 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
223 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
224 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
225 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
227 |
push @{$cmp->{repos}}, $dest; |
push @{$cmp->{repos}}, $dest; |
228 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
229 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
230 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
231 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
232 |
} else { |
} else { |
233 |
$cmp->{delete}++; |
$cmp->{delete}++; |
234 |
} |
} |
235 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
236 |
$cmp->{repo} = $dest; |
$cmp->{repo} = $dest; |
237 |
} |
} |
238 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
239 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
240 |
|
} |
241 |
} |
} |
242 |
} else { |
} else { |
243 |
if ( $track{repo} eq $cmp->{repo} ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
244 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
245 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
246 |
|
} elsif ( $cmp->{src} ) { |
247 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
248 |
} else { |
} else { |
249 |
$track{svr} = $cmp->{svr}; |
$track{svr} = $cmp->{svr}; |
250 |
} |
} |
252 |
$cmp->{delete}++; |
$cmp->{delete}++; |
253 |
} |
} |
254 |
} |
} |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{delete} || $repos->{$cmp->{repo}}->{base}; |
|
255 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
256 |
$pkgs{$cmp->{nvra}}++; |
$pkgs{$cmp->{nvra}}++; |
257 |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
258 |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
259 |
unless ( $seen{$cmp->{nvra}} ) { |
unless ( $seen{$cmp->{nvra}} ) { |
260 |
$seen{$cmp->{nvra}} = $cmp; |
$seen{$cmp->{nvra}} = $cmp; |
261 |
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
265 |
$cmp->{done}++; |
$cmp->{done}++; |
266 |
} |
} |
267 |
if ( $srpm ) { |
if ( $srpm ) { |
268 |
foreach my $r ( keys %reposrc ) { |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
|
next if $repos->{$r}->{orig}; |
|
269 |
unless ( $reposrc{$r}->{srpm} ) { |
unless ( $reposrc{$r}->{srpm} ) { |
270 |
push @{$srpm->{repos}}, $r; |
unshift @{$srpm->{repos}}, $r; |
|
$pkgs{$srpm->{nvra}}++; |
|
|
$orig{$srpm->{nvra}}++ if $repos->{$srpm->{repo}}->{orig}; |
|
271 |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
272 |
$srpm->{repo} = $r; |
$srpm->{repo} = $r; |
273 |
$reposrc{$r}->{srpm} = $srpm; |
$reposrc{$r}->{srpm} = $srpm; |
274 |
} |
} |
275 |
} |
} |
276 |
} elsif ( scalar keys %pkgs ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
277 |
print "\n * missing source (", $pkg->{svr}, ")\n"; |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
278 |
} |
} |
279 |
print "\n * missing originals (", $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; |
280 |
} |
} |
281 |
|
|
282 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
352 |
} |
} |
353 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
354 |
} elsif ( $pkg->{delete} ) { |
} elsif ( $pkg->{delete} ) { |
355 |
print "delete from ", $pkg->{repo}, " (", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
356 |
qx(rm -f $src); |
qx(rm -f $src) unless $opts{t}; |
357 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
358 |
} |
} |
359 |
} |
} |
371 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
372 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
373 |
if ( -f "$dir/repodata/comps.xml" ) { |
if ( -f "$dir/repodata/comps.xml" ) { |
374 |
qx(createrepo -g $dir/repodata/comps.xml $dir); |
qx(createrepo -g repodata/comps.xml $dir); |
375 |
} else { |
} else { |
376 |
qx(createrepo $dir); |
qx(createrepo $dir); |
377 |
} |
} |
391 |
my $repo = shift; |
my $repo = shift; |
392 |
my $counts = shift; |
my $counts = shift; |
393 |
|
|
394 |
|
return 0 if $pkg->{src}; |
395 |
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
396 |
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
397 |
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
405 |
my $pkgs = shift; |
my $pkgs = shift; |
406 |
|
|
407 |
foreach my $cmp ( @$pkgs ) { |
foreach my $cmp ( @$pkgs ) { |
408 |
next if $cmp->{src} || $cmp->{name} ne $pkg->{name} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
409 |
|
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
410 |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
411 |
$dest = $hirepo; |
$dest = $hirepo; |
412 |
last; |
last; |
441 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
442 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
443 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
444 |
|
my $arch = 'unknown'; |
445 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
446 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
447 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
448 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
449 |
|
|
450 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
451 |
name => $pkg->name, |
name => $pkg->name, |
453 |
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') ), |
454 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
455 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
456 |
|
arch => $arch, |
457 |
ver => $version, |
ver => $version, |
458 |
rel => $release, |
rel => $release, |
459 |
rpm => $pkg, |
rpm => $pkg, |