From fac887d56b385fe2211e974d438289c152e05a6e Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 20 Apr 2022 09:07:42 +0000 Subject: [PATCH] better error report when I botch some test writing --- regress/usr.sbin/pkg_add/populate | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/regress/usr.sbin/pkg_add/populate b/regress/usr.sbin/pkg_add/populate index ab0393b5dea..2ba237af58a 100644 --- a/regress/usr.sbin/pkg_add/populate +++ b/regress/usr.sbin/pkg_add/populate @@ -57,7 +57,8 @@ package main; my $state = myState->new; $state->handle_options; -my $plist = OpenBSD::PackingList->fromfile($state->opt('f'), +my $filename = $state->opt('f'); +my $plist = OpenBSD::PackingList->fromfile($filename, sub { my ($fh, $cont) = @_; while (<$fh>) { @@ -65,5 +66,9 @@ my $plist = OpenBSD::PackingList->fromfile($state->opt('f'), } }); +if (!defined $plist) { + $state->fatal("Error reading packing-list #1", $filename); +} + my $localbase = $state->opt('L') // OpenBSD::Paths->localbase; $plist->populate($state->opt('B').$localbase); -- 2.20.1