"pretty print" verbose messages: more context, and indent them to make
authorespie <espie@openbsd.org>
Wed, 27 Apr 2022 15:04:11 +0000 (15:04 +0000)
committerespie <espie@openbsd.org>
Wed, 27 Apr 2022 15:04:11 +0000 (15:04 +0000)
clearer those message are grouped together

usr.sbin/pkg_add/OpenBSD/OldLibs.pm

index e92facf..003fa24 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: OldLibs.pm,v 1.12 2014/02/04 18:11:36 espie Exp $
+# $OpenBSD: OldLibs.pm,v 1.13 2022/04/27 15:04:11 espie Exp $
 #
 # Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org>
 #
@@ -186,7 +186,7 @@ sub adjust_depends_closure
 {
        my ($oldname, $plist, $state) = @_;
 
-       $state->say("Packages that depend on those shared libraries:")
+       $state->say("    Packages that depend on those shared libraries:")
            if $state->verbose >= 3;
 
        my $write = OpenBSD::RequiredBy->new($plist->pkgname);
@@ -209,7 +209,7 @@ sub do_save_libs
        ($o->{plist}, my $stub_list) = split_libs($o->plist, $libs);
        my $stub_name = $stub_list->pkgname;
        my $dest = installed_info($stub_name);
-       $state->say("Keeping them in #1", $stub_name)
+       $state->say("    (keeping them in #1)", $stub_name)
            if $state->verbose >= 2;
 
 
@@ -244,8 +244,8 @@ sub save_libs_from_handle
        my $libs = {};
        my $p = {};
 
-       $state->say("Looking for changes in shared libraries")
-           if $state->verbose >= 2;
+       $state->say("Looking for changes in shared libraries of #1",
+           $o->pkgname) if $state->verbose >= 2;
        $o->plist->mark_lib($libs, $p);
        for my $n ($set->newer) {
                $n->plist->unmark_lib($libs, $p);
@@ -255,11 +255,11 @@ sub save_libs_from_handle
        }
 
        if (%$libs) {
-               $state->say("Libraries to keep: #1",
+               $state->say("  ->Libraries to keep: #1",
                    join(",", sort(keys %$libs))) if $state->verbose >= 2;
                do_save_libs($o, $libs, $state);
        } else {
-               $state->say("No libraries to keep") if $state->verbose >= 2;
+               $state->say("  ->No libraries to keep") if $state->verbose >= 2;
        }
 }