summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-04-12 00:12:42 +0000
committerMike Frysinger <vapier@gentoo.org>2006-04-12 00:12:42 +0000
commitf64a61766fe7f5d467e0f9006ca4a5674ea030a5 (patch)
tree64f7d16bd60a7e1c906b2caaa98861ca1e12b665 /sys-apps/gawk
parentadd some more notes about this patch (diff)
downloadgentoo-2-f64a61766fe7f5d467e0f9006ca4a5674ea030a5.tar.gz
gentoo-2-f64a61766fe7f5d467e0f9006ca4a5674ea030a5.tar.bz2
gentoo-2-f64a61766fe7f5d467e0f9006ca4a5674ea030a5.zip
Fix bug in FIELDWIDTHS and grab some other patches from Fedora.
(Portage version: 2.1_pre7-r5)
Diffstat (limited to 'sys-apps/gawk')
-rw-r--r--sys-apps/gawk/ChangeLog9
-rw-r--r--sys-apps/gawk/files/digest-gawk-3.1.5-r13
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-binmode.patch20
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch35
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-num2str.patch42
-rw-r--r--sys-apps/gawk/gawk-3.1.5-r1.ebuild112
6 files changed, 220 insertions, 1 deletions
diff --git a/sys-apps/gawk/ChangeLog b/sys-apps/gawk/ChangeLog
index 87cfb116d1a1..d7ce0b7fefe7 100644
--- a/sys-apps/gawk/ChangeLog
+++ b/sys-apps/gawk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/gawk
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/ChangeLog,v 1.76 2006/03/30 15:12:21 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/ChangeLog,v 1.77 2006/04/12 00:12:42 vapier Exp $
+
+*gawk-3.1.5-r1 (12 Apr 2006)
+
+ 12 Apr 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/gawk-3.1.5-binmode.patch, +files/gawk-3.1.5-fieldwidths.patch,
+ +files/gawk-3.1.5-num2str.patch, +gawk-3.1.5-r1.ebuild:
+ Fix bug in FIELDWIDTHS and grab some other patches from Fedora.
30 Mar 2006; Diego Pettenò <flameeyes@gentoo.org> gawk-3.1.5.ebuild:
Add ~x86-fbsd keyword.
diff --git a/sys-apps/gawk/files/digest-gawk-3.1.5-r1 b/sys-apps/gawk/files/digest-gawk-3.1.5-r1
new file mode 100644
index 000000000000..9ac602be41d5
--- /dev/null
+++ b/sys-apps/gawk/files/digest-gawk-3.1.5-r1
@@ -0,0 +1,3 @@
+MD5 4760325489479cac17fe0114b8f62f30 gawk-3.1.5.tar.gz 2310919
+RMD160 8d875f4ea9e9ef5c932468cf43c691f6e082b197 gawk-3.1.5.tar.gz 2310919
+SHA256 463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8 gawk-3.1.5.tar.gz 2310919
diff --git a/sys-apps/gawk/files/gawk-3.1.5-binmode.patch b/sys-apps/gawk/files/gawk-3.1.5-binmode.patch
new file mode 100644
index 000000000000..ab811d2c92f7
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-binmode.patch
@@ -0,0 +1,20 @@
+Ripped from Fedora
+
+* Thu Dec 22 2005 Karel Zak <kzak@redhat.com> 3.1.5-5
+- fix "gawk -v BINMODE=1" (patch by Aharon Robbins)
+
+ * eval.c (set_BINMODE): Fix logic of test for no numeric value.
+ Makes `gawk -v BINMODE=1 ...' work again. Thanks to Eli Zaretskii
+ <eliz@gnu.org> for pointing out the problem.
+
+--- gawk-3.1.5/eval.c.binmode 2005-12-22 19:05:32.000000000 +0100
++++ gawk-3.1.5/eval.c 2005-12-22 19:06:40.000000000 +0100
+@@ -2167,7 +2167,7 @@
+ }
+ }
+
+- if (! digits || (BINMODE_node->var_value->flags & MAYBE_NUM) == 0) {
++ if (! digits && (BINMODE_node->var_value->flags & MAYBE_NUM) == 0) {
+ BINMODE = 0;
+ if (strcmp(p, "r") == 0)
+ BINMODE = 1;
diff --git a/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch b/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch
new file mode 100644
index 000000000000..905718b1f2f6
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch
@@ -0,0 +1,35 @@
+Ripped from Fedora
+
+* Sun Oct 9 2005 Karel Zak <kzak@redhat.com> 3.1.5-4
+- fix off-by-one error in assignment of sentinel value at
+ end of FIELDWIDTHS array. (patch by Aharon Robbins)
+
+--- gawk-3.1.5/field.c.fieldwidths 2005-05-11 17:28:15.000000000 +0200
++++ gawk-3.1.5/field.c 2005-10-09 08:35:54.000000000 +0200
+@@ -916,7 +916,7 @@
+
+ parse_field = fw_parse_field;
+ scan = force_string(FIELDWIDTHS_node->var_value)->stptr;
+- end = scan + 1;
++
+ if (FIELDWIDTHS == NULL)
+ emalloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS");
+ FIELDWIDTHS[0] = 0;
+@@ -941,7 +941,7 @@
+ errno = 0;
+ tmp = strtoul(scan, &end, 10);
+ if (errno != 0
+- || !(*end == '\0' || is_blank(*end))
++ || (*end != '\0' && ! is_blank(*end))
+ || !(0 < tmp && tmp <= INT_MAX))
+ fatal(_("invalid FIELDWIDTHS value, near `%s'"),
+ scan);
+@@ -954,7 +954,7 @@
+ if (*scan == '\0')
+ break;
+ }
+- FIELDWIDTHS[i] = -1;
++ FIELDWIDTHS[i+1] = -1;
+
+ update_PROCINFO("FS", "FIELDWIDTHS");
+ }
diff --git a/sys-apps/gawk/files/gawk-3.1.5-num2str.patch b/sys-apps/gawk/files/gawk-3.1.5-num2str.patch
new file mode 100644
index 000000000000..57ecd46b4762
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-num2str.patch
@@ -0,0 +1,42 @@
+Ripped from Fedora
+
+* Thu Dec 22 2005 Karel Zak <kzak@redhat.com> 3.1.5-5
+- fix conversion from large number to string (patch by Aharon Robbins)
+
+--- gawk-3.1.5/node.c.num2str 2005-07-26 20:07:43.000000000 +0200
++++ gawk-3.1.5/node.c 2005-12-22 19:41:55.000000000 +0100
+@@ -151,6 +151,7 @@
+ register char *sp = buf;
+ double val;
+ char *orig, *trans, save;
++ register long num;
+
+ if (! do_traditional && (s->flags & INTLSTR) != 0) {
+ save = s->stptr[s->stlen];
+@@ -163,9 +164,12 @@
+ return tmp_string(trans, strlen(trans));
+ }
+
+- /* not an integral value, or out of range */
+- if ((val = double_to_int(s->numbr)) != s->numbr
+- || val < LONG_MIN || val > LONG_MAX) {
++ /* conversion to long overflows, or out of range, or not integral */
++ val = double_to_int(s->numbr);
++ num = (long) val;
++ if ( (s->numbr > 0 && num < 0)
++ || (s->numbr < 0 && num > 0)
++ || val < LONG_MIN || val > LONG_MAX || val != s->numbr) {
+ /*
+ * Once upon a time, if GFMT_WORKAROUND wasn't defined,
+ * we just blindly did this:
+@@ -199,9 +203,7 @@
+
+ goto no_malloc;
+ } else {
+- /* integral value */
+- /* force conversion to long only once */
+- register long num = (long) val;
++ /* integral value, in range, too! */
+ if (num < NVAL && num >= 0) {
+ sp = (char *) values[num];
+ s->stlen = 1;
diff --git a/sys-apps/gawk/gawk-3.1.5-r1.ebuild b/sys-apps/gawk/gawk-3.1.5-r1.ebuild
new file mode 100644
index 000000000000..6a9080260911
--- /dev/null
+++ b/sys-apps/gawk/gawk-3.1.5-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/gawk-3.1.5-r1.ebuild,v 1.1 2006/04/12 00:12:42 vapier Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="GNU awk pattern-matching language"
+HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="nls build"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+SFFS=${WORKDIR}/filefuncs
+
+src_unpack() {
+ unpack ${P}.tar.gz
+
+ # Copy filefuncs module's source over ...
+ cp -pPR "${FILESDIR}"/filefuncs "${SFFS}" || die "cp failed"
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-core.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch
+ # Patches from Fedora
+ epatch "${FILESDIR}"/${PN}-3.1.3-getpgrp_void.patch
+ epatch "${FILESDIR}"/${P}-fieldwidths.patch #127163
+ epatch "${FILESDIR}"/${P}-binmode.patch
+ epatch "${FILESDIR}"/${P}-num2str.patch
+ # support for dec compiler.
+ [[ $(tc-getCC) == "ccc" ]] && epatch "${FILESDIR}"/${PN}-3.1.2-dec-alpha-compiler.diff
+}
+
+src_compile() {
+ econf \
+ --bindir=/bin \
+ --libexec='$(libdir)/misc' \
+ $(use_enable nls) \
+ --enable-switch \
+ || die
+ emake || die "emake failed"
+
+ cd "${SFFS}"
+ emake CC=$(tc-getCC) || die "filefuncs emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "install failed"
+ cd "${SFFS}"
+ make LIBDIR="$(get_libdir)" install || die "filefuncs install failed"
+
+ dodir /usr/bin
+ # In some rare cases, (p)gawk gets installed as (p)gawk- and not
+ # (p)gawk-${PV} ... Also make sure that /bin/(p)gawk is a symlink
+ # to /bin/(p)gawk-${PV}.
+ local binpath x
+ for x in gawk pgawk igawk ; do
+ [[ ${x} == "gawk" ]] \
+ && binpath="/bin" \
+ || binpath="/usr/bin"
+
+ if [[ -f ${D}/bin/${x} && ! -f ${D}/bin/${x}-${PV} ]] ; then
+ mv -f "${D}"/bin/${x} "${D}"/${binpath}/${x}-${PV}
+ elif [[ -f ${D}/bin/${x}- && ! -f ${D}/bin/${x}-${PV} ]] ; then
+ mv -f "${D}"/bin/${x}- "${D}"/${binpath}/${x}-${PV}
+ elif [[ ${binpath} == "/usr/bin" && -f ${D}/bin/${x}-${PV} ]] ; then
+ mv -f "${D}"/bin/${x}-${PV} "${D}"/${binpath}/${x}-${PV}
+ fi
+
+ rm -f "${D}"/bin/${x}
+ dosym ${x}-${PV} ${binpath}/${x}
+ [[ ${binpath} == "/usr/bin" ]] && dosym /usr/bin/${x}-${PV} /bin/${x}
+ done
+
+ rm -f "${D}"/bin/awk
+ dodir /usr/bin
+ # Compat symlinks
+ dosym /bin/gawk-${PV} /usr/bin/gawk
+ dosym gawk-${PV} /bin/awk
+ dosym /bin/gawk-${PV} /usr/bin/awk
+ [[ ${USERLAND} != "GNU" ]] && rm -f "${D}"/{,usr/}bin/awk{,-${PV}}
+
+ # Install headers
+ insinto /usr/include/awk
+ doins "${S}"/*.h || die "ins headers failed"
+ # We do not want 'acconfig.h' in there ...
+ rm -f "${D}"/usr/include/awk/acconfig.h
+
+ if ! use build ; then
+ cd "${S}"
+ rm -f "${D}"/usr/share/man/man1/pgawk.1
+ dosym gawk.1.gz /usr/share/man/man1/pgawk.1.gz
+ [[ ${USERLAND} == "GNU" ]] && dosym gawk.1.gz /usr/share/man/man1/awk.1.gz
+ dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README
+ docinto README_d
+ dodoc README_d/*
+ docinto awklib
+ dodoc awklib/ChangeLog
+ docinto pc
+ dodoc pc/ChangeLog
+ docinto posix
+ dodoc posix/ChangeLog
+ else
+ rm -r "${D}"/usr/share
+ fi
+}