summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-21 02:12:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-21 02:12:52 +0000
commitb4d2d54760b1a7c40dff7f126a85628de6d0ebe1 (patch)
treecaf6338ca33b85d01baa9a7f4b60c526c958f6cf /usr.sbin/pkg_add
parent53a1cd677dc4725743c1470e45ed387e0098e347 (diff)
oops, really cache stuff.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/RequiredBy.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
index e2b574e7794..3894bf2fcac 100644
--- a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
+++ b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: RequiredBy.pm,v 1.7 2004/12/15 01:07:10 espie Exp $
+# $OpenBSD: RequiredBy.pm,v 1.8 2004/12/21 02:12:51 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -114,11 +114,10 @@ sub new
{
my ($class, $pkgname) = @_;
my $f = installed_info($pkgname).$class->filename();
- if (exists $cache->{$f}) {
- return $cache->{$f};
- } else {
- return bless { filename => $f }, $class;
+ if (!exists $cache->{$f}) {
+ return $cache->{$f} = bless { filename => $f }, $class;
}
+ return $cache->{$f};
}
package OpenBSD::RequiredBy;