summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-14 17:52:09 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-14 17:52:09 +0000
commite38100debf2e39e58c0f9e49530ca8cb73badb5a (patch)
tree43790307b89174364af88608c2efea0cf642d580 /usr.sbin
parentfd33d02f476041fb56773b24f86b39f6e090b7eb (diff)
move verbose printing into a separate method.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm13
-rw-r--r--usr.sbin/pkg_add/pkg_add5
2 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 5fcb1162b44..ef512f23f4c 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.28 2007/05/14 17:48:32 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.29 2007/05/14 17:52:08 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -129,15 +129,20 @@ sub solve
$self->solve_dependency($state, $dep);
}
- if ($state->{verbose} && %{$self->{to_register}}) {
+ $handle->{solved_dependencies} = $self->{to_register};
+ return @{$self->{deplist}};
+}
+
+sub dump
+{
+ my $self = shift;
+ if (%{$self->{to_register}}) {
print "Dependencies for ", $self->{pkgname}, " resolve to: ",
join(', ', keys %{$self->{to_register}});
print " (todo: ", join(',', @{$self->{deplist}}), ")"
if @{$self->{deplist}} > 0;
print "\n";
}
- $handle->{solved_dependencies} = $self->{to_register};
- return @{$self->{deplist}};
}
sub check_lib_spec
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index d0afbb0ee1a..380fe2c45ff 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.245 2007/05/14 11:22:00 espie Exp $
+# $OpenBSD: pkg_add,v 1.246 2007/05/14 17:52:08 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -532,6 +532,9 @@ sub install_package
if (!defined $handle->{solved_dependencies}) {
my $solver = OpenBSD::Dependencies->solver;
my @deps = $solver->solve($state, $handle, @todo);
+ if ($state->{verbose}) {
+ $solver->dump;
+ }
if (@deps > 0) {
build_deptree($state, $pkg, @deps);
return (@deps, $pkg);