summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-06-07 09:10:38 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-06-07 09:10:38 +0000
commit2cab1059b992862e9390ed895b4d8cb0054d8e18 (patch)
tree381d027e81932df5b3660f72baf924b3b85c1ea6 /usr.sbin
parentcc4f0e39d42d30356517a67cdaf363c3d7a1377a (diff)
add shared libraries while sanity check, so that we can check wantlib.
With this +REQUIRING should be "complete" (not that this does not check that the packages are reachable through closure, just that +REQUIRING is sane).
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCheck.pm38
1 files changed, 35 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm
index 8e944d8a5fe..f88633f5439 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.3 2010/06/06 09:08:44 espie Exp $
+# $OpenBSD: PkgCheck.pm,v 1.4 2010/06/07 09:10:37 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -21,6 +21,7 @@ use strict;
use warnings;
use OpenBSD::AddCreateDelete;
+use OpenBSD::SharedLibs;
package OpenBSD::PackingElement;
sub thorough_check
@@ -174,6 +175,33 @@ sub find_dependencies
}
}
+package OpenBSD::PackingElement::Wantlib;
+sub find_dependencies
+{
+ my ($self, $state, $l, $not_yet, $possible, $others) = @_;
+ my $r = OpenBSD::SharedLibs::lookup_libspec($state->{localbase},
+ $self->spec);
+ if (defined $r) {
+ my $okay = 0;
+ for my $lib (@$r) {
+ my $i = $lib->origin;
+ if ($i eq 'system') {
+ $okay = 1;
+ next;
+ }
+ if ($possible->{$i}) {
+ delete $not_yet->{$i};
+ $okay = 1;
+ }
+ }
+ if (!$okay) {
+ $others->{$r->[0]->origin} = 1;
+ }
+ } else {
+ $state->log($self->stringize, " not found\n");
+ }
+}
+
package OpenBSD::Log;
use OpenBSD::Error;
our @ISA = qw(OpenBSD::Error);
@@ -330,6 +358,7 @@ sub sanity_check
$state->errsay("$name: pkgname does not match");
$self->may_remove($state, $name);
}
+ $plist->mark_available_lib($plist->pkgname);
}
}
@@ -337,6 +366,7 @@ sub dependencies_check
{
my ($self, $state, $l) = @_;
$state->progress->set_header("Dependencies");
+ OpenBSD::SharedLibs::add_libs_from_system($state->{destdir});
my $i = 0;
for my $name (@$l) {
$state->progress->show(++$i, scalar @$l);
@@ -347,6 +377,7 @@ sub dependencies_check
my %not_yet =map {($_, 1)} @known;
my %possible = map {($_, 1)} @known;
my %other = ();
+ $state->{localbase} = $plist->localbase;
$plist->find_dependencies($state, $l, \%not_yet, \%possible,
\%other);
if (keys %not_yet > 0) {
@@ -378,6 +409,7 @@ sub package_files_check
} else {
$plist->thorough_check($state);
}
+ $plist->mark_available_lib($plist->pkgname);
}
}
@@ -416,8 +448,8 @@ sub run
my @list = installed_packages(1);
$self->sanity_check($state, \@list);
-# $self->dependencies_check($state, \@list);
-# $state->log->dump;
+ $self->dependencies_check($state, \@list);
+ $state->log->dump;
$self->package_files_check($state, \@list);
$state->log->dump;
$self->localbase_check($state);