From 2779f69a44689c20fd4fe08731162689f2d9019a Mon Sep 17 00:00:00 2001 From: espie Date: Sun, 27 Jul 2014 22:18:36 +0000 Subject: [PATCH] - log libraries in a proper way - mark wanted libraries, then run the db check. Gives you a way to figure out when locate db are behind wrt pkgs --- usr.sbin/pkg_add/OpenBSD/PkgCheck.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index bcb92885e3c..9b5ab64ffd5 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.53 2014/07/14 08:47:49 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.54 2014/07/27 22:18:36 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -255,6 +255,7 @@ sub find_dependencies my $i = $lib->origin; if ($i eq 'system') { $okay = 1; + $state->{needed_libs}{$lib->to_string} = 1; next; } if ($checker->find($i)) { @@ -684,6 +685,7 @@ sub dependencies_check OpenBSD::SharedLibs::add_libs_from_system($state->{destdir}, $state); $self->for_all_packages($state, $l, "Direct dependencies", sub { my $name = shift; + $state->log->set_context($name); my $plist = OpenBSD::PackingList->from_installation($name, \&OpenBSD::PackingList::DependOnly); my $checker = OpenBSD::DirectDependencyCheck->new($state, @@ -791,6 +793,15 @@ sub display_tmps } } +sub display_unregs +{ + my ($self, $state) = @_; + $state->say("System libs NOT in locate dbs:"); + for my $e (sort @{$state->{unreg_libs}}) { + $state->say("\t#1", $e); + } +} + sub locate_unknown { my ($self, $state) = @_; @@ -857,6 +868,10 @@ sub filesystem_check delete $state->{basesystem}{$File::Find::name}; return; } + if (defined $state->{needed_libs}{$File::Find::name}) { + push(@{$state->{unreg_libs}}, $File::Find::name); + return; + } if (-d $_) { if ($_ eq "lost+found") { $state->say("fsck(8) info found: #1", @@ -889,6 +904,9 @@ sub filesystem_check if (defined $state->{tmps}) { $self->display_tmps($state); } + if (defined $state->{unreg_libs}) { + $self->display_unregs($state); + } if (defined $state->{unknown}) { if ($self->install_pkglocate($state)) { $self->locate_unknown($state); -- 2.20.1