diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 76124a59aef..3f2af49af53 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.92 2009/11/11 11:13:16 espie Exp $ +# $OpenBSD: Add.pm,v 1.93 2009/11/11 12:04:19 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -35,7 +35,7 @@ sub manpages_index while (my ($k, $v) = each %{$state->{mandirs}}) { my @l = map { $destdir.$_ } @$v; if ($state->{not}) { - print "Merging manpages in $destdir$k: ", join(@l), "\n" if $state->{verbose}; + $state->say("Merging manpages in $destdir$k: ", join(@l)) if $state->{verbose}; } else { try { OpenBSD::Makewhatis::merge($destdir.$k, \@l); @@ -82,8 +82,9 @@ sub record_partial_installation my $lastname = $last->realname($state); $last->{d} = $last->compute_digest($lastname, $old); if (!$old->equals($last->{d})) { - print "Adjusting ", $old->keyword, " for $lastname from ", - $old->stringize, " to ", $last->{d}->stringize, "\n"; + $state->say("Adjusting ", $old->keyword, + " for $lastname from ", $old->stringize, + " to ", $last->{d}->stringize); } } register_installation($n); @@ -278,7 +279,7 @@ sub install my ($self, $state) = @_; $self->SUPER::install($state); my $auth = $self->name; - print "adding ", $self->type, " $auth\n" if $state->{verbose}; + $state->say("adding ", $self->type, " ", $auth) if $state->{verbose}; return if $state->{not}; return if defined $self->{okay}; my $l=[]; @@ -334,8 +335,7 @@ sub install return; } if ($state->{not}) { - print "sysctl -w $name != ". - $self->{value}, "\n"; + $state->say("sysctl -w $name != ". $self->{value}); return; } VSystem($state->{very_verbose}, @@ -385,7 +385,7 @@ sub install if ($state->{replacing}) { if ($state->{not}) { - print "moving tempfile -> $destdir$fullname\n" if $state->{very_verbose}; + $state->say("moving tempfile -> $destdir$fullname") if $state->{very_verbose}; return; } File::Path::mkpath(dirname($destdir.$fullname)); @@ -396,13 +396,13 @@ sub install } else { rename($self->{tempname}, $destdir.$fullname) or Fatal "Can't move ", $self->{tempname}, " to $fullname: $!"; - print "moving ", $self->{tempname}, " -> $destdir$fullname\n" if $state->{very_verbose}; + $state->say("moving ", $self->{tempname}, " -> $destdir$fullname") if $state->{very_verbose}; undef $self->{tempname}; } } else { my $file = $self->prepare_to_extract($state); - print "extracting $destdir$fullname\n" if $state->{very_verbose}; + $state->say("extracting $destdir$fullname") if $state->{very_verbose}; if ($state->{not}) { $state->{archive}->skip; return; @@ -506,29 +506,29 @@ sub install my $origname = $destdir.$orig->fullname; if (-e $filename) { if ($state->{verbose}) { - print "The existing file $filename has NOT been changed\n"; + $state->say("The existing file $filename has NOT been changed"); if (defined $orig->{d}) { # XXX assume this would be the same type of file my $d = $self->compute_digest($filename, $orig->{d}); if ($d->equals($orig->{d})) { - print "(but it seems to match the sample file $origname)\n"; + $state->say("(but it seems to match the sample file $origname)"); } else { - print "It does NOT match the sample file $origname\n"; - print "You may wish to update it manually\n"; + $state->say("It does NOT match the sample file $origname"); + $state->say("You may wish to update it manually"); } } } } else { if ($state->{not}) { - print "The file $filename would be installed from $origname\n"; + $state->say("The file $filename would be installed from $origname"); } else { if (!copy($origname, $filename)) { Warn "File $filename could not be installed:\n\t$!\n"; } $self->set_modes($filename); if ($state->{verbose}) { - print "installed $filename from $origname\n"; + $state->say("installed $filename from $origname"); } } } @@ -593,8 +593,8 @@ sub install open(my $shells2, '>>', $destdir.OpenBSD::Paths->shells) or return; print $shells2 $fullname, "\n"; close $shells2; - print "Shell $fullname appended to $destdir", - OpenBSD::Paths->shells, "\n"; + $state->say("Shell $fullname appended to $destdir", + OpenBSD::Paths->shells); } package OpenBSD::PackingElement::Dir; @@ -605,7 +605,7 @@ sub install my $fullname = $self->fullname; my $destdir = $state->{destdir}; - print "new directory ", $destdir, $fullname, "\n" if $state->{very_verbose}; + $state->say("new directory ", $destdir, $fullname) if $state->{very_verbose}; return if $state->{not}; File::Path::mkpath($destdir.$fullname); $self->set_modes($destdir.$fullname); |