summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2023-05-27 10:06:39 +0000
committerMarc Espie <espie@cvs.openbsd.org>2023-05-27 10:06:39 +0000
commit796fe2f0809a8519613a1d5a0d52d621eebfaac7 (patch)
tree29ac2a5a39ba79a2af5bbdc44a4935dec2015723 /usr.sbin/pkg_add/OpenBSD
parentad583f94efeb15002cd13c6fb0b5f503b705ffff (diff)
finish making this a singleton class (which I don't always like
and is definitely worthy of a comment)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Tracker.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Tracker.pm b/usr.sbin/pkg_add/OpenBSD/Tracker.pm
index 0b043bccdda..8ea46e51cce 100644
--- a/usr.sbin/pkg_add/OpenBSD/Tracker.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Tracker.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Tracker.pm,v 1.29 2018/10/22 10:29:06 espie Exp $
+# $OpenBSD: Tracker.pm,v 1.30 2023/05/27 10:06:38 espie Exp $
#
# Copyright (c) 2009 Marc Espie <espie@openbsd.org>
#
@@ -32,12 +32,14 @@ use strict;
use warnings;
package OpenBSD::Tracker;
+
+# XXX we're a singleton class
our $s;
sub new
{
my $class = shift;
- return $s = bless {}, $class;
+ return $s //= bless {}, $class;
}
sub dump2