summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-05 11:31:08 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-05 11:31:08 +0000
commit9b59cee6bbbdf8e9305528337dcbdff79cbf3271 (patch)
tree880594c7bb2424452ec7b199ff7dc6abe4b331e0 /usr.sbin/pkg_add/OpenBSD/PackingElement.pm
parent28fdca0736b5b65cad750b8c7908a3e45f9cdbd4 (diff)
use Auto::cache
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm18
1 files changed, 8 insertions, 10 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 40346793d21..0bed2ebd387 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.168 2010/01/01 13:36:07 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.169 2010/01/05 11:31:07 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -921,16 +921,14 @@ sub stringize
(qw(pkgpath pattern def)));
}
-sub spec
-{
+OpenBSD::Auto::cache(spec,
+ sub {
+ require OpenBSD::Search;
+
my $self = shift;
- if (!defined $self->{spec}) {
- require OpenBSD::Search;
- $self->{spec} = OpenBSD::Search::PkgSpec->new($self->{pattern});
- $self->{spec}->add_pkgpath_hint($self->{pkgpath});
- }
- return $self->{spec};
-}
+ return OpenBSD::Search::PkgSpec->new($self->{pattern})
+ ->add_pkgpath_hint($self->{pkgpath});
+ });
package OpenBSD::PackingElement::Wantlib;
our @ISA=qw(OpenBSD::PackingElement::Depend);