summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-12-20 09:10:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-12-20 09:10:52 +0000
commitd546d95f9176bd60f9fb58910e9e19676920e653 (patch)
tree5c52f41dcf39eb2029949d4c653fdb6c55ccad1f
parentc2d1803b0941e6f635d006f6ce50467fd3e96f04 (diff)
use Auto::cache
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 00fc2921a40..854e9ad44b4 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.140 2010/12/20 09:08:42 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.141 2010/12/20 09:10:51 espie Exp $
#
# Copyright (c) 2005-2010 Marc Espie <espie@openbsd.org>
#
@@ -489,19 +489,17 @@ sub set_global
$global_cache->{$dep->{pattern}} = $value;
}
-sub installed_list
-{
- my $self = shift;
+OpenBSD::Auto::cache(installed_list,
+ sub {
+ my $self = shift;
- if (!defined $self->{installed}) {
my @l = installed_packages();
for my $o ($self->{set}->older_names) {
@l = grep {$_ ne $o} @l;
}
- $self->{installed} = \@l;
+ return \@l;
}
- return $self->{installed};
-}
+);
sub solve_dependency
{