summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 5feb1eb57a0..d66bc44efa5 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.29 2011/07/17 13:16:15 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.30 2011/07/23 15:04:27 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -326,6 +326,11 @@ sub complete
my $o = $set->{older}->{$pkgname};
if (!defined $o) {
$o = OpenBSD::Handle->create_old($pkgname, $state);
+ if (!defined $o->pkgname) {
+ $state->{bad}++;
+ $set->cleanup(OpenBSD::Handle::CANT_INSTALL, "Bogus package already installed");
+ return 1;
+ }
$set->add_older($o);
}
$o->{update_found} = $o;