summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2013-10-15 20:23:52 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2013-10-15 20:23:52 +0000
commit5d60b63dda25e752715cde0f55cf0b1a7225c14b (patch)
tree67669ac36cac41fd858aabcfc7f9c6a727e0aa2c /usr.sbin
parentce38752c2223de9f1a89440447cd431d731e3a92 (diff)
If the fake target of a port installed an empty (0-byte) file as a
manual page, pkg_create(1) asked groff to process the empty file, which failed, and then decided to install the empty file as a source manual page, which later caused mandoc(1) called from man(1) to complain to the end-user. Instead, detect the emptiness in time, skip the formatting attempt, skip the file, process the packing list to its end, then abort pkg_create(1) unsuccessfully such that the porter sees the problem and can fix whatever the root cause is. Problem reported by naddy@ as seen in p5-Carp-Datum during a bulk build, solution is joint work with espie@, again tested in a bulk by naddy@; "please commit" espie@.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm7
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm4
2 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index c36a36af676..f4e99dc11a0 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.212 2013/05/13 18:30:51 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.213 2013/10/15 20:23:51 schwarze Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -589,6 +589,10 @@ sub format
my $base = $state->{base};
my $fname = $base.$self->fullname;
+ if (-z $fname) {
+ $state->error("empty source manpage: #1", $fname);
+ return;
+ }
open(my $fh, '<', $fname) or die "Can't read $fname";
my $line = <$fh>;
close $fh;
@@ -620,6 +624,7 @@ sub format
} else {
die "Can't parse source name $fname";
}
+ return 1;
}
package OpenBSD::PackingElement::Mandoc;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 1aa8c882772..bcb8689eda4 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.69 2012/12/31 09:42:05 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.70 2013/10/15 20:23:51 schwarze Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -510,7 +510,7 @@ sub makesum_plist
if (-d $state->{base}.$d) {
undef $d;
}
- $self->format($state, $tempname, $fh);
+ $self->format($state, $tempname, $fh) or return;
if (-z $tempname) {
$state->errsay("groff produced empty result for #1", $dest);
$state->errsay("\tkeeping source manpage");