summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Replace.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-04 16:33:24 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-04 16:33:24 +0000
commit76d293a011c9a855659a2bfdf5c969a95e9f7db8 (patch)
tree989e90ad8d9d826fd8f74f4b6c64f5d558841c6c /usr.sbin/pkg_add/OpenBSD/Replace.pm
parentbc6c53654837246be3d82b85769a64ccdf1b7132 (diff)
avoid parsing libraries by hand.
Store shared libraries in a `better' format, which will also us to report issues more nicely.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Replace.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index da572cfefff..69472510c13 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.31 2007/06/04 14:40:39 espie Exp $
+# $OpenBSD: Replace.pm,v 1.32 2007/06/04 16:33:23 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -199,8 +199,9 @@ sub mark_lib
{
my ($self, $libs, $libpatterns) = @_;
my $libname = $self->fullname;
- if ($libname =~ m/^(.*\.so\.)(\d+)\.(\d+)$/o) {
- $libpatterns->{$1} = [$2, $3, $libname];
+ my ($stem, $major, $minor, $dir) = $self->parse($libname);
+ if (defined $stem) {
+ $libpatterns->{$stem}->{$dir} = [$major, $minor, $libname];
}
$libs->{$libname} = 1;
}
@@ -209,9 +210,9 @@ sub unmark_lib
{
my ($self, $libs, $libpatterns) = @_;
my $libname = $self->fullname;
- if ($libname =~ m/^(.*\.so\.)(\d+)\.(\d+)$/o) {
- my ($pat, $major, $minor) = ($1, $2, $3);
- my $p = $libpatterns->{$pat};
+ my ($stem, $major, $minor, $dir) = $self->parse($libname);
+ if (defined $stem) {
+ my $p = $libpatterns->{$stem}->{$dir};
if (defined $p && $p->[0] == $major && $p->[1] <= $minor) {
my $n = $p->[2];
delete $libs->{$n};