summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-26 11:31:09 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-26 11:31:09 +0000
commitfc600a0e46afd4a2a1555de7e774071e230d0bf5 (patch)
tree2c13ec978bbec4ccb7ac03aee86cf97b7879fa48 /usr.sbin/pkg_add
parent18e19fbb4c5a909cd8e857f50e5e8a101ee2c98e (diff)
fix merging behavior when merging doesn't occur:
- display message that says "this update didn't merge" - be more specific in return values, because we want to distinguish between we merged some stuff -> compute full depends / we didn't -> proceed thanks to Florent Tribouilloy for being my guinea pig ;)
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_add14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 7c19bad1b4a..d0da6829a25 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.470 2010/01/12 20:14:09 espie Exp $
+# $OpenBSD: pkg_add,v 1.471 2010/01/26 11:31:08 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -403,6 +403,7 @@ sub try_merging
$set->merge($state->tracker, $s);
return 1;
} else {
+ $state->errsay("NOT MERGING: can't find update for ", $s->print, $state->ntogo);
return 0;
}
}
@@ -416,19 +417,24 @@ sub check_forward_dependencies
my $bad = $set->{forward}->check($state);
if (%$bad) {
+ my $no_merge = 1;
if (!$state->{defines}->{dontmerge}) {
my $okay = 1;
for my $m (keys %$bad) {
- $set->try_merging($m, $state) or $okay = 0;
+ if ($set->try_merging($m, $state)) {
+ $no_merge = 0;
+ } else {
+ $okay = 0;
+ }
}
return 0 if $okay == 1;
}
if ($state->{defines}->{updatedepends}) {
$state->errsay("Forcing update");
- return 1;
+ return $no_merge;
} elsif ($state->{interactive}) {
if ($state->confirm("Proceed with update anyways", 0)) {
- return 1;
+ return $no_merge;
} else {
return undef;
}