diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-07-24 08:18:34 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-07-24 08:18:34 +0000 |
commit | dbaefd9ed6bc93042a2d079653ea9aa7889db10a (patch) | |
tree | d921ebdb7464085e5ec9b7fd9b49e270051165e7 /sys-apps | |
parent | Apply patch from kde-testing that fixes doc building. (diff) | |
download | gentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.tar.gz gentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.tar.bz2 gentoo-2-dbaefd9ed6bc93042a2d079653ea9aa7889db10a.zip |
Add tmac fix from upstream #263524 by Horst Prote. Add memory fixes from upstream #294045 by Maurice van der Pot.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/groff/ChangeLog | 13 | ||||
-rw-r--r-- | sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch | 70 | ||||
-rw-r--r-- | sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch | 98 | ||||
-rw-r--r-- | sys-apps/groff/files/groff-1.20.1-tmac-ec.patch | 35 | ||||
-rw-r--r-- | sys-apps/groff/groff-1.20.1-r3.ebuild | 91 |
5 files changed, 305 insertions, 2 deletions
diff --git a/sys-apps/groff/ChangeLog b/sys-apps/groff/ChangeLog index 26647379947a..5f1889db58ff 100644 --- a/sys-apps/groff/ChangeLog +++ b/sys-apps/groff/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sys-apps/groff -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/groff/ChangeLog,v 1.103 2009/11/07 06:10:09 matsuu Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/groff/ChangeLog,v 1.104 2010/07/24 08:18:34 vapier Exp $ + +*groff-1.20.1-r3 (24 Jul 2010) + + 24 Jul 2010; Mike Frysinger <vapier@gentoo.org> +groff-1.20.1-r3.ebuild, + +files/groff-1.20.1-Thtml-mem-leak.patch, + +files/groff-1.20.1-double-frees-mem-leaks.patch, + +files/groff-1.20.1-tmac-ec.patch: + Add tmac fix from upstream #263524 by Horst Prote. Add memory fixes from + upstream #294045 by Maurice van der Pot. *groff-1.20.1-r2 (07 Nov 2009) diff --git a/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch b/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch new file mode 100644 index 000000000000..b95ed426280f --- /dev/null +++ b/sys-apps/groff/files/groff-1.20.1-Thtml-mem-leak.patch @@ -0,0 +1,70 @@ +https://bugs.gentoo.org/294045 + +From f68481cd98e1d8451dd16d6d1b1b3513110a5559 Mon Sep 17 00:00:00 2001 +From: wl <wl> +Date: Fri, 10 Apr 2009 18:13:29 +0000 +Subject: [PATCH] Fix a memory leak in troff for -Thtml. + Reported by Urs Eggli <Urs.Eggli@zuerich.ch>. + +* src/roff/troff/node.h (node::~node): Move to... +* src/roff/troff/node.cpp: Here. Free `state' and `push_state'. +--- + ChangeLog | 8 ++++++++ + src/roff/troff/node.cpp | 11 ++++++++++- + src/roff/troff/node.h | 4 ---- + 3 files changed, 18 insertions(+), 5 deletions(-) + +diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp +index afe4998..58cf59a 100644 +--- a/src/roff/troff/node.cpp ++++ b/src/roff/troff/node.cpp +@@ -1811,6 +1811,14 @@ void suppress_output_file::really_transparent_char(unsigned char) + { + } + ++inline node::~node() ++{ ++ if (state != 0) ++ delete state; ++ if (push_state != 0) ++ delete push_state; ++} ++ + /* glyphs, ligatures, kerns, discretionary breaks */ + + class charinfo_node : public node { +@@ -4643,7 +4651,7 @@ void hline_node::tprint(troff_output_file *out) + } + else { + hunits rem = x - w*i; +- if (rem > H0) ++ if (rem > H0) { + if (n->overlaps_horizontally()) { + if (out->is_on()) + n->tprint(out); +@@ -4651,6 +4659,7 @@ void hline_node::tprint(troff_output_file *out) + } + else + out->right(rem); ++ } + while (--i >= 0) + if (out->is_on()) + n->tprint(out); +diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h +index a598ae5..9850be2 100644 +--- a/src/roff/troff/node.h ++++ b/src/roff/troff/node.h +@@ -132,10 +132,6 @@ inline node::node(node *n, statem *s, int divlevel) + state = 0; + } + +-inline node::~node() +-{ +-} +- + // 0 means it doesn't, 1 means it does, 2 means it's transparent + + int node_list_ends_sentence(node *); +-- +1.7.1.1 + diff --git a/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch b/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch new file mode 100644 index 000000000000..d618030443a2 --- /dev/null +++ b/sys-apps/groff/files/groff-1.20.1-double-frees-mem-leaks.patch @@ -0,0 +1,98 @@ +https://bugs.gentoo.org/294045 + +From be095a293e09eae67254f59ce878b1a36233b447 Mon Sep 17 00:00:00 2001 +From: wl <wl> +Date: Tue, 24 Nov 2009 13:32:17 +0000 +Subject: [PATCH] Fix double frees and memory leaks. + +* src/roff/troff/env.cpp (environment::make_tag): Use local object. +* src/roff/troff/input.cpp (input_stack::check_end_diversion): Free +`diversion_state' here. +(interpolate_arg): Fix memory leaks. +* src/roff/troff/mtsm.cpp (mtsm::pop_state): Don't free `sp->state'. +--- + ChangeLog | 10 ++++++++++ + src/roff/troff/env.cpp | 13 +++++++------ + src/roff/troff/input.cpp | 5 +++++ + src/roff/troff/mtsm.cpp | 2 -- + 4 files changed, 22 insertions(+), 8 deletions(-) + +diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp +index 56bfe21..13672cc 100644 +--- a/src/roff/troff/env.cpp ++++ b/src/roff/troff/env.cpp +@@ -2213,14 +2213,15 @@ node *environment::make_tag(const char *nm, int i) + */ + if (curdiv == topdiv && topdiv->before_first_page) + topdiv->begin_page(); +- macro *m = new macro; +- m->append_str("devtag:"); ++ ++ macro m; ++ m.append_str("devtag:"); + for (const char *p = nm; *p; p++) + if (!invalid_input_char((unsigned char)*p)) +- m->append(*p); +- m->append(' '); +- m->append_int(i); +- return new special_node(*m); ++ m.append(*p); ++ m.append(' '); ++ m.append_int(i); ++ return new special_node(m); + } + return 0; + } +diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp +index 17d2451..7c816e8 100644 +--- a/src/roff/troff/input.cpp ++++ b/src/roff/troff/input.cpp +@@ -531,6 +531,8 @@ void input_stack::check_end_diversion(input_iterator *t) + { + if (t->is_diversion) { + div_level--; ++ if (diversion_state) ++ delete diversion_state; + diversion_state = t->diversion_state; + } + } +@@ -4398,6 +4400,7 @@ static void interpolate_arg(symbol nm) + args += c; + if (i != limit) + args += ' '; ++ delete p; + } + if (limit > 0) { + args += '\0'; +@@ -4419,6 +4422,7 @@ static void interpolate_arg(symbol nm) + args += '"'; + if (i != limit) + args += ' '; ++ delete p; + } + if (limit > 0) { + args += '\0'; +@@ -4438,6 +4442,7 @@ static void interpolate_arg(symbol nm) + } + if (input_stack::space_follows_arg(i)) + args += ' '; ++ delete p; + } + if (limit > 0) { + args += '\0'; +diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp +index 83a6906..79e2f78 100644 +--- a/src/roff/troff/mtsm.cpp ++++ b/src/roff/troff/mtsm.cpp +@@ -390,8 +390,6 @@ void mtsm::pop_state() + #endif + if (sp == 0) + fatal("empty state machine stack"); +- if (sp->state) +- delete sp->state; + sp->state = 0; + stack *t = sp; + sp = sp->next; +-- +1.7.1.1 + diff --git a/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch b/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch new file mode 100644 index 000000000000..20a15c6e21a7 --- /dev/null +++ b/sys-apps/groff/files/groff-1.20.1-tmac-ec.patch @@ -0,0 +1,35 @@ +https://bugs.gentoo.org/263524 + +revision 1.40 +date: 2009-04-01 02:59:08 -0400; author: wl; state: Exp; lines: +3 -3; commitid: VIC1bezuXvKqxhIt; + +* tmac/doc.tmac: Call `ec' before mapping characters. + +Index: tmac/doc.tmac +=================================================================== +RCS file: /sources/groff/groff/tmac/doc.tmac,v +retrieving revision 1.39 +retrieving revision 1.40 +diff -u -p -r1.39 -r1.40 +--- tmac/doc.tmac 2 Jan 2009 23:16:20 -0000 1.39 ++++ tmac/doc.tmac 1 Apr 2009 06:59:08 -0000 1.40 +@@ -6425,6 +6425,9 @@ + .blm doc-empty-line + . + . ++.ec ++. ++. + .\" For UTF-8, map some characters conservatively for the sake + .\" of easy cut and paste. + . +@@ -6438,9 +6441,6 @@ + .\} + . + . +-.ec +-. +-. + .\" load local modifications + .mso mdoc.local + . diff --git a/sys-apps/groff/groff-1.20.1-r3.ebuild b/sys-apps/groff/groff-1.20.1-r3.ebuild new file mode 100644 index 000000000000..c4642c204f4f --- /dev/null +++ b/sys-apps/groff/groff-1.20.1-r3.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/groff/groff-1.20.1-r3.ebuild,v 1.1 2010/07/24 08:18:34 vapier Exp $ + +inherit autotools eutils toolchain-funcs + +DESCRIPTION="Text formatter used for man pages" +HOMEPAGE="http://www.gnu.org/software/groff/groff.html" +SRC_URI="mirror://gnu/groff/${P}.tar.gz + linguas_ja? ( mirror://gentoo/${P}-r2-japanese.patch.bz2 )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="examples X linguas_ja" + +DEPEND=">=sys-apps/texinfo-4.7-r1 + X? ( + x11-libs/libX11 + x11-libs/libXt + x11-libs/libXmu + x11-libs/libXaw + x11-libs/libSM + x11-libs/libICE + )" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502 + epatch "${FILESDIR}"/${P}-tmac-ec.patch #263524 + epatch "${FILESDIR}"/${P}-Thtml-mem-leak.patch #294045 + epatch "${FILESDIR}"/${P}-double-frees-mem-leaks.patch #294045 + + # put the docs in the Gentoo-specific spot + sed -i \ + -e '/^docdir=/s/=.*/=@docdir@/' \ + Makefile.in \ + || die "sed failed" + + # Make sure we can cross-compile this puppy + if tc-is-cross-compiler ; then + sed -i \ + -e '/^GROFFBIN=/s:=.*:=/usr/bin/groff:' \ + -e '/^TROFFBIN=/s:=.*:=/usr/bin/troff:' \ + -e '/^GROFF_BIN_PATH=/s:=.*:=:' \ + -e '/^GROFF_BIN_DIR=/s:=.*:=:' \ + contrib/*/Makefile.sub \ + doc/Makefile.in \ + doc/Makefile.sub || die "cross-compile sed failed" + fi + + cat <<-EOF >> tmac/mdoc.local + .ds volume-operating-system Gentoo + .ds operating-system Gentoo/${KERNEL} + .ds default-operating-system Gentoo/${KERNEL} + EOF + + if use linguas_ja ; then + epatch "${WORKDIR}"/${PF}-japanese.patch #255292 + eautoconf + eautoheader + fi +} + +src_compile() { + # Fix problems with not finding g++ +# tc-export CC CXX + econf \ + --with-appresdir=/usr/share/X11/app-defaults \ + --docdir=/usr/share/doc/${PF} \ + $(use_with X x) \ + $(use linguas_ja && echo --enable-japanese) + emake || die +} + +src_install() { + emake install DESTDIR="${D}" || die + + # The following links are required for man #123674 + dosym eqn /usr/bin/geqn + dosym tbl /usr/bin/gtbl + + dodoc BUG-REPORT ChangeLog MORE.STUFF NEWS \ + PROBLEMS PROJECTS README REVISION TODO VERSION + + if ! use examples ; then + rm -rf "${D}"/usr/share/doc/${PF}/examples + fi +} |