Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 726130 Details for
Bug 801034
app-text/mandoc-1.14.5-r1: consider backporting a patch to fix segfault
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
mandoc-1.14.5-r2 revbump proposal
0001-app-text-mandoc-revbump-fixes-runtime-error.patch (text/plain), 13.47 KB, created by
Anna Vyalkova
on 2021-07-23 14:38:04 UTC
(
hide
)
Description:
mandoc-1.14.5-r2 revbump proposal
Filename:
MIME Type:
Creator:
Anna Vyalkova
Created:
2021-07-23 14:38:04 UTC
Size:
13.47 KB
patch
obsolete
>From bdaaaa4a61acf54b7af92e27e9a375ba8ddc937b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= <cyber@sysrq.in> >Date: Fri, 23 Jul 2021 19:22:18 +0500 >Subject: [PATCH] app-text/mandoc: revbump (fixes runtime error) > >This ebuild backports a patch for bug in tbl_term.c, causing mandoc >segfault on some manpages (nft, for example). > >Other changes include: > >* Using savedconfig for cgi.h file. The default one is literally > unusable > >* Enable regress test suite > >* Change PORTAGE_COMPRESS check from "if"s to "case" for better > readability > >* Add "tools" use flag for catman and mandocd system administration > tools > >* Install exra manpages (for libmandoc and man.cgi) > >* Install library header files > >* Update homepage > >Closes: https://bugs.gentoo.org/801034 >Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in> >--- > .../files/mandoc-1.14.5-fix-tbl-crashes.patch | 216 ++++++++++++++++++ > app-text/mandoc/mandoc-1.14.5-r2.ebuild | 150 ++++++++++++ > app-text/mandoc/metadata.xml | 5 +- > 3 files changed, 369 insertions(+), 2 deletions(-) > create mode 100644 app-text/mandoc/files/mandoc-1.14.5-fix-tbl-crashes.patch > create mode 100644 app-text/mandoc/mandoc-1.14.5-r2.ebuild > >diff --git a/app-text/mandoc/files/mandoc-1.14.5-fix-tbl-crashes.patch b/app-text/mandoc/files/mandoc-1.14.5-fix-tbl-crashes.patch >new file mode 100644 >index 000000000000..3b2560387e9e >--- /dev/null >+++ b/app-text/mandoc/files/mandoc-1.14.5-fix-tbl-crashes.patch >@@ -0,0 +1,216 @@ >+https://cvsweb.bsd.lv/mandoc/tbl_term.c.diff?r1=1.68&r2=1.73 >+ >+https://bugs.gentoo.org/801034 >+--- mandoc/tbl_term.c 2019/02/09 21:02:47 1.68 >++++ mandoc/tbl_term.c 2020/01/11 16:26:08 1.73 >+@@ -1,7 +1,7 @@ >+-/* $Id: tbl_term.c,v 1.68 2019/02/09 21:02:47 schwarze Exp $ */ >++/* $Id: tbl_term.c,v 1.73 2020/01/11 16:26:08 schwarze Exp $ */ >+ /* >+ * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> >+- * Copyright (c) 2011-2019 Ingo Schwarze <schwarze@openbsd.org> >++ * Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org> >+ * >+ * Permission to use, copy, modify, and distribute this software for any >+ * purpose with or without fee is hereby granted, provided that the above >+@@ -46,7 +46,8 @@ static void tbl_fill_border(struct termp *, int, size_ >+ static void tbl_fill_char(struct termp *, char, size_t); >+ static void tbl_fill_string(struct termp *, const char *, size_t); >+ static void tbl_hrule(struct termp *, const struct tbl_span *, >+- const struct tbl_span *, int); >++ const struct tbl_span *, const struct tbl_span *, >++ int); >+ static void tbl_literal(struct termp *, const struct tbl_dat *, >+ const struct roffcol *); >+ static void tbl_number(struct termp *, const struct tbl_opts *, >+@@ -163,7 +164,7 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ const struct tbl_cell *cp, *cpn, *cpp, *cps; >+ const struct tbl_dat *dp; >+ static size_t offset; >+- size_t save_offset; >++ size_t save_offset; >+ size_t coloff, tsz; >+ int hspans, ic, more; >+ int dvert, fc, horiz, lhori, rhori, uvert; >+@@ -222,9 +223,9 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ >+ if (tp->enc == TERMENC_ASCII && >+ sp->opts->opts & TBL_OPT_DBOX) >+- tbl_hrule(tp, NULL, sp, TBL_OPT_DBOX); >++ tbl_hrule(tp, NULL, sp, sp, TBL_OPT_DBOX); >+ if (sp->opts->opts & (TBL_OPT_DBOX | TBL_OPT_BOX)) >+- tbl_hrule(tp, NULL, sp, TBL_OPT_BOX); >++ tbl_hrule(tp, NULL, sp, sp, TBL_OPT_BOX); >+ } >+ >+ /* Set up the columns. */ >+@@ -266,11 +267,11 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ hspans--; >+ continue; >+ } >+- if (dp == NULL) >+- continue; >+- hspans = dp->hspans; >+- if (ic || sp->layout->first->pos != TBL_CELL_SPAN) >++ if (dp != NULL && >++ (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { >++ hspans = dp->hspans; >+ dp = dp->next; >++ } >+ } >+ >+ /* Set up a column for a right vertical frame. */ >+@@ -301,11 +302,11 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ tp->tcol++; >+ tp->col = 0; >+ tbl_data(tp, sp->opts, cp, dp, tp->tbl.cols + ic); >+- if (dp == NULL) >+- continue; >+- hspans = dp->hspans; >+- if (cp->pos != TBL_CELL_SPAN) >++ if (dp != NULL && >++ (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { >++ hspans = dp->hspans; >+ dp = dp->next; >++ } >+ } >+ break; >+ } >+@@ -342,7 +343,7 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ >+ more = 0; >+ if (horiz) >+- tbl_hrule(tp, sp->prev, sp, 0); >++ tbl_hrule(tp, sp->prev, sp, sp->next, 0); >+ else { >+ cp = sp->layout->first; >+ cpn = sp->next == NULL ? NULL : >+@@ -424,11 +425,10 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ cp = cp->next; >+ continue; >+ } >+- if (dp != NULL) { >++ if (dp != NULL && (ic || >++ sp->layout->first->pos != TBL_CELL_SPAN)) { >+ hspans = dp->hspans; >+- if (ic || sp->layout->first->pos >+- != TBL_CELL_SPAN) >+- dp = dp->next; >++ dp = dp->next; >+ } >+ >+ /* >+@@ -557,12 +557,12 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ tp->tcol->rmargin = tp->maxrmargin; >+ if (sp->next == NULL) { >+ if (sp->opts->opts & (TBL_OPT_DBOX | TBL_OPT_BOX)) { >+- tbl_hrule(tp, sp, NULL, TBL_OPT_BOX); >++ tbl_hrule(tp, sp, sp, NULL, TBL_OPT_BOX); >+ tp->skipvsp = 1; >+ } >+ if (tp->enc == TERMENC_ASCII && >+ sp->opts->opts & TBL_OPT_DBOX) { >+- tbl_hrule(tp, sp, NULL, TBL_OPT_DBOX); >++ tbl_hrule(tp, sp, sp, NULL, TBL_OPT_DBOX); >+ tp->skipvsp = 2; >+ } >+ assert(tp->tbl.cols); >+@@ -571,7 +571,7 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ } else if (horiz == 0 && sp->opts->opts & TBL_OPT_ALLBOX && >+ (sp->next == NULL || sp->next->pos == TBL_SPAN_DATA || >+ sp->next->next != NULL)) >+- tbl_hrule(tp, sp, sp->next, TBL_OPT_ALLBOX); >++ tbl_hrule(tp, sp, sp, sp->next, TBL_OPT_ALLBOX); >+ >+ tp->tcol->offset = save_offset; >+ tp->flags &= ~TERMP_NONOSPACE; >+@@ -579,9 +579,10 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) >+ >+ static void >+ tbl_hrule(struct termp *tp, const struct tbl_span *spp, >+- const struct tbl_span *spn, int flags) >++ const struct tbl_span *sp, const struct tbl_span *spn, int flags) >+ { >+ const struct tbl_cell *cpp; /* Layout cell above this line. */ >++ const struct tbl_cell *cp; /* Layout cell in this line. */ >+ const struct tbl_cell *cpn; /* Layout cell below this line. */ >+ const struct tbl_dat *dpn; /* Data cell below this line. */ >+ const struct roffcol *col; /* Contains width and spacing. */ >+@@ -592,6 +593,7 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ int uw, dw; /* Vertical line widths. */ >+ >+ cpp = spp == NULL ? NULL : spp->layout->first; >++ cp = sp == NULL ? NULL : sp->layout->first; >+ cpn = spn == NULL ? NULL : spn->layout->first; >+ dpn = NULL; >+ if (spn != NULL) { >+@@ -600,11 +602,11 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ else if (spn->next != NULL) >+ dpn = spn->next->first; >+ } >+- opts = spn == NULL ? spp->opts->opts : spn->opts->opts; >++ opts = sp->opts->opts; >+ bw = opts & TBL_OPT_DBOX ? (tp->enc == TERMENC_UTF8 ? 2 : 1) : >+ opts & (TBL_OPT_BOX | TBL_OPT_ALLBOX) ? 1 : 0; >+ hw = flags == TBL_OPT_DBOX || flags == TBL_OPT_BOX ? bw : >+- spn->pos == TBL_SPAN_DHORIZ ? 2 : 1; >++ sp->pos == TBL_SPAN_DHORIZ ? 2 : 1; >+ >+ /* Print the left end of the line. */ >+ >+@@ -619,14 +621,19 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ (spp == NULL || cpn == NULL || >+ cpn->pos != TBL_CELL_DOWN ? BRIGHT * hw : 0), 1); >+ >++ col = tp->tbl.cols; >+ for (;;) { >+- col = tp->tbl.cols + (cpn == NULL ? cpp->col : cpn->col); >++ if (cp == NULL) >++ col++; >++ else >++ col = tp->tbl.cols + cp->col; >+ >+ /* Print the horizontal line inside this column. */ >+ >+ lw = cpp == NULL || cpn == NULL || >+ (cpn->pos != TBL_CELL_DOWN && >+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0)) >++ (dpn == NULL || dpn->string == NULL || >++ strcmp(dpn->string, "\\^") != 0)) >+ ? hw : 0; >+ tbl_direct_border(tp, BHORIZ * lw, >+ col->width + col->spacing / 2); >+@@ -645,7 +652,10 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ uw = 1; >+ } >+ cpp = cpp->next; >+- } >++ } else if (spp != NULL && opts & TBL_OPT_ALLBOX) >++ uw = 1; >++ if (cp != NULL) >++ cp = cp->next; >+ if (cpn != NULL) { >+ if (flags != TBL_OPT_DBOX) { >+ dw = cpn->vert; >+@@ -655,8 +665,9 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ cpn = cpn->next; >+ while (dpn != NULL && dpn->layout != cpn) >+ dpn = dpn->next; >+- } >+- if (cpp == NULL && cpn == NULL) >++ } else if (spn != NULL && opts & TBL_OPT_ALLBOX) >++ dw = 1; >++ if (col + 1 == tp->tbl.cols + sp->opts->cols) >+ break; >+ >+ /* Vertical lines do not cross spanned cells. */ >+@@ -670,7 +681,8 @@ tbl_hrule(struct termp *tp, const struct tbl_span *spp >+ >+ rw = cpp == NULL || cpn == NULL || >+ (cpn->pos != TBL_CELL_DOWN && >+- (dpn == NULL || strcmp(dpn->string, "\\^") != 0)) >++ (dpn == NULL || dpn->string == NULL || >++ strcmp(dpn->string, "\\^") != 0)) >+ ? hw : 0; >+ >+ /* The line crossing at the end of this column. */ >diff --git a/app-text/mandoc/mandoc-1.14.5-r2.ebuild b/app-text/mandoc/mandoc-1.14.5-r2.ebuild >new file mode 100644 >index 000000000000..6e8d3de35449 >--- /dev/null >+++ b/app-text/mandoc/mandoc-1.14.5-r2.ebuild >@@ -0,0 +1,150 @@ >+# Copyright 1999-2021 Gentoo Authors >+# Distributed under the terms of the GNU General Public License v2 >+ >+EAPI=7 >+ >+inherit toolchain-funcs savedconfig >+ >+DESCRIPTION="Suite of tools compiling mdoc and man" >+HOMEPAGE="https://mandoc.bsd.lv/" >+SRC_URI="https://mandoc.bsd.lv/snapshots/${P}.tar.gz" >+ >+LICENSE="ISC" >+SLOT="0" >+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" >+IUSE="cgi system-man test tools" >+REQUIRED_USE="savedconfig? ( cgi )" >+RESTRICT="!test? ( test )" >+ >+RDEPEND="sys-libs/zlib >+ system-man? ( !sys-apps/man-db ) >+" >+DEPEND="${RDEPEND} >+ cgi? ( sys-libs/zlib[static-libs] ) >+" >+BDEPEND=" >+ cgi? ( app-text/highlight ) >+ test? ( dev-lang/perl ) >+" >+ >+PATCHES=( >+ "${FILESDIR}"/${PN}-1.14.5-r1-www-install.patch >+ "${FILESDIR}"/${PN}-1.14.5-gcc10.patch >+ "${FILESDIR}"/${PN}-1.14.5-fix-tbl-crashes.patch >+) >+ >+pkg_pretend() { >+ use system-man || return >+ >+ # only support uncompressed and gzip >+ case "${PORTAGE_COMPRESS-bzip2}" in >+ gzip|"") ;; >+ *) ewarn "only PORTAGE_COMPRESS=gzip or '' is supported, man pages will not be indexed" >+ esac >+} >+ >+src_prepare() { >+ default >+ >+ # The db-install change is to support parallel installs. >+ sed -i \ >+ -e '/ar rs/s:ar:$(AR):' \ >+ -e '/^db-install:/s:$: base-install:' \ >+ Makefile || die >+ >+ # make-4.3 doesn't like the CC line (bug #706024) >+ # and "echo -n" is not portable >+ sed \ >+ -e "s@^\(CC=\).*\$@\1\"$(tc-getCC)\"@" \ >+ -e 's@echo -n@printf@g' \ >+ -i configure || die >+ >+ cat <<-EOF > "configure.local" >+ PREFIX="${EPREFIX}/usr" >+ BINDIR="${EPREFIX}/usr/bin" >+ SBINDIR="${EPREFIX}/usr/sbin" >+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" >+ MANDIR="${EPREFIX}/usr/share/man" >+ INCLUDEDIR="${EPREFIX}/usr/include/mandoc" >+ EXAMPLEDIR="${EPREFIX}/usr/share/examples/mandoc" >+ MANPATH_DEFAULT="${EPREFIX}/usr/man:${EPREFIX}/usr/share/man:${EPREFIX}/usr/local/man:${EPREFIX}/usr/local/share/man" >+ >+ CFLAGS="${CFLAGS} ${CPPFLAGS}" >+ LDFLAGS="${LDFLAGS}" >+ AR="$(tc-getAR)" >+ CC="$(tc-getCC)" >+ # The STATIC variable is only used by man.cgi. >+ STATIC= >+ >+ # conflicts with sys-apps/groff >+ BINM_SOELIM=msoelim >+ MANM_ROFF=mandoc_roff >+ # conflicts with sys-apps/man-pages >+ MANM_MAN=mandoc_man >+ >+ # fix utf-8 locale on musl >+ $(usex elibc_musl UTF8_LOCALE=C.UTF-8 '') >+ EOF >+ use system-man || cat <<-EOF >> "configure.local" >+ BINM_MAN=mman >+ BINM_APROPOS=mapropos >+ BINM_WHATIS=mwhatis >+ BINM_MAKEWHATIS=mmakewhatis >+ MANM_MDOC=mandoc_mdoc >+ MANM_EQN=mandoc_eqn >+ MANM_TBL=mandoc_tbl >+ MANM_MANCONF=mman.conf >+ EOF >+ if use cgi; then >+ cp cgi.h{.example,} || die >+ restore_config cgi.h >+ fi >+ >+ # ./configure does not propagate all configure.local >+ # settings to Makefile.local settings. >+ tc-export AR >+} >+ >+src_compile() { >+ default >+ use cgi && emake man.cgi >+ use tools && emake catman >+} >+ >+src_test() { >+ cd regress || die >+ ./regress.pl . all verbose || die "tests failed" >+} >+ >+src_install() { >+ local extra_manpages=( man.options.1 ) >+ >+ emake DESTDIR="${D}" install >+ >+ # install library manpages and header files but >+ # not the static library itself (PG0302) >+ emake DESTDIR="${D}" lib-install >+ find "${ED}" -name libmandoc.a -delete || die >+ >+ use tools && emake DESTDIR="${D}" catman-install >+ >+ if use cgi ; then >+ emake DESTDIR="${D}" cgi-install www-install >+ extra_manpages+=( man.cgi.{3,8} ) >+ save_config cgi.h >+ fi >+ >+ if use system-man ; then >+ exeinto /etc/cron.daily >+ newexe "${FILESDIR}"/mandoc.cron-r0 mandoc >+ fi >+ >+ doman "${extra_manpages[@]}" >+} >+ >+pkg_postinst() { >+ if use system-man ; then >+ elog "Generating mandoc database" >+ makewhatis || die >+ fi >+} >diff --git a/app-text/mandoc/metadata.xml b/app-text/mandoc/metadata.xml >index 814b35c62403..bc9ac82ebb97 100644 >--- a/app-text/mandoc/metadata.xml >+++ b/app-text/mandoc/metadata.xml >@@ -5,7 +5,8 @@ > <email>base-system@gentoo.org</email> > </maintainer> > <use> >- <flag name="cgi">build man.cgi web plugin for viewing man pages</flag> >- <flag name="system-man">set as the default man provider</flag> >+ <flag name="cgi">Build man.cgi web plugin for viewing man pages</flag> >+ <flag name="system-man">Set as the default man provider</flag> >+ <flag name="tools">Build catman and mandocd system administration tools</flag> > </use> > </pkgmetadata> >-- >2.32.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 801034
:
726127
| 726130