summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_add/pkg_add26
1 files changed, 11 insertions, 15 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 7aeee330c8d..a9502be9e5f 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.404 2009/11/29 14:07:07 espie Exp $
+# $OpenBSD: pkg_add,v 1.405 2009/11/30 15:49:52 espie Exp $
#
# Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org>
#
@@ -160,12 +160,12 @@ sub complete
return 1 if defined $set->{installable};
- my $r = $set->can_install($state);
- return 0 if defined $r && $r == 0;
- $set->{installable} = $r;
+ $set->{installable} = $set->can_install($state);
+ return 0 if !defined $set->{installable};
if (!$set->{installable}) {
$set->cleanup(OpenBSD::Handle::CANT_INSTALL);
+ $set->{finished} = 1;
}
return 1;
}
@@ -246,16 +246,14 @@ sub can_install
return 1 if @conflicts == 0;
if (!$state->{allow_replacing}) {
- $state->say("Can't install ", $set->short_print,
+ $state->errsay("Can't install ", $set->short_print,
" because of conflicts (",join(',', @conflicts), ")");
- $set->cleanup(OpenBSD::Handle::CANT_INSTALL);
- return;
+ return 0;
}
if (!$set->is_new_stuff_safe($state)) {
- $set->cleanup(OpenBSD::Handle::CANT_INSTALL);
- return;
+ return 0;
}
my $later = 0;
@@ -263,8 +261,7 @@ sub can_install
if ($state->tracker->is_installed($toreplace)) {
$state->errsay("Cannot replace $toreplace in ",
$set->short_print, ": just got installed");
- $set->cleanup(OpenBSD::Handle::CANT_INSTALL);
- return;
+ return 0;
}
next if $set->{older}->{$toreplace};
@@ -279,7 +276,7 @@ sub can_install
}
}
- return 0 if $later;
+ return if $later;
my $manual_install = 0;
@@ -296,10 +293,9 @@ sub can_install
if (!OpenBSD::Replace::can_old_package_be_replaced($old->plist,
$set, $state)) {
- $state->say("Can't update $name into ",
+ $state->errsay("Can't update $name into ",
$set->short_print);
- $set->cleanup(OpenBSD::Handle::CANT_INSTALL);
- return;
+ return 0;
}
if ($old->plist->has('manual-installation')) {