summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2019-07-05 06:21:14 +0000
committerespie <espie@openbsd.org>2019-07-05 06:21:14 +0000
commit8ad6a08cd41f975fb4c6309596058fc2cb3f83fe (patch)
tree971f2b8361e46e724b5f914ee5a2ccf21d02b847
parentadd the strerror to the error message (diff)
downloadwireguard-openbsd-8ad6a08cd41f975fb4c6309596058fc2cb3f83fe.tar.xz
wireguard-openbsd-8ad6a08cd41f975fb4c6309596058fc2cb3f83fe.zip
revisit die messages: remove extra "\n", add $! if needed, don't use
string concat as die takes a list like print.
-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;
}