diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-27 16:38:27 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-27 16:38:27 +0000 |
commit | b2efdd909dfd7bce0e5879e64c5dea22cbc52489 (patch) | |
tree | f963c5c0cbde724c69da4004d92bf6a00e0114c2 | |
parent | 6c12f6bfc5d9c997fe6c79902239ac9da8b0b0a2 (diff) |
tweak very verbose output.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Update.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 44 |
2 files changed, 28 insertions, 24 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index 5763c348147..2187f6a0699 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.35 2004/11/27 14:02:50 espie Exp $ +# $OpenBSD: Update.pm,v 1.36 2004/11/27 16:38:26 espie Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -384,9 +384,9 @@ sub save_old_libraries $old_plist->visit('mark_lib', $libs, $p); $new_plist->visit('unmark_lib', $libs, $p); - print "Libraries to keep: ", join(",", sort(keys %$libs)), "\n" - if $state->{beverbose}; if (%$libs) { + print "Libraries to keep: ", join(",", sort(keys %$libs)), "\n" + if $state->{beverbose}; my $stub_list = split_libs($old_plist, $libs); my $stub_name = $stub_list->pkgname(); my $dest = installed_info($stub_name); @@ -407,6 +407,8 @@ sub save_old_libraries add_installed($stub_name); walk_depends_closure($old_plist->pkgname(), $stub_name, $state); + } else { + print "No libraries to keep\n" if $state->{beverbose}; } } diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index e9d60950a27..954b31b1654 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.130 2004/11/27 14:02:50 espie Exp $ +# $OpenBSD: pkg_add,v 1.131 2004/11/27 16:38:26 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -246,7 +246,6 @@ sub solve_dependencies sub check_lib_spec { my ($verbose, $base, $spec, $dependencies) = @_; - print "checking libspec $spec..." if $verbose; my @r = OpenBSD::SharedLibs::lookup_libspec($base, $spec); for my $candidate (@r) { if ($dependencies->{$candidate}) { @@ -254,7 +253,7 @@ sub check_lib_spec return 1; } } - print " not found\n" if $verbose; + print " not found." if $verbose; return undef; } @@ -475,6 +474,7 @@ sub lookup_library { my ($state, $lib, $plist, $dependencies, $harder) = @_; + print "checking libspec $lib..." if $state->{very_verbose}; if (check_lib_spec($state->{very_verbose}, $state->{destdir}.$plist->pkgbase(), $lib, $dependencies)) { return 1; @@ -496,27 +496,29 @@ sub lookup_library return 1; } } - return 0 unless $harder; - # lookup through the full tree... - my $done = {}; - my @todo = keys %$dependencies; - while (my $dep = pop @todo) { - require OpenBSD::RequiredBy; + if ($harder) { + # lookup through the full tree... + my $done = {}; + my @todo = keys %$dependencies; + while (my $dep = pop @todo) { + require OpenBSD::RequiredBy; - next if $done->{$dep}; - $done->{$dep} = 1; - for my $dep2 (OpenBSD::Requiring->new($dep)->list()) { - push(@todo, $dep2) unless $done->{$dep2}; - } - next if $dependencies->{$dep}; - OpenBSD::SharedLibs::add_package_libs($dep); - if (check_lib_spec($state->{very_verbose}, - $state->{destdir}.$plist->pkgbase(), $lib, {$dep => 1})) { - Warn "Found library ", $lib, " in dependent package $dep\n"; - $dependencies->{$dep} = 1; - return 1; + next if $done->{$dep}; + $done->{$dep} = 1; + for my $dep2 (OpenBSD::Requiring->new($dep)->list()) { + push(@todo, $dep2) unless $done->{$dep2}; + } + next if $dependencies->{$dep}; + OpenBSD::SharedLibs::add_package_libs($dep); + if (check_lib_spec($state->{very_verbose}, + $state->{destdir}.$plist->pkgbase(), $lib, {$dep => 1})) { + Warn "Found library ", $lib, " in dependent package $dep\n"; + $dependencies->{$dep} = 1; + return 1; + } } } + print "\n" if $state->{very_verbose}; } |