diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-23 11:12:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-23 11:12:57 +0000 |
commit | f1dd2c8a611a11d75dc9e3c8ad8683ff73c61e64 (patch) | |
tree | 0c9a9714f7eb3b8a3d9811ff030ab4a0c1a522f0 /usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | |
parent | 0ed4dadd6eb55d64ebd6f60266b7153fe2f30eb3 (diff) |
allow for registration of libraries from an existing plist.
make sure lookup_libspec result is defined.
allow for registering pkgpath instead of pkgname.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/SharedLibs.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index 14400d11959..5788988cd99 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.3 2004/11/22 01:56:13 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.4 2004/11/23 11:12:56 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -113,18 +113,33 @@ sub add_system_libs sub add_package_libs { - my ($pkgname) = @_; + my ($pkgname, $wantpath) = @_; return if $done_plist->{$pkgname}; $done_plist->{$pkgname} = 1; my $plist = OpenBSD::PackingList->from_installation($pkgname, \&OpenBSD::PackingList::LibraryOnly); + if (defined $wantpath) { + if (defined $plist->{extrainfo}) { + $pkgname = $plist->{extrainfo}->{subdir}; + } + } + + $plist->visit('mark_available_lib', $pkgname); +} + +sub add_plist_libs +{ + my ($plist) = @_; + my $pkgname = $plist->pkgname(); + return if $done_plist->{$pkgname}; + $done_plist->{$pkgname} = 1; $plist->visit('mark_available_lib', $pkgname); } sub _lookup_libspec { my ($dir, $spec) = @_; - my @r; + my @r = (); if ($spec =~ m/^(.*)\.(\d+)\.(\d+)$/) { my ($libname, $major, $minor) = ($1, $2, $3); @@ -142,7 +157,8 @@ sub _lookup_libspec sub lookup_libspec { - my ($base, $libspec) = @_; + my ($base, $libspec, $wantpath) = @_; + if ($libspec =~ m|(.*)/|) { return _lookup_libspec("$base/$1", $'); } else { |