diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2017-10-09 15:35:07 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2017-10-09 15:35:07 +0000 |
commit | e2882a7c3fd544fe84273a0557c121ec5a0838db (patch) | |
tree | b7e46a9a116808d2b7f19703f0abe14fb71bf114 /usr.sbin/pkg_add/OpenBSD | |
parent | 2c4c521d6cf405a06a46bcb3c39393ee1f14ffbe (diff) |
correct calls to this constructor *must* include a state. If they don't
you won't notice until the repository wants to output an error message,
which is bad.
if code breaks thanks to this commit, the call site needs to be fixed.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index c9a87710eef..f23d35ddf7a 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.146 2017/08/04 11:53:03 sthen Exp $ +# $OpenBSD: PackageRepository.pm,v 1.147 2017/10/09 15:35:06 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -52,6 +52,10 @@ sub baseurl sub new { my ($class, $baseurl, $state) = @_; + if (!defined $state) { + require Carp; + Carp::croak "fatal: old api call to $class: needs state"; + } my $o = $class->parse(\$baseurl, $state); if ($baseurl ne '') { return undef; |