summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2019-07-05 06:21:15 +0000
committerMarc Espie <espie@cvs.openbsd.org>2019-07-05 06:21:15 +0000
commit06574b812a32e5658db999c45a1862c13de50ad1 (patch)
tree1740363b71b55390703c9cd8b03ae8bbb07fd21e /usr.sbin/pkg_add
parent57146a8d7bffd1d5940f55ff7ce52e37c4a8f54f (diff)
revisit die messages: remove extra "\n", add $! if needed, don't use
string concat as die takes a list like print.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm14
-rw-r--r--usr.sbin/pkg_add/OpenBSD/md5.pm4
2 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 93dac235ee8..b80ad9e221a 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.270 2019/05/28 19:31:42 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.271 2019/07/05 06:21:14 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -496,8 +496,8 @@ sub destate
{
my ($self, $state) = @_;
if ($state->{lastfile}->isa("OpenBSD::PackingElement::SpecialFile")) {
- die "Can't \@sample a specialfile: ".
- $state->{lastfile}->stringize. "\n";
+ die "Can't \@sample a specialfile: ",
+ $state->{lastfile}->stringize;
}
$self->{copyfrom} = $state->{lastfile};
$self->compute_fullname($state);
@@ -621,7 +621,7 @@ sub format
$state->error("empty source manpage: #1", $fname);
return;
}
- open(my $fh, '<', $fname) or die "Can't read $fname";
+ open(my $fh, '<', $fname) or die "Can't read $fname: $!";
my $line = <$fh>;
close $fh;
my @extra = ();
@@ -642,9 +642,9 @@ sub format
if (my ($dir, $file) = $fname =~ m/^(.*)\/([^\/]+\/[^\/]+)$/) {
my $r = $state->system(sub {
open STDOUT, '>&', $destfh or
- die "Can't write to $dest";
+ die "Can't write to $dest: $!";
close $destfh;
- chdir($dir) or die "Can't chdir to $dir";
+ chdir($dir) or die "Can't chdir to $dir: $!";
},
$state->{groff} // OpenBSD::Paths->groff,
qw(-mandoc -mtty-char -E -Ww -Tascii -P -c),
@@ -1944,7 +1944,7 @@ sub new
{
my ($class, $args) = @_;
unless ($args =~ m/^[\w\d\.\-\+\@]+$/) {
- die "Invalid characters in signer $args\n";
+ die "Invalid characters in signer $args";
}
$class->SUPER::new($args);
}
diff --git a/usr.sbin/pkg_add/OpenBSD/md5.pm b/usr.sbin/pkg_add/OpenBSD/md5.pm
index 98f893b8940..74800b4fa3d 100644
--- a/usr.sbin/pkg_add/OpenBSD/md5.pm
+++ b/usr.sbin/pkg_add/OpenBSD/md5.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: md5.pm,v 1.17 2017/03/07 16:11:08 espie Exp $
+# $OpenBSD: md5.pm,v 1.18 2019/07/05 06:21:14 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -49,7 +49,7 @@ sub digest_file
};
if ($@) {
$@ =~ s/\sat.*//;
- die "can't compute ".$self->keyword." on $fname: $@";
+ die "can't compute ", $self->keyword, " on $fname: $@";
}
return $d->digest;
}