diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-07 08:18:03 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-07 08:18:03 +0000 |
commit | 49bdbbdde2946281a7dc0b3cf2955329cd162d46 (patch) | |
tree | 76c659175178079928a2a47beb846e7c5df2e663 | |
parent | e959cb16f6d931256892459bdc4c586798b56344 (diff) |
use one single list for system directories.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index a8e427946f3..07baf5fd136 100644 --- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm +++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Dependencies.pm,v 1.15 2007/05/07 08:14:51 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.16 2007/05/07 08:18:02 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -161,7 +161,7 @@ sub lookup_library if ($lib !~ m|/|) { OpenBSD::SharedLibs::add_system_libs($state->{destdir}); - for my $dir ("/usr", "/usr/X11R6") { + for my $dir (OpenBSD::SharedLibs::system_dirs()) { if (check_lib_spec($dir, $lib, {system => 1})) { print "found libspec $lib in $dir/lib\n" if $state->{very_verbose}; return 1; diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index ca8e19e2652..5ab8559f722 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.12 2007/05/07 08:14:51 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.13 2007/05/07 08:18:02 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -97,15 +97,20 @@ sub register_lib my $done_plist = {}; +sub system_dirs +{ + return ("/usr", "/usr/X11R6"); +} + sub add_system_libs { my ($destdir) = @_; return if $done_plist->{'system'}; $done_plist->{'system'} = 1; - for my $dirname ("/usr/lib", "/usr/X11R6/lib") { - opendir(my $dir, $destdir.$dirname) or next; + for my $dirname (system_dirs()) { + opendir(my $dir, $destdir.$dirname."/lib") or next; while (my $d = readdir($dir)) { - register_lib("$dirname/$d", 'system'); + register_lib("$dirname/lib/$d", 'system'); } closedir($dir); } |