137 |
|
|
138 |
# Stage packages should never be most current |
# Stage packages should never be most current |
139 |
if ( rprop($pkg, 'stage') ) { |
if ( rprop($pkg, 'stage') ) { |
140 |
|
printline('dark blue', 1, ' - checking stage') if $opts{d}; |
141 |
tagpkg($pkg, 'obsolete'); |
tagpkg($pkg, 'obsolete'); |
142 |
next; |
next; |
143 |
} |
} |
189 |
tagpkg($cmp, 'inuse'); |
tagpkg($cmp, 'inuse'); |
190 |
$pkg->{srpm}->{latest}++; |
$pkg->{srpm}->{latest}++; |
191 |
} |
} |
192 |
tagpkg($cmp, 'inuse') if $pkg->{repo} eq $cmp->{repo} || rprop($cmp, 'base') || rprop($cmp, 'builds'); |
if ( $pkg->{repo} eq $cmp->{repo} || rprop($cmp, 'base') || rprop($cmp, 'builds') || ( $cmp->{oldrepo} && $pkg->{repo} eq $cmp->{oldrepo} ) ) { |
193 |
|
tagpkg($cmp, 'inuse') |
194 |
|
} |
195 |
} |
} |
196 |
next if $pkg->{srpm} && $pkg->{srpm}->{rpm} eq $pkg->{rpm}; |
next if $pkg->{srpm} && $pkg->{srpm}->{rpm} eq $pkg->{rpm}; |
197 |
|
|
248 |
printline('dark blue', 1, ' - checking source packages') if $opts{d}; |
printline('dark blue', 1, ' - checking source packages') if $opts{d}; |
249 |
if ( ! $pkg->{srpm} ) { |
if ( ! $pkg->{srpm} ) { |
250 |
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (missing source ', $pkg->{rpm}->sourcerpm, ')'); |
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (missing source ', $pkg->{rpm}->sourcerpm, ')'); |
251 |
} elsif ( $pkg->{srpm}->{repo} ne $pkg->{repo} ) { |
} elsif ( $pkg->{srpm}->{repo} ne $pkg->{repo} && ( ! $pkg->{srpm}->{oldrepo} || $pkg->{srpm}->{oldrepo} ne $pkg->{repo} ) ) { |
252 |
movepkg($pkg->{srpm}, $pkg->{repo}, 0); |
movepkg($pkg->{srpm}, $pkg->{repo}, 0); |
253 |
} |
} |
254 |
unless ( $orig ) { |
unless ( $orig ) { |
257 |
} |
} |
258 |
} |
} |
259 |
} |
} |
|
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; |
|
|
|
|
260 |
printline('bold black', 1, ' - arch count check') if $opts{d}; |
printline('bold black', 1, ' - arch count check') if $opts{d}; |
261 |
foreach my $r ( keys %$archs ) { |
foreach my $r ( keys %$archs ) { |
262 |
foreach my $p ( keys %{$archs->{$r}} ) { |
foreach my $p ( keys %{$archs->{$r}} ) { |
270 |
} |
} |
271 |
} |
} |
272 |
} |
} |
273 |
|
|
274 |
|
printline('bold black', 1, ' - missing stage packages') if $opts{d}; |
275 |
|
movepkg($_, $stage, 0) foreach grep { $_->{latest} && $_->{latest} == 1 } @pkgs; |
276 |
|
|
277 |
|
printline('bold black', 1, ' - obsolete packages') if $opts{d}; |
278 |
|
movepkg($_, 'delete') foreach grep { ! rprop($_, 'base') && ! $_->{done} && ( $_->{obsolete} || ( $_->{rpm}->is_source_package && ! $_->{inuse} ) ) } @pkgs; |
279 |
} |
} |
280 |
printline('white', 0, "Finished processing.\n"); |
printline('white', 0, "Finished processing.\n"); |
281 |
|
|
465 |
if ($@) { printline('bold yellow on_red', 1, "Corrupt package $_"); return; } |
if ($@) { printline('bold yellow on_red', 1, "Corrupt package $_"); return; } |
466 |
eval { my $sig = $pkg->siggpg }; |
eval { my $sig = $pkg->siggpg }; |
467 |
my $nosig = ! $@; |
my $nosig = ! $@; |
|
if ( $nosig && ! -f "$HOME/.rpmpass" ) { |
|
|
printline('bold yellow on_red', 1, ' - ', $pkg->filename, ' (missing signature)'); |
|
|
return; |
|
|
} |
|
468 |
|
|
469 |
my ($srcname, $version, $release) = ($pkg->is_source_package ? basename $pkg->filename : $pkg->sourcerpm) =~ m{^([^/]*)-([^-]+)-([^-]+)\.\w+.rpm}; |
my ($srcname, $version, $release) = ($pkg->is_source_package ? basename $pkg->filename : $pkg->sourcerpm) =~ m{^([^/]*)-([^-]+)-([^-]+)\.\w+.rpm}; |
470 |
foreach my $repo ( keys %{$skippkg->{$rel}} ) { return if (dirname $pkg->filename) =~ m{/$repo/} && grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; } |
foreach my $repo ( keys %{$skippkg->{$rel}} ) { return if (dirname $pkg->filename) =~ m{/$repo/} && grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; } |
476 |
} elsif ( (dirname $pkg->filename) =~ m{\d/(sme[^/]+)/} ) { |
} elsif ( (dirname $pkg->filename) =~ m{\d/(sme[^/]+)/} ) { |
477 |
$reponame = $1; |
$reponame = $1; |
478 |
} |
} |
479 |
|
if ( $nosig && ( ! -f "$HOME/.rpmpass" || $reponame eq 'builds' ) ) { |
480 |
|
printline('bold yellow on_red', 1, ' - ', $pkg->filename, ' (missing signature)'); |
481 |
|
return; |
482 |
|
} |
483 |
push @rpms, { base => $srcname, |
push @rpms, { base => $srcname, |
484 |
name => $pkg->name, |
name => $pkg->name, |
485 |
repo => $reponame, |
repo => $reponame, |