diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2018-02-25 14:19:27 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2018-02-25 14:19:27 +0000 |
commit | c40087fe84d6db36af1b4e29ec426e5dbc9b9f7f (patch) | |
tree | b53a39e8495d6d0ac8f0a0fbcc7fb3de3863312f | |
parent | feb4c14589183f6629ca4bd9f9e9e5b930e63e8f (diff) |
sprinkle quite a few more calls to safe
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCheck.pm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index 23e8a07bd97..a61cfb97ce1 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.64 2017/03/14 23:30:36 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.65 2018/02/25 14:19:26 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -561,32 +561,34 @@ sub remove for my $i (@OpenBSD::PackageInfo::info) { if (-e $dir.$i) { if ($state->verbose) { - $state->say("unlink(#1)", $dir.$i); + $state->say("unlink(#1)", + $state->safe($dir.$i)); } unless ($state->{not}) { unlink($dir.$i) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir.$i, $!); + $state->safe($name), + $state->safe($dir.$i), $!); } } } if (-f $dir) { if ($state->verbose) { - $state->say("unlink(#1)", $dir); + $state->say("unlink(#1)", $state->safe($dir)); } unless ($state->{not}) { unlink($dir) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir, $!); + $state->safe($name), $state->safe($dir), $!); } } elsif (-d $dir) { if ($state->verbose) { - $state->say("rmdir(#1)", $dir); + $state->say("rmdir(#1)", $state->safe($dir)); } unless ($state->{not}) { rmdir($dir) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir, $!); + $state->safe($name), $state->safe($dir), $!); } } } @@ -596,7 +598,7 @@ sub may_remove my ($self, $state, $name) = @_; if ($state->{force}) { $self->remove($state, $name); - } elsif ($state->confirm("Remove wrong package $name")) { + } elsif ($state->confirm("Remove wrong package ".$state->safe($name))) { $self->remove($state, $name); } $state->{bogus}{$name} = 1; |