diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 12:04:20 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 12:04:20 +0000 |
commit | 1c829fb0f939d9417b3b16b2637885a826516516 (patch) | |
tree | d82a0ae2dc06d00f975cfffd14a8c576d7e2fb8e /usr.sbin/pkg_add/OpenBSD/CollisionReport.pm | |
parent | bdb3c585ad77981c01fa06d17090eac21f6cd3c1 (diff) |
progressmeter puts STDOUT in autoflush if -t, so that it can display to it instead of piping a lot of stuff to STDERR.
Go through state->print for most messages, so they will NOT do weird things
with the progressmeter.
Use a ->say shortcut which does the same thing that perl 5.10 say does...
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/CollisionReport.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/CollisionReport.pm | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm index 6bb9d1dd501..45d80da0086 100644 --- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm +++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: CollisionReport.pm,v 1.20 2009/11/10 11:36:56 espie Exp $ +# $OpenBSD: CollisionReport.pm,v 1.21 2009/11/11 12:04:19 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -41,7 +41,7 @@ sub find_collisions return $bypkg; } for my $pkg (installed_packages()) { - print "Looking for collisions in $pkg\n" if $verbose; + $state->say("Looking for collisions in $pkg") if $verbose; my $plist = OpenBSD::PackingList->from_installation($pkg, \&OpenBSD::PackingList::FilesOnly); next if !defined $plist; @@ -74,13 +74,13 @@ sub collision_report($$) my $clueless_bat2; my $found = 0; - print "Collision: the following files already exist\n"; + $state->say("Collision: the following files already exist"); if (!$state->{defines}->{dontfindcollisions}) { my $bypkg = find_collisions(\%todo, $state->{verbose}); for my $pkg (sort keys %$bypkg) { for my $item (sort @{$bypkg->{$pkg}}) { $found++; - print "\t$item ($pkg)\n"; + $state->say("\t$item ($pkg)"); } if ($pkg =~ m/^(?:partial\-|borked\.\d+$)/o) { $clueless_bat = $pkg; @@ -98,26 +98,26 @@ sub collision_report($$) my $old = $todo{$item}; my $d = $old->new($destdir.$item); if ($d->equals($old)) { - print "\t$item (same checksum)\n"; + $state->say("\t$item (same checksum)"); } else { - print "\t$item (different checksum)\n"; + $state->say("\t$item (different checksum)"); } } else { - print "\t$item\n"; + $state->say("\t$item"); } } } if (defined $clueless_bat) { - print "The package name $clueless_bat suggests that a former installation\n"; - print "of a similar package got interrupted. It is likely that\n"; - print "\tpkg_delete $clueless_bat\n"; - print "will solve the problem\n"; + $state->print("The package name $clueless_bat suggests that a former installation\n", + "of a similar package got interrupted. It is likely that\n", + "\tpkg_delete $clueless_bat\n", + "will solve the problem\n"); } if (defined $clueless_bat2) { - print "The package name $clueless_bat2 suggests remaining libraries\n"; - print "from a former package update. It is likely that\n"; - print "\tpkg_delete $clueless_bat2\n"; - print "will solve the problem\n"; + $state->print("The package name $clueless_bat2 suggests remaining libraries\n", + "from a former package update. It is likely that\n", + "\tpkg_delete $clueless_bat2\n". + "will solve the problem\n"); } my $dorepair = 0; if ($found == 0) { |