summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-28 14:50:39 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-28 14:50:39 +0000
commitb6e7ee89b0666638000a75209e7d3a009aa9dbcf (patch)
tree6b3664e2e4c1805a1ead1425b2c801143eb68aa0 /usr.sbin
parenta7566b557d5d14a4b528b6a39ca9b1d5fa061c47 (diff)
add a boguslibs forced option, that rescans packages for libraries
not marked with @lib. This allows pkg_add -current to deal with 3.6 packages fully.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/SharedLibs.pm33
-rw-r--r--usr.sbin/pkg_add/pkg_add23
-rw-r--r--usr.sbin/pkg_add/pkg_add.15
3 files changed, 58 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
index 47ca79ca2ff..edda030d729 100644
--- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
+++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: SharedLibs.pm,v 1.5 2004/12/21 11:43:46 espie Exp $
+# $OpenBSD: SharedLibs.pm,v 1.6 2004/12/28 14:50:38 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -23,6 +23,20 @@ sub mark_available_lib
{
}
+sub mark_bogus_lib
+{
+}
+
+package OpenBSD::PackingElement::FileBase;
+
+sub mark_bogus_lib
+{
+ my ($self, $pkgname) = @_;
+ my $fname = $self->fullname();
+ return unless $fname =~ m/\/lib[^\/]+\.so\.\d+\.\d+$/;
+ OpenBSD::SharedLibs::register_lib($fname, $pkgname);
+}
+
package OpenBSD::PackingElement::Lib;
sub mark_available_lib
@@ -31,6 +45,10 @@ sub mark_available_lib
OpenBSD::SharedLibs::register_lib($self->fullname(), $pkgname);
}
+sub mark_bogus_lib
+{
+}
+
package OpenBSD::SharedLibs;
use File::Basename;
use OpenBSD::Error;
@@ -131,6 +149,19 @@ sub add_package_libs
$plist->visit('mark_available_lib', $pkgname);
}
+sub add_bogus_package_libs
+{
+ my $pkgname = $_[0];
+ return if $done_plist->{$pkgname} == 2;
+ $done_plist->{$pkgname} = 2;
+ my $plist = OpenBSD::PackingList->from_installation($pkgname);
+ if (!defined $plist) {
+ Warn "Can't read plist for $pkgname\n";
+ return;
+ }
+ $plist->visit('mark_bogus_lib', $pkgname);
+}
+
sub add_plist_libs
{
my ($plist) = @_;
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 7c1b5d914b4..a4128ddad6b 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.163 2004/12/28 13:54:13 espie Exp $
+# $OpenBSD: pkg_add,v 1.164 2004/12/28 14:50:38 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -548,6 +548,27 @@ sub lookup_library
}
}
}
+ if ($state->{forced}->{boguslibs}) {
+ my $explored = {};
+ # lookup through the full tree...
+ my @todo = keys %$dependencies;
+ while (my $dep = pop @todo) {
+ require OpenBSD::RequiredBy;
+
+ next if $explored->{$dep};
+ $explored->{$dep} = 1;
+ for my $dep2 (OpenBSD::Requiring->new($dep)->list()) {
+ push(@todo, $dep2) unless $done->{$dep2};
+ }
+ OpenBSD::SharedLibs::add_bogus_package_libs($dep);
+ if (check_lib_spec($state->{very_verbose},
+ $state->{destdir}.$plist->pkgbase(), $lib, {$dep => 1})) {
+ Warn "Found unmarked library ", $lib, " in dependent package $dep\n" if $state->{verbose};
+ $dependencies->{$dep} = 1;
+ return 1;
+ }
+ }
+ }
print "\n" if $state->{very_verbose};
}
diff --git a/usr.sbin/pkg_add/pkg_add.1 b/usr.sbin/pkg_add/pkg_add.1
index b63409d4cbf..819201e9afd 100644
--- a/usr.sbin/pkg_add/pkg_add.1
+++ b/usr.sbin/pkg_add/pkg_add.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_add.1,v 1.30 2004/12/26 15:01:06 espie Exp $
+.\" $OpenBSD: pkg_add.1,v 1.31 2004/12/28 14:50:38 espie Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -143,6 +143,9 @@ These include:
.Bl -tag -width "updatedependsXX" -compact
.It Ar arch
architecture recorded in package may not match.
+.It Ar boguslibs
+not all shared libraries are marked with @lib.
+Inefficiently rescan package lists for non marked libraries.
.It Ar conflicts
package may conflict with other packages.
.It Ar installed