From b485329f34dcbaa270e68b2715bcab11b7104313 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 1 Feb 2024 07:54:16 -0500 Subject: dev-gap/io: backport fix for assertion failure Signed-off-by: Michael Orlitzky --- .../io/files/io-4.8.2-fix-failed-assertion.patch | 35 ++++++++++++++++++ dev-gap/io/io-4.8.2-r1.ebuild | 43 ++++++++++++++++++++++ dev-gap/io/io-4.8.2.ebuild | 40 -------------------- 3 files changed, 78 insertions(+), 40 deletions(-) create mode 100644 dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch create mode 100644 dev-gap/io/io-4.8.2-r1.ebuild delete mode 100644 dev-gap/io/io-4.8.2.ebuild (limited to 'dev-gap') diff --git a/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch b/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch new file mode 100644 index 000000000000..059cc3387b2b --- /dev/null +++ b/dev-gap/io/files/io-4.8.2-fix-failed-assertion.patch @@ -0,0 +1,35 @@ +From edfbed91b1c98abbed7c57463b88a1e8e134f2c3 Mon Sep 17 00:00:00 2001 +From: Chris Jefferson +Date: Wed, 24 Jan 2024 11:18:09 +0800 +Subject: [PATCH] Check arguments to IO_gmtime and IO_localtime + +--- + src/io.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/io.c b/src/io.c +index 731880e..2a1536e 100644 +--- a/src/io.c ++++ b/src/io.c +@@ -1777,6 +1777,10 @@ static Obj FuncIO_gmtime(Obj self, Obj time) + Obj tmp; + time_t t; + struct tm * s; ++ if (!IS_INT(time)) { ++ SyClearErrorNo(); ++ return Fail; ++ } + if (!IS_INTOBJ(time)) { + tmp = QuoInt(time, INTOBJ_INT(256)); + if (!IS_INTOBJ(tmp)) +@@ -1808,6 +1812,10 @@ static Obj FuncIO_localtime(Obj self, Obj time) + Obj tmp; + time_t t; + struct tm * s; ++ if (!IS_INT(time)) { ++ SyClearErrorNo(); ++ return Fail; ++ } + if (!IS_INTOBJ(time)) { + tmp = QuoInt(time, INTOBJ_INT(256)); + if (!IS_INTOBJ(tmp)) diff --git a/dev-gap/io/io-4.8.2-r1.ebuild b/dev-gap/io/io-4.8.2-r1.ebuild new file mode 100644 index 000000000000..46c12ae997e9 --- /dev/null +++ b/dev-gap/io/io-4.8.2-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools gap-pkg + +DESCRIPTION="Bindings for low level C library I/O routines" +SLOT="0" +SRC_URI="https://github.com/gap-packages/${PN}/releases/download/v${PV}/${P}.tar.bz2" + +LICENSE="GPL-3+" +KEYWORDS="~amd64" +IUSE="examples" + +DEPEND="sci-mathematics/gap:=" +RDEPEND="${DEPEND}" + +# backport, merged upstream already +PATCHES=( "${FILESDIR}/${P}-fix-failed-assertion.patch" ) + +gap-pkg_enable_tests + +src_prepare() { + default + + # These tests require network access + rm tst/http.g || die + sed -e 's/"http.g", //' -i tst/testgap.tst || die + + # Support pathological CFLAGS + eautoreconf +} + +src_install() { + # There's no install target for the autotools build system + gap-pkg_src_install + + if use examples; then + docinto examples + dodoc example/* + fi +} diff --git a/dev-gap/io/io-4.8.2.ebuild b/dev-gap/io/io-4.8.2.ebuild deleted file mode 100644 index 06e9f54c7b67..000000000000 --- a/dev-gap/io/io-4.8.2.ebuild +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit autotools gap-pkg - -DESCRIPTION="Bindings for low level C library I/O routines" -SLOT="0" -SRC_URI="https://github.com/gap-packages/${PN}/releases/download/v${PV}/${P}.tar.bz2" - -LICENSE="GPL-3+" -KEYWORDS="~amd64" -IUSE="examples" - -DEPEND="sci-mathematics/gap:=" -RDEPEND="${DEPEND}" - -gap-pkg_enable_tests - -src_prepare() { - default - - # These tests require network access - rm tst/http.g || die - sed -e 's/"http.g", //' -i tst/testgap.tst || die - - # Support pathological CFLAGS - eautoreconf -} - -src_install() { - # There's no install target for the autotools build system - gap-pkg_src_install - - if use examples; then - docinto examples - dodoc example/* - fi -} -- cgit v1.2.3-65-gdbad