Skip to content

Commit

Permalink
New revision of sys-devel/bc-1.06.95 (solves Gentoo bug #264889)
Browse files Browse the repository at this point in the history
  • Loading branch information
adessemond committed Apr 18, 2011
1 parent b592b27 commit 16735c2
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys-devel/bc/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AUX bc-1.06.95-memleak.patch 682 RMD160 7529e70429f6815ec6218602ab2ec68426681855 SHA1 2580a87844ac673448b4d5e62a99c36251b31549 SHA256 85a4cb3b4517d4e262e65f12e3cbb44170cb8e1acfa375fe21f0930a35f27753
AUX bc-1.06.95-void_uninitialized.patch 351 RMD160 ddf88b268b16975378dabe9290724f3b8c4d1925 SHA1 c6f8d7a3081990273aa8a8574fc67327043f78b5 SHA256 440a9a20633317204a0205962f573a932ef4493b1dc9ff3253bfed22c8caf5cd
DIST bc-1.06.95.tar.bz2 290069 RMD160 d58c2d7a1f4b7bfa910f26e5809f3169a6e0da76 SHA1 18717e0543b1dda779a71e6a812f11b8261a705a SHA256 7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc
EBUILD bc-1.06.95-r1.ebuild 1389 RMD160 bc02f08e4a14ae4f93d2591cbd87fd5f3208b49e SHA1 5aa2db17abd731209c02ce7a8862ba3a9de7d742 SHA256 8f5c40ba1a735dcb7bd0267f0f26483c441b7bcb90f2d1f3430ae9f7f1d773b6
EBUILD bc-1.06.95-r2.ebuild 1438 RMD160 16a4ec1dc3ca179922e14ae299e864ade5d5ed0d SHA1 696ffe06da047db770df95e7bd8f75382d7d1746 SHA256 6eab41acf53ae09b1512054c4af579c4c745cb11093094e4ef43a4507f5486ae
EBUILD bc-1.06.95.ebuild 1305 RMD160 3c401dca1921925d37e00ba465a36deb5dfa8380 SHA1 17b8ba8db78d769119e64849b68a80470b023e8c SHA256 8c7d5d789dcbce96c8d94736061c810b7e9dcb06db621e4e36a605266a507b0b
44 changes: 44 additions & 0 deletions sys-devel/bc/bc-1.06.95-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/bc/bc-1.06.95-r1.ebuild,v 1.2 2011/02/15 12:33:45 grobian Exp $

EAPI="2"

inherit eutils flag-o-matic

DESCRIPTION="Handy console-based calculator utility"
HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
SRC_URI="ftp://alpha.gnu.org/gnu/bc/${P}.tar.bz2
mirror://gnu/bc/${P}.tar.bz2"

LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="libedit readline static"

RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
libedit? ( dev-libs/libedit )"
DEPEND="${RDEPEND}
sys-devel/flex"

src_prepare() {
epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
}

src_configure() {
local myconf
if use readline ; then
myconf="--with-readline --without-libedit"
elif use libedit ; then
myconf="--without-readline --with-libedit"
else
myconf="--without-readline --without-libedit"
fi
use static && append-ldflags -static
econf ${myconf}
}

src_install() {
emake install DESTDIR="${D}" || die
dodoc AUTHORS FAQ NEWS README ChangeLog
}
45 changes: 45 additions & 0 deletions sys-devel/bc/bc-1.06.95-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/bc/bc-1.06.95-r1.ebuild,v 1.2 2011/02/15 12:33:45 grobian Exp $

EAPI="2"

inherit eutils flag-o-matic

DESCRIPTION="Handy console-based calculator utility"
HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
SRC_URI="ftp://alpha.gnu.org/gnu/bc/${P}.tar.bz2
mirror://gnu/bc/${P}.tar.bz2"

LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="libedit readline static"

RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
libedit? ( dev-libs/libedit )"
DEPEND="${RDEPEND}
sys-devel/flex"

src_prepare() {
epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
epatch "${FILESDIR}"/${P}-memleak.patch #264889
}

src_configure() {
local myconf
if use readline ; then
myconf="--with-readline --without-libedit"
elif use libedit ; then
myconf="--without-readline --with-libedit"
else
myconf="--without-readline --without-libedit"
fi
use static && append-ldflags -static
econf ${myconf}
}

src_install() {
emake install DESTDIR="${D}" || die
dodoc AUTHORS FAQ NEWS README ChangeLog
}
39 changes: 39 additions & 0 deletions sys-devel/bc/bc-1.06.95.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/bc/bc-1.06.95.ebuild,v 1.13 2010/02/05 09:55:02 aballier Exp $

inherit eutils flag-o-matic toolchain-funcs

DESCRIPTION="Handy console-based calculator utility"
HOMEPAGE="http://www.gnu.org/software/bc/bc.html"
SRC_URI="ftp://alpha.gnu.org/gnu/bc/${P}.tar.bz2
mirror://gnu/bc/${P}.tar.bz2"

LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="libedit readline static"

RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
libedit? ( dev-libs/libedit )"
DEPEND="${RDEPEND}
sys-devel/flex"

src_compile() {
local myconf
if use readline ; then
myconf="--with-readline --without-libedit"
elif use libedit ; then
myconf="--without-readline --with-libedit"
else
myconf="--without-readline --without-libedit"
fi
use static && append-ldflags -static
econf ${myconf} || die
emake || die
}

src_install() {
emake install DESTDIR="${D}" || die
dodoc AUTHORS FAQ NEWS README ChangeLog
}
26 changes: 26 additions & 0 deletions sys-devel/bc/files/bc-1.06.95-memleak.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/bc/bc.y b/bc/bc.y
index 14dc4be..bd91c38 100644
--- a/bc/bc.y
+++ b/bc/bc.y
@@ -569,6 +569,7 @@ expression : named_expression ASSIGN_OP
generate (">");
break;
}
+ free($2);
}
| expression '+' expression
{
diff --git a/bc/util.c b/bc/util.c
index 30beaf9..26e2e85 100644
--- a/bc/util.c
+++ b/bc/util.c
@@ -602,8 +602,7 @@ lookup (name, namekind)
case FUNCTDEF:
if (id->f_name != 0)
{
- if (namekind != FUNCT)
- free(name);
+ free(name);
/* Check to see if we are redefining a math lib function. */
if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
id->f_name = next_func++;
13 changes: 13 additions & 0 deletions sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
http://www.pixelbeat.org/programming/oss_bug_flow.html
https://bugs.gentoo.org/349339

--- bc/storage.c
+++ bc/storage.c
@@ -99,6 +99,7 @@
{
f = &functions[indx];
f->f_defined = FALSE;
+ f->f_void = FALSE;
f->f_body = (char *) bc_malloc (BC_START_SIZE);
f->f_body_size = BC_START_SIZE;
f->f_code_size = 0;

0 comments on commit 16735c2

Please sign in to comment.