128 |
$archs = (); |
$archs = (); |
129 |
|
|
130 |
foreach my $pkg ( @pkgs ) { |
foreach my $pkg ( @pkgs ) { |
131 |
next if $pkg->{done} || $pkg->{obsolete} || $pkg->{rpm}->is_source_package || ! $repos->{$pkg->{repo}} || rprop($pkg, 'stage'); |
next if $pkg->{done} || $pkg->{obsolete} || $pkg->{rpm}->is_source_package || ! $repos->{$pkg->{repo}}; |
132 |
printline('bold black', 1, ' - ', $pkg->{rpm}->filename) if $opts{d}; |
printline('bold black', 1, ' - ', $pkg->{rpm}->filename) if $opts{d}; |
133 |
my $orig = 0; |
my $orig = 0; |
134 |
|
|
135 |
# Find names of packages in same or higher repos |
# Find names of packages in same or higher repos |
136 |
my %names = names($pkg, @pkgs); |
my %names = names($pkg, @pkgs); |
137 |
|
|
138 |
|
# Stage packages should never be most current |
139 |
|
if ( rprop($pkg, 'stage') ) { |
140 |
|
printline('dark blue', 1, ' - checking stage') if $opts{d}; |
141 |
|
tagpkg($pkg, 'obsolete'); |
142 |
|
next; |
143 |
|
} |
144 |
|
|
145 |
# Move packages from base/builds to correct area |
# Move packages from base/builds to correct area |
146 |
if ( rprop($pkg, 'base') || rprop($pkg, 'builds') ) { |
elsif ( rprop($pkg, 'base') || rprop($pkg, 'builds') ) { |
147 |
printline('dark blue', 1, ' - checking base/builds') if $opts{d}; |
printline('dark blue', 1, ' - checking base/builds') if $opts{d}; |
148 |
my $repo = $names{$pkg->{name}} && $names{$pkg->{name}} > 1 ? $devel2 : $devel1; |
my $repo = $names{$pkg->{name}} && $names{$pkg->{name}} > 1 ? $devel2 : $devel1; |
149 |
if ( $pkg->{nonbase} ) { |
if ( $pkg->{nonbase} ) { |
255 |
} |
} |
256 |
} |
} |
257 |
} |
} |
|
printline('bold black', 1, ' - missing stage packages') if $opts{d}; |
|
|
movepkg($_, $stage, 0) foreach grep { $_->{latest} && $_->{latest} == 1 } @pkgs; |
|
|
|
|
|
printline('bold black', 1, ' - obsolete packages') if $opts{d}; |
|
|
movepkg($_, 'delete') foreach grep { ! rprop($_, 'base') && ! $_->{done} && ( $_->{obsolete} || ( $_->{rpm}->is_source_package && ! $_->{inuse} ) ) } @pkgs; |
|
|
|
|
258 |
printline('bold black', 1, ' - arch count check') if $opts{d}; |
printline('bold black', 1, ' - arch count check') if $opts{d}; |
259 |
foreach my $r ( keys %$archs ) { |
foreach my $r ( keys %$archs ) { |
260 |
foreach my $p ( keys %{$archs->{$r}} ) { |
foreach my $p ( keys %{$archs->{$r}} ) { |
268 |
} |
} |
269 |
} |
} |
270 |
} |
} |
271 |
|
|
272 |
|
printline('bold black', 1, ' - missing stage packages') if $opts{d}; |
273 |
|
movepkg($_, $stage, 0) foreach grep { $_->{latest} && $_->{latest} == 1 } @pkgs; |
274 |
|
|
275 |
|
printline('bold black', 1, ' - obsolete packages') if $opts{d}; |
276 |
|
movepkg($_, 'delete') foreach grep { ! rprop($_, 'base') && ! $_->{done} && ( $_->{obsolete} || ( $_->{rpm}->is_source_package && ! $_->{inuse} ) ) } @pkgs; |
277 |
} |
} |
278 |
printline('white', 0, "Finished processing.\n"); |
printline('white', 0, "Finished processing.\n"); |
279 |
|
|
300 |
printline('white', 0, "Finished copying/moving.\n"); |
printline('white', 0, "Finished copying/moving.\n"); |
301 |
|
|
302 |
foreach my $repo ( sort keys %repochg ) { |
foreach my $repo ( sort keys %repochg ) { |
303 |
next if ! $repos->{$repo} || $repos->{$repo}->{base} || $repos->{$repo}->{builds}; |
next if ! $repos->{$repo} || $repos->{$repo}->{base} || $repos->{$repo}->{builds} || $repos->{$repo}->{stage}; |
304 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
305 |
my $dir = $distrepo->{$rel}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$rel}->{repo} . "$repo/$arch"; |
306 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
343 |
my ($pkg, @repos) = @_; |
my ($pkg, @repos) = @_; |
344 |
my @d = (); |
my @d = (); |
345 |
foreach my $repo ( @repos ) { |
foreach my $repo ( @repos ) { |
346 |
my $base = $distrepo->{$rel}->{repo}; |
my $base = $distrepo->{$rel}->{repo} . $repo; |
347 |
$base = $distrepo->{$rel}->{stage} if $repos->{$repo}->{stage}; |
$base = $distrepo->{$rel}->{stage} if $repos->{$repo}->{stage}; |
348 |
if ( $pkg->{arch} eq 'noarch' ) { |
if ( $pkg->{arch} eq 'noarch' ) { |
349 |
push @d, "$base$repo/i386/" . |
push @d, "$base/i386/" . |
350 |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
351 |
basename $pkg->{rpm}->filename; |
basename $pkg->{rpm}->filename; |
352 |
push @d, "$base$repo/x86_64/" . |
push @d, "$base/x86_64/" . |
353 |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
354 |
basename $pkg->{rpm}->filename; |
basename $pkg->{rpm}->filename; |
355 |
} elsif ( $pkg->{arch} =~ m{^(i[356]86)$} ) { |
} elsif ( $pkg->{arch} =~ m{^(i[356]86)$} ) { |
356 |
push @d, "$base$repo/i386/" . |
push @d, "$base/i386/" . |
357 |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
358 |
basename $pkg->{rpm}->filename; |
basename $pkg->{rpm}->filename; |
359 |
} elsif ( $pkg->{arch} eq 'x86_64' ) { |
} elsif ( $pkg->{arch} eq 'x86_64' ) { |
360 |
push @d, "$base$repo/x86_64/" . |
push @d, "$base/x86_64/" . |
361 |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
362 |
basename $pkg->{rpm}->filename; |
basename $pkg->{rpm}->filename; |
363 |
} elsif ( $pkg->{arch} eq 'zsrc' ) { |
} elsif ( $pkg->{arch} eq 'zsrc' ) { |
364 |
push @d, "$base$repo/SRPMS/" . |
push @d, "$base/SRPMS/" . |
365 |
basename $pkg->{rpm}->filename; |
basename $pkg->{rpm}->filename; |
366 |
} else { |
} else { |
367 |
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (bad arch: ', $pkg->{arch}, ')'); |
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (bad arch: ', $pkg->{arch}, ')'); |
490 |
nosig => $nosig, |
nosig => $nosig, |
491 |
}; |
}; |
492 |
$sources{$srcname}++; |
$sources{$srcname}++; |
493 |
$latest{$pkg->name} = $rpms[$#rpms] if ! $pkg->is_source_package && ( ! $latest{$pkg->name} || $pkg gt $latest{$pkg->name}->{rpm} ); |
if ( ! $pkg->is_source_package && ! $repos->{$reponame}->{stage} ) { |
494 |
|
$latest{$pkg->name} = $rpms[$#rpms] if ! $latest{$pkg->name} || $pkg gt $latest{$pkg->name}->{rpm}; |
495 |
|
} |
496 |
} |
} |
497 |
|
|
498 |
sub loadbase { |
sub loadbase { |
513 |
return if grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; |
return if grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; |
514 |
$pkgrepo = $repo; |
$pkgrepo = $repo; |
515 |
return unless $pkg->is_source_package || $cmp; |
return unless $pkg->is_source_package || $cmp; |
516 |
return if ! $pkg->is_source_package && $pkg gt $cmp->{rpm} && rprop($cmp, 'base') && rprop($cmp, 'prio') > $repos->{$pkgrepo}->{prio}; |
return if ! $pkg->is_source_package && $pkg ge $cmp->{rpm} && rprop($cmp, 'base') && rprop($cmp, 'prio') > $repos->{$pkgrepo}->{prio}; |
517 |
last; |
last; |
518 |
} |
} |
519 |
} |
} |