222 |
} else { |
} else { |
223 |
$cmp->{delete}++; |
$cmp->{delete}++; |
224 |
} |
} |
225 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
226 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
227 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
228 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
229 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
230 |
} |
} |
231 |
} else { |
} elsif ( $cmp->{src} ) { |
232 |
if ( $cmp->{src} && $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
233 |
$cmp->{repo} = $cmp->{oldrepo}; |
$cmp->{repo} = $cmp->{oldrepo}; |
234 |
delete $cmp->{delete}; |
delete $cmp->{delete}; |
235 |
} |
} |
236 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $reposrc{$cmp->{repo}} ) { |
237 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
238 |
$srpm = $cmp if ! $srpm; |
$srpm = $cmp if ! $srpm; |
239 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
240 |
$cmp->{delete}++; |
$cmp->{delete}++; |
241 |
} |
} |
242 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
243 |
|
$cmp->{delete}++; |
244 |
|
} |
245 |
|
} elsif ( $cmp->{src} ) { |
246 |
|
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
247 |
|
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
248 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
249 |
|
]; |
250 |
|
|
251 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
252 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
253 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
254 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
255 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
256 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
257 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
258 |
|
} else { |
259 |
|
warn "How did I get here??"; |
260 |
|
} |
261 |
|
} else { |
262 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
263 |
} |
} |
264 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
265 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
266 |
} |
} |
267 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
268 |
$cmp->{delete}++; |
$cmp->{delete}++; |
336 |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
337 |
} |
} |
338 |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
339 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
340 |
} |
} |
341 |
$cmp->{done}++; |
$cmp->{done}++; |
342 |
} |
} |