diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-06-04 15:57:10 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-06-04 15:57:10 +0000 |
commit | 12bbc3234d424f5764960cfdb4625c56ad12ceba (patch) | |
tree | a0bb9ff8671c93e222f0e4204e7165a1a672476d /usr.sbin/pkg_add | |
parent | f5562576c7e4e291a4704ac5f509975f9d50da06 (diff) |
add a lib parsing routine to PackingElement::Lib so I don't have to
do the same thing again and again...
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index ed97daa368a..add6d058208 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.129 2007/06/04 14:57:33 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.130 2007/06/04 15:57:09 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -495,6 +495,16 @@ sub ensure_ldconfig } } +sub parse +{ + my ($self, $filename) = @_; + if ($filename =~ m/^(.*)\/?lib(.*?)\.so\.(\d+)\.(\d+)$/o) { + return ($1, $2, $3, $4); + } else { + return undef; + } +} + package OpenBSD::PackingElement::PkgConfig; our @ISA=qw(OpenBSD::PackingElement::FileBase); |