summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-08-25 16:10:52 +0000
committerMike Frysinger <vapier@gentoo.org>2007-08-25 16:10:52 +0000
commit09bbd3a640b029aa028781f6f303b9f732f60d6b (patch)
tree3d11b5813dd383928a75a8e3a2b18604fd639185 /sys-apps
parentamd64 stable, bug 173292 (diff)
downloadhistorical-09bbd3a640b029aa028781f6f303b9f732f60d6b.tar.gz
historical-09bbd3a640b029aa028781f6f303b9f732f60d6b.tar.bz2
historical-09bbd3a640b029aa028781f6f303b9f732f60d6b.zip
Snipe some fixes from Fedora.
Package-Manager: portage-2.1.3.7
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/gawk/ChangeLog9
-rw-r--r--sys-apps/gawk/Manifest40
-rw-r--r--sys-apps/gawk/files/digest-gawk-3.1.5-r53
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch257
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-ipv6.patch301
-rw-r--r--sys-apps/gawk/files/gawk-3.1.5-mbread.patch41
-rw-r--r--sys-apps/gawk/gawk-3.1.5-r5.ebuild124
7 files changed, 760 insertions, 15 deletions
diff --git a/sys-apps/gawk/ChangeLog b/sys-apps/gawk/ChangeLog
index 89c55ecc79f6..4874d89b1867 100644
--- a/sys-apps/gawk/ChangeLog
+++ b/sys-apps/gawk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/gawk
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/ChangeLog,v 1.107 2007/07/12 09:26:28 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/ChangeLog,v 1.108 2007/08/25 16:10:52 vapier Exp $
+
+*gawk-3.1.5-r5 (25 Aug 2007)
+
+ 25 Aug 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/gawk-3.1.5-freewstr2.patch, +files/gawk-3.1.5-ipv6.patch,
+ +files/gawk-3.1.5-mbread.patch, +gawk-3.1.5-r5.ebuild:
+ Snipe some fixes from Fedora.
*gawk-3.1.5-r4 (12 Jul 2007)
diff --git a/sys-apps/gawk/Manifest b/sys-apps/gawk/Manifest
index 5a0994dbeba9..d47626d21f12 100644
--- a/sys-apps/gawk/Manifest
+++ b/sys-apps/gawk/Manifest
@@ -37,6 +37,10 @@ AUX gawk-3.1.5-freewstr.patch 4392 RMD160 4bb7a4b02a6c2fe58dc9db98ae9b1bd7181f3c
MD5 916a051c8c4adea14472e31af8268aee files/gawk-3.1.5-freewstr.patch 4392
RMD160 4bb7a4b02a6c2fe58dc9db98ae9b1bd7181f3c70 files/gawk-3.1.5-freewstr.patch 4392
SHA256 6c2a8314dc7860f0a584025834597add02dbbf4b1268dd9ab9260cea393d13c5 files/gawk-3.1.5-freewstr.patch 4392
+AUX gawk-3.1.5-freewstr2.patch 6300 RMD160 69af521aadeec950bbe03b1ef7d26217b7e98d35 SHA1 a6fcba9e4cef73b8a3f0159e49c34148ca77e129 SHA256 1e99d24cc47b300d5af784d9533e18e0b8add0bc9acd9385f8172bbebdf3b1f7
+MD5 6a66dfbaeb1c1bab4405071a5d3225e1 files/gawk-3.1.5-freewstr2.patch 6300
+RMD160 69af521aadeec950bbe03b1ef7d26217b7e98d35 files/gawk-3.1.5-freewstr2.patch 6300
+SHA256 1e99d24cc47b300d5af784d9533e18e0b8add0bc9acd9385f8172bbebdf3b1f7 files/gawk-3.1.5-freewstr2.patch 6300
AUX gawk-3.1.5-gcc4.patch 826 RMD160 a68e7ed7c70aa6be454961aa25903fe236650227 SHA1 8908a11d8e0e3d0ee1cc5ae5b9c31ebc0341cdc8 SHA256 7b7d37a6ecb51300f46ad611d486a074eb522dabb949e500664943df7f52b0e3
MD5 499e2881f167a17f2123ca338836e91d files/gawk-3.1.5-gcc4.patch 826
RMD160 a68e7ed7c70aa6be454961aa25903fe236650227 files/gawk-3.1.5-gcc4.patch 826
@@ -45,6 +49,14 @@ AUX gawk-3.1.5-internal.patch 6410 RMD160 c89773d730fd53f5dde3e898a27a5513fdcb6a
MD5 f0ba103b7715ea97caf928a3ecc3366e files/gawk-3.1.5-internal.patch 6410
RMD160 c89773d730fd53f5dde3e898a27a5513fdcb6aa7 files/gawk-3.1.5-internal.patch 6410
SHA256 b29e9f21d8dacdc474bde3962b55af4792898aff3ce4034f9b0738608ea48c94 files/gawk-3.1.5-internal.patch 6410
+AUX gawk-3.1.5-ipv6.patch 8347 RMD160 3cd726f33cd1994feefbcb1b673e35ee4bdb5480 SHA1 7986707c1b4a3b6054e5e4ebe19917300e34a9a9 SHA256 5626187706aad552d999d7943ac108a8a9e72c60d9378047d716f474151f18cc
+MD5 59d2a2e7e79a61511213c9bc45b19647 files/gawk-3.1.5-ipv6.patch 8347
+RMD160 3cd726f33cd1994feefbcb1b673e35ee4bdb5480 files/gawk-3.1.5-ipv6.patch 8347
+SHA256 5626187706aad552d999d7943ac108a8a9e72c60d9378047d716f474151f18cc files/gawk-3.1.5-ipv6.patch 8347
+AUX gawk-3.1.5-mbread.patch 1303 RMD160 1f1473749f92ea547ec4b4282f3e6a0a2e081110 SHA1 74c188297c7ff7ea36df5a9dbe79fd21ad3f95ea SHA256 1fa94758dbfbaa54df51ca9a29cffbe362644ee6a9a713fb1cccbf2e1117f288
+MD5 cbd0f631a20a4656b860a3aa189304d0 files/gawk-3.1.5-mbread.patch 1303
+RMD160 1f1473749f92ea547ec4b4282f3e6a0a2e081110 files/gawk-3.1.5-mbread.patch 1303
+SHA256 1fa94758dbfbaa54df51ca9a29cffbe362644ee6a9a713fb1cccbf2e1117f288 files/gawk-3.1.5-mbread.patch 1303
AUX gawk-3.1.5-num2str.patch 1319 RMD160 869a086ff89e25adfbf56e68de5df9d3aae7f61f SHA1 5dbe975164582ba564d235b3eeea924e86e85086 SHA256 2cadd540e4d3a5afc63fcaca3d797df18a668ff91c5a1f94fa4a2b4cb1600762
MD5 4d820de101fcc80c3041506c5635227c files/gawk-3.1.5-num2str.patch 1319
RMD160 869a086ff89e25adfbf56e68de5df9d3aae7f61f files/gawk-3.1.5-num2str.patch 1319
@@ -66,10 +78,6 @@ MD5 786426bddc259cab7e222b27d59302a4 files/gawk-3.1.5-wconcat.patch 495
RMD160 29f5eea5b300d8efc482e960b257292e5e5b19f8 files/gawk-3.1.5-wconcat.patch 495
SHA256 bc812044e12c291c0419853e3862e5dad60c17bfee8cffeb09135995b0694315 files/gawk-3.1.5-wconcat.patch 495
DIST gawk-3.1.5.tar.gz 2310919 RMD160 8d875f4ea9e9ef5c932468cf43c691f6e082b197 SHA1 6cb385b4bc33780a5a4288b787523cbd4a30a900 SHA256 463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8
-EBUILD gawk-3.1.5-r2.ebuild 3396 RMD160 d4bc99b62857cdcdc1e7d6c33d974487ad8439e9 SHA1 bb84f3ba80c302e1d2610af60bcc8e96db658716 SHA256 a9a0285a36fc244b7b7b1b7e7934494101ecb211c55c3b5a05fd063a6456103f
-MD5 a4b58132a64072ecd61b5250f38eb808 gawk-3.1.5-r2.ebuild 3396
-RMD160 d4bc99b62857cdcdc1e7d6c33d974487ad8439e9 gawk-3.1.5-r2.ebuild 3396
-SHA256 a9a0285a36fc244b7b7b1b7e7934494101ecb211c55c3b5a05fd063a6456103f gawk-3.1.5-r2.ebuild 3396
EBUILD gawk-3.1.5-r3.ebuild 3321 RMD160 ecbb7be65b892708092b48c5fd39be13a804fed8 SHA1 0b6c99639870c1b9ea2584e25e8ce8608978a333 SHA256 0d958ce3203bf9f53fc351d5e6249bfe4a5afacf2990ccd1c2ec5ac0eea89e30
MD5 bcf4ac855f3a7ad8d3b7d7c6288774e8 gawk-3.1.5-r3.ebuild 3321
RMD160 ecbb7be65b892708092b48c5fd39be13a804fed8 gawk-3.1.5-r3.ebuild 3321
@@ -78,27 +86,31 @@ EBUILD gawk-3.1.5-r4.ebuild 3604 RMD160 c811a60b5a91998f5548b08331a60a2f2fb369bc
MD5 e5ff76d6ef8d6a3bcaec3d8ba7045adb gawk-3.1.5-r4.ebuild 3604
RMD160 c811a60b5a91998f5548b08331a60a2f2fb369bc gawk-3.1.5-r4.ebuild 3604
SHA256 b2df30c7344de9c380500a6602615e65d87d70c5e8d7aeda65917797525f06e7 gawk-3.1.5-r4.ebuild 3604
-MISC ChangeLog 15429 RMD160 b5b0e1cc1bbb55084ff77ee6c1678411021eae65 SHA1 d4acb5c887ae3f7f37e63807efe8957e68b69762 SHA256 8e73c87e53a85ff808f09f2d62e132ce0f45404a95b7423083d836b6241f17dd
-MD5 bfc09964ab2f6bf4f12d11c80e6fc247 ChangeLog 15429
-RMD160 b5b0e1cc1bbb55084ff77ee6c1678411021eae65 ChangeLog 15429
-SHA256 8e73c87e53a85ff808f09f2d62e132ce0f45404a95b7423083d836b6241f17dd ChangeLog 15429
+EBUILD gawk-3.1.5-r5.ebuild 3691 RMD160 63d493088ac52a403ea7e08ce22251362f1b38e2 SHA1 30a93ecb635c6bfa79ba7058e89d2fcba30ae3ec SHA256 749a00ac789cc0d7331a5e1ef84cd82e267c9860f90c5ba8e730cce6224c3cb3
+MD5 90f5d735acd2ca0dbe5c619032701921 gawk-3.1.5-r5.ebuild 3691
+RMD160 63d493088ac52a403ea7e08ce22251362f1b38e2 gawk-3.1.5-r5.ebuild 3691
+SHA256 749a00ac789cc0d7331a5e1ef84cd82e267c9860f90c5ba8e730cce6224c3cb3 gawk-3.1.5-r5.ebuild 3691
+MISC ChangeLog 15664 RMD160 2bc3c9b2b82b0c8e424d349bff8767e683984925 SHA1 5a85c2f89411538948bb74b185c4b0436f113f70 SHA256 1e4beef2295789f58e3ff3ae325537e7a502898d3f8fc777272485852db903d5
+MD5 46048653d6fcc37f6ec284c02da73346 ChangeLog 15664
+RMD160 2bc3c9b2b82b0c8e424d349bff8767e683984925 ChangeLog 15664
+SHA256 1e4beef2295789f58e3ff3ae325537e7a502898d3f8fc777272485852db903d5 ChangeLog 15664
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 metadata.xml 164
SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 metadata.xml 164
-MD5 5717d8332bd2e98dbded1334cc76bee2 files/digest-gawk-3.1.5-r2 235
-RMD160 3d116e6731687336128135022efa9fa0e506dbad files/digest-gawk-3.1.5-r2 235
-SHA256 01e8243cf09dada7e4b9a224466042712149a3e32a8941dd0c2319064daf6e3b files/digest-gawk-3.1.5-r2 235
MD5 5717d8332bd2e98dbded1334cc76bee2 files/digest-gawk-3.1.5-r3 235
RMD160 3d116e6731687336128135022efa9fa0e506dbad files/digest-gawk-3.1.5-r3 235
SHA256 01e8243cf09dada7e4b9a224466042712149a3e32a8941dd0c2319064daf6e3b files/digest-gawk-3.1.5-r3 235
MD5 5717d8332bd2e98dbded1334cc76bee2 files/digest-gawk-3.1.5-r4 235
RMD160 3d116e6731687336128135022efa9fa0e506dbad files/digest-gawk-3.1.5-r4 235
SHA256 01e8243cf09dada7e4b9a224466042712149a3e32a8941dd0c2319064daf6e3b files/digest-gawk-3.1.5-r4 235
+MD5 5717d8332bd2e98dbded1334cc76bee2 files/digest-gawk-3.1.5-r5 235
+RMD160 3d116e6731687336128135022efa9fa0e506dbad files/digest-gawk-3.1.5-r5 235
+SHA256 01e8243cf09dada7e4b9a224466042712149a3e32a8941dd0c2319064daf6e3b files/digest-gawk-3.1.5-r5 235
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.6 (GNU/Linux)
-iD8DBQFG0FEHp/wUKkr7RBoRAkblAKCmTiLrdH0EdRGJlgQ0drsR4yuorwCg1ZBm
-3WowfGo+RD5ZusWStJH/XAE=
-=L3MH
+iD8DBQFG0FTep/wUKkr7RBoRAjAtAJ9eaf/yoWBzkwZ4S5drmbC7qFjoBgCgwIBN
+EjOAEpXdbSZmwqMfC744qvM=
+=lGpO
-----END PGP SIGNATURE-----
diff --git a/sys-apps/gawk/files/digest-gawk-3.1.5-r5 b/sys-apps/gawk/files/digest-gawk-3.1.5-r5
new file mode 100644
index 000000000000..9ac602be41d5
--- /dev/null
+++ b/sys-apps/gawk/files/digest-gawk-3.1.5-r5
@@ -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-freewstr2.patch b/sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch
new file mode 100644
index 000000000000..1ec22fb8edfc
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch
@@ -0,0 +1,257 @@
+Ripped from Fedora
+
+--- gawk-3.1.5/field.c.freewstr 2007-01-15 11:02:51.000000000 +0100
++++ gawk-3.1.5/field.c 2007-01-15 11:21:56.000000000 +0100
+@@ -155,6 +155,7 @@
+ ofs = force_string(OFS_node->var_value);
+ ofslen = ofs->stlen;
+ for (i = NF; i > 0; i--) {
++ free_wstr(fields_arr[i]);
+ tmp = fields_arr[i];
+ tmp = force_string(tmp);
+ tlen += tmp->stlen;
+@@ -922,7 +923,7 @@
+ FIELDWIDTHS[0] = 0;
+ for (i = 1; ; i++) {
+ unsigned long int tmp;
+- if (i >= fw_alloc) {
++ if (i + 1 >= fw_alloc) {
+ fw_alloc *= 2;
+ erealloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS");
+ }
+--- gawk-3.1.5/builtin.c.freewstr 2005-07-26 20:07:43.000000000 +0200
++++ gawk-3.1.5/builtin.c 2007-01-15 11:12:52.000000000 +0100
+@@ -2089,9 +2089,9 @@
+ }
+
+ free(buf);
+- if (wc_indices != NULL)
+- free(wc_indices);
+ }
++ if (wc_indices != NULL)
++ free(wc_indices);
+ } else { /* match failed */
+ rstart = 0;
+ rlength = -1;
+@@ -2462,6 +2462,8 @@
+ free(t->stptr);
+ t->stptr = buf;
+ t->stlen = textlen;
++ free_wstr(t);
++ t->flags &= ~(NUMCUR|NUMBER);
+
+ free_temp(s);
+ if (matches > 0 && lhs) {
+@@ -2471,7 +2473,6 @@
+ }
+ if (after_assign != NULL)
+ (*after_assign)();
+- t->flags &= ~(NUMCUR|NUMBER);
+ }
+ if (mb_indices != NULL)
+ free(mb_indices);
+--- gawk-3.1.5/awk.h.freewstr 2005-07-26 20:07:43.000000000 +0200
++++ gawk-3.1.5/awk.h 2007-01-15 11:02:51.000000000 +0100
+@@ -1166,6 +1166,9 @@
+ #define force_wstring(n) str2wstr(n, NULL)
+ extern const wchar_t *wstrstr P((const wchar_t *haystack, size_t hs_len, const wchar_t *needle, size_t needle_len));
+ extern const wchar_t *wcasestrstr P((const wchar_t *haystack, size_t hs_len, const wchar_t *needle, size_t needle_len));
++extern void free_wstr P((NODE *n));
++#else
++#define free_wstr(NODE) /* empty */
+ #endif
+ /* re.c */
+ extern Regexp *make_regexp P((const char *s, size_t len, int ignorecase, int dfa));
+--- gawk-3.1.5/node.c.freewstr 2007-01-15 11:02:51.000000000 +0100
++++ gawk-3.1.5/node.c 2007-01-15 11:33:44.000000000 +0100
+@@ -96,6 +96,7 @@
+ if (! do_traditional && isnondecimal(cp, TRUE)) {
+ n->numbr = nondec2awknum(cp, cpend - cp);
+ n->flags |= NUMCUR;
++ ptr = cpend;
+ goto finish;
+ }
+ }
+@@ -218,15 +219,7 @@
+ no_malloc:
+ s->stref = 1;
+ s->flags |= STRCUR;
+-#if defined MBS_SUPPORT
+- if ((s->flags & WSTRCUR) != 0) {
+- assert(s->wstptr != NULL);
+- free(s->wstptr);
+- s->wstptr = NULL;
+- s->wstlen = 0;
+- s->flags &= ~WSTRCUR;
+- }
+-#endif
++ free_wstr(s);
+ return s;
+ }
+
+@@ -289,8 +282,14 @@
+ *r = *n;
+ r->flags &= ~(PERM|TEMP|FIELD);
+ r->flags |= MALLOC;
+-#if defined MBS_SUPPORT
++#ifdef MBS_SUPPORT
++ /*
++ * DON'T call free_wstr(r) here!
++ * r->wstptr still points at n->wstptr's value, and we
++ * don't want to free it!
++ */
+ r->wstptr = NULL;
++ r->wstlen = 0;
+ #endif /* defined MBS_SUPPORT */
+ if (n->type == Node_val && (n->flags & STRCUR) != 0) {
+ r->stref = 1;
+@@ -346,11 +345,7 @@
+ r->stref = 1;
+ r->stptr = NULL;
+ r->stlen = 0;
+-#if defined MBS_SUPPORT
+- r->wstptr = NULL;
+- r->wstlen = 0;
+- r->flags &= ~WSTRCUR;
+-#endif /* MBS_SUPPORT */
++ free_wstr(r);
+ #endif /* GAWKDEBUG */
+ return r;
+ }
+@@ -365,10 +360,11 @@
+ getnode(r);
+ r->type = Node_val;
+ r->flags = (STRING|STRCUR|MALLOC);
+-#if defined MBS_SUPPORT
++#ifdef MBS_SUPPORT
+ r->wstptr = NULL;
+ r->wstlen = 0;
+-#endif
++#endif /* defined MBS_SUPPORT */
++
+ if (flags & ALREADY_MALLOCED)
+ r->stptr = s;
+ else {
+@@ -512,20 +508,13 @@
+ return;
+ }
+ free(tmp->stptr);
+-#if defined MBS_SUPPORT
+- if (tmp->wstptr != NULL) {
+- assert((tmp->flags & WSTRCUR) != 0);
+- free(tmp->wstptr);
+- }
+- tmp->flags &= ~WSTRCUR;
+- tmp->wstptr = NULL;
+- tmp->wstlen = 0;
+-#endif
++ free_wstr(tmp);
+ }
+ freenode(tmp);
+ return;
+ }
+ if ((tmp->flags & FIELD) != 0) {
++ free_wstr(tmp);
+ freenode(tmp);
+ return;
+ }
+@@ -706,12 +695,8 @@
+ return n;
+ /* otherwise
+ fall through and recompute to fill in the array */
+- }
+-
+- if (n->wstptr != NULL) {
+- free(n->wstptr);
+- n->wstptr = NULL;
+- n->wstlen = 0;
++ if (n->wstptr != NULL)
++ free_wstr(n);
+ }
+
+ /*
+@@ -752,8 +737,8 @@
+ case (size_t) -2:
+ case (size_t) -1:
+ case 0:
+- goto done;
+-
++ count = 1;
++ /* fall through */
+ default:
+ *wsp++ = wc;
+ src_count -= count;
+@@ -777,6 +762,20 @@
+ return n;
+ }
+
++/* free_wstr --- release the wide string part of a node */
++
++void
++free_wstr(NODE *n)
++{
++ if ((n->flags & WSTRCUR) != 0) {
++ assert(n->wstptr != NULL);
++ free(n->wstptr);
++ }
++ n->wstptr = NULL;
++ n->wstlen = 0;
++ n->flags &= ~WSTRCUR;
++}
++
+ #if 0
+ static void
+ dump_wstr(FILE *fp, const wchar_t *str, size_t len)
+--- gawk-3.1.5/dfa.c.freewstr 2007-01-15 11:13:19.000000000 +0100
++++ gawk-3.1.5/dfa.c 2007-01-15 11:17:44.000000000 +0100
+@@ -516,7 +516,6 @@
+
+ work_mbc->nchars = work_mbc->nranges = work_mbc->nch_classes = 0;
+ work_mbc->nequivs = work_mbc->ncoll_elems = 0;
+- work_mbc->chars = NULL;
+ work_mbc->ch_classes = NULL;
+ work_mbc->range_sts = work_mbc->range_ends = NULL;
+ work_mbc->equivs = work_mbc->coll_elems = NULL;
+@@ -1602,8 +1601,8 @@
+ d->states[i].constraint = 0;
+ d->states[i].first_end = 0;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- d->states[i].mbps.nelem = 0;
++ d->states[i].mbps.nelem = 0;
++ d->states[i].mbps.elems = NULL;
+ #endif
+ for (j = 0; j < s->nelem; ++j)
+ if (d->tokens[s->elems[j].index] < 0)
+@@ -3136,8 +3135,13 @@
+ }
+ #endif /* MBS_SUPPORT */
+
+- for (i = 0; i < d->sindex; ++i)
++ for (i = 0; i < d->sindex; ++i) {
+ free((ptr_t) d->states[i].elems.elems);
++#ifdef MBS_SUPPORT
++ if (d->states[i].mbps.nelem > 0)
++ free((ptr_t) d->states[i].mbps.elems);
++#endif /* MBS_SUPPORT */
++ }
+ free((ptr_t) d->states);
+ for (i = 0; i < d->tindex; ++i)
+ if (d->follows[i].elems)
+--- gawk-3.1.5/eval.c.freewstr 2007-01-15 11:02:51.000000000 +0100
++++ gawk-3.1.5/eval.c 2007-01-15 11:02:51.000000000 +0100
+@@ -1176,13 +1176,7 @@
+ memcpy(l->stptr + l->stlen, r->stptr, r->stlen);
+ l->stlen += r->stlen;
+ l->stptr[l->stlen] = '\0';
+-#if defined MBS_SUPPORT
+- if (r->wstptr != NULL)
+- free(r->wstptr);
+- r->wstptr = NULL;
+- r->wstlen = 0;
+- r->flags &= ~WSTRCUR;
+-#endif /* MBS_SUPPORT */
++ free_wstr(l);
+ } else {
+ char *nval;
+ size_t nlen = l->stlen + r->stlen + 2;
diff --git a/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch b/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch
new file mode 100644
index 000000000000..1bb2345618c9
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch
@@ -0,0 +1,301 @@
+Ripped from Fedora
+
+diff -bru gawk-3.1.5.orig/io.c gawk-3.1.5/io.c
+--- gawk-3.1.5.orig/io.c 2006-07-07 16:13:08.000000000 +0200
++++ gawk-3.1.5/io.c 2006-07-10 13:18:13.000000000 +0200
+@@ -71,7 +71,6 @@
+ extern int MRL;
+
+ #ifdef HAVE_SOCKETS
+-enum inet_prot { INET_NONE, INET_TCP, INET_UDP, INET_RAW };
+
+ #ifndef SHUT_RD
+ #define SHUT_RD 0
+@@ -1133,24 +1132,60 @@
+ /* socketopen --- open a socket and set it into connected state */
+
+ static int
+-socketopen(enum inet_prot type, int localport, int remoteport, const char *remotehostname)
++socketopen(int type, const char *localpname, const char *remotepname,
++ const char *remotehostname)
+ {
+- struct hostent *hp = gethostbyname(remotehostname);
+- struct sockaddr_in local_addr, remote_addr;
++ struct addrinfo *lres, *lres0;
++ struct addrinfo lhints;
++ struct addrinfo *rres, *rres0;
++ struct addrinfo rhints;
++
++ int lerror;
++ int rerror;
++
+ int socket_fd;
+ int any_remote_host = strcmp(remotehostname, "0");
+
++ memset (&lhints, '\0', sizeof (lhints));
++ lhints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
++ lhints.ai_socktype = type;
++
++ lerror = getaddrinfo (NULL, localpname, &lhints, &lres);
++ if (lerror) {
++ if (strcmp(localpname, "0"))
++ fatal(_("local port invalid in `/inet'"));
++ lres0 = NULL;
++ lres = &lhints;
++ } else
++ lres0 = lres;
++
++ while (lres) {
++ memset (&rhints, '\0', sizeof (rhints));
++ rhints.ai_flags = lhints.ai_flags;
++ rhints.ai_socktype = lhints.ai_socktype;
++ rhints.ai_family = lhints.ai_family;
++ rhints.ai_protocol = lhints.ai_protocol;
++
++ rerror = getaddrinfo (remotehostname, remotepname, &rhints, &rres);
++ if (rerror) {
++ if (lres0)
++ freeaddrinfo(lres0);
++ fatal(_("remote host and port information invalid"));
++ }
++ rres0 = rres;
+ socket_fd = INVALID_HANDLE;
+- switch (type) {
+- case INET_TCP:
+- if (localport != 0 || remoteport != 0) {
++ while (rres) {
++ socket_fd = socket (rres->ai_family,
++ rres->ai_socktype, rres->ai_protocol);
++ if (socket_fd < 0 || socket_fd == INVALID_HANDLE)
++ goto nextrres;
++
++ if (type == SOCK_STREAM) {
+ int on = 1;
+ #ifdef SO_LINGER
+ struct linger linger;
+-
+ memset(& linger, '\0', sizeof(linger));
+ #endif
+- socket_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR,
+ (char *) & on, sizeof(on));
+ #ifdef SO_LINGER
+@@ -1160,57 +1195,27 @@
+ (char *) & linger, sizeof(linger));
+ #endif
+ }
+- break;
+- case INET_UDP:
+- if (localport != 0 || remoteport != 0)
+- socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+- break;
+- case INET_RAW:
+-#ifdef SOCK_RAW
+- if (localport == 0 && remoteport == 0)
+- socket_fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
+-#endif
+- break;
+- case INET_NONE:
+- /* fall through */
+- default:
+- cant_happen();
+- break;
+- }
++ if (bind(socket_fd, lres->ai_addr, lres->ai_addrlen) != 0)
++ goto nextrres;
+
+- if (socket_fd < 0 || socket_fd == INVALID_HANDLE
+- || (hp == NULL && any_remote_host != 0))
+- return INVALID_HANDLE;
+-
+- local_addr.sin_family = remote_addr.sin_family = AF_INET;
+- local_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+- remote_addr.sin_addr.s_addr = htonl(INADDR_ANY);
+- local_addr.sin_port = htons(localport);
+- remote_addr.sin_port = htons(remoteport);
+- if (bind(socket_fd, (struct sockaddr *) &local_addr, sizeof(local_addr)) == 0) {
+ if (any_remote_host != 0) { /* not ANY => create a client */
+- if (type == INET_TCP || type == INET_UDP) {
+- memcpy(&remote_addr.sin_addr, hp->h_addr,
+- sizeof(remote_addr.sin_addr));
+- if (connect(socket_fd,
+- (struct sockaddr *) &remote_addr,
+- sizeof(remote_addr)) != 0) {
+- close(socket_fd);
+- if (localport == 0)
+- socket_fd = INVALID_HANDLE;
+- else
+- socket_fd = socketopen(type, localport, 0, "0");
+- }
++ if (type != SOCK_RAW) {
++ if (connect(socket_fd, rres->ai_addr,
++ rres->ai_addrlen) == 0)
++ break;
+ } else {
+ /* /inet/raw client not ready yet */
+ fatal(_("/inet/raw client not ready yet, sorry"));
+ if (geteuid() != 0)
++ /* FIXME: is this second fatal ever reached? */
+ fatal(_("only root may use `/inet/raw'."));
+ }
+ } else { /* remote host is ANY => create a server */
+- if (type == INET_TCP) {
++ if (type == SOCK_STREAM) {
+ int clientsocket_fd = INVALID_HANDLE;
+- socklen_t namelen = sizeof(remote_addr);
++
++ struct sockaddr_storage remote_addr;
++ socklen_t namelen = sizeof (remote_addr);
+
+ if (listen(socket_fd, 1) >= 0
+ && (clientsocket_fd = accept(socket_fd,
+@@ -1218,25 +1223,22 @@
+ &namelen)) >= 0) {
+ close(socket_fd);
+ socket_fd = clientsocket_fd;
+- } else {
+- close(socket_fd);
+- socket_fd = INVALID_HANDLE;
++ break;
+ }
+- } else if (type == INET_UDP) {
++ } else if (type == SOCK_DGRAM) {
+ #ifdef MSG_PEEK
+ char buf[10];
++ struct sockaddr_storage remote_addr;
+ socklen_t readle;
+
+ if (recvfrom(socket_fd, buf, 1, MSG_PEEK,
+ (struct sockaddr *) & remote_addr,
+- & readle) < 1
+- || readle != sizeof(remote_addr)
+- || connect(socket_fd,
++ & readle) >= 0
++ && readle
++ && connect(socket_fd,
+ (struct sockaddr *)& remote_addr,
+- readle) != 0) {
+- close(socket_fd);
+- socket_fd = INVALID_HANDLE;
+- }
++ readle) == 0)
++ break;
+ #endif
+ } else {
+ /* /inet/raw server not ready yet */
+@@ -1245,10 +1247,20 @@
+ fatal(_("only root may use `/inet/raw'."));
+ }
+ }
+- } else {
++
++nextrres:
++ if (socket_fd != INVALID_HANDLE)
+ close(socket_fd);
+ socket_fd = INVALID_HANDLE;
++ rres = rres->ai_next;
++ }
++ freeaddrinfo(rres0);
++ if (socket_fd != INVALID_HANDLE)
++ break;
++ lres = lres->ai_next;
+ }
++ if (lres0)
++ freeaddrinfo(lres0);
+
+ return socket_fd;
+ }
+@@ -1313,30 +1325,24 @@
+ } else if (STREQN(name, "/inet/", 6)) {
+ #ifdef HAVE_SOCKETS
+ /* /inet/protocol/localport/hostname/remoteport */
+- enum inet_prot protocol = INET_NONE;
+- int localport, remoteport;
++ int protocol;
+ char *hostname;
+ char *hostnameslastcharp;
+ char *localpname;
+- char proto[4];
+- struct servent *service;
++ char *localpnamelastcharp;
+
+ cp = (char *) name + 6;
+ /* which protocol? */
+ if (STREQN(cp, "tcp/", 4))
+- protocol = INET_TCP;
++ protocol = SOCK_STREAM;
+ else if (STREQN(cp, "udp/", 4))
+- protocol = INET_UDP;
++ protocol = SOCK_DGRAM;
+ else if (STREQN(cp, "raw/", 4))
+- protocol = INET_RAW;
++ protocol = SOCK_RAW;
+ else
+ fatal(_("no (known) protocol supplied in special filename `%s'"),
+ name);
+
+- proto[0] = cp[0];
+- proto[1] = cp[1];
+- proto[2] = cp[2];
+- proto[3] = '\0';
+ cp += 4;
+
+ /* which localport? */
+@@ -1354,25 +1360,17 @@
+ * By using atoi() the use of decimal numbers is enforced.
+ */
+ *cp = '\0';
+-
+- localport = atoi(localpname);
+- if (strcmp(localpname, "0") != 0
+- && (localport <= 0 || localport > 65535)) {
+- service = getservbyname(localpname, proto);
+- if (service == NULL)
+- fatal(_("local port invalid in `%s'"), name);
+- else
+- localport = ntohs(service->s_port);
+- }
+- *cp = '/';
++ localpnamelastcharp = cp;
+
+ /* which hostname? */
+ cp++;
+ hostname = cp;
+ while (*cp != '/' && *cp != '\0')
+ cp++;
+- if (*cp != '/' || cp == hostname)
++ if (*cp != '/' || cp == hostname) {
++ *localpnamelastcharp = '/';
+ fatal(_("must supply a remote hostname to `/inet'"));
++ }
+ *cp = '\0';
+ hostnameslastcharp = cp;
+
+@@ -1386,22 +1384,15 @@
+ * Here too, require a port, let them explicitly put 0 if
+ * they don't care.
+ */
+- if (*cp == '\0')
++ if (*cp == '\0') {
++ *localpnamelastcharp = '/';
++ *hostnameslastcharp = '/';
+ fatal(_("must supply a remote port to `/inet'"));
+- remoteport = atoi(cp);
+- if (strcmp(cp, "0") != 0
+- && (remoteport <= 0 || remoteport > 65535)) {
+- service = getservbyname(cp, proto);
+- if (service == NULL)
+- fatal(_("remote port invalid in `%s'"), name);
+- else
+- remoteport = ntohs(service->s_port);
+ }
+
+- /* Open Sesame! */
+- openfd = socketopen(protocol, localport, remoteport, hostname);
++ openfd = socketopen(protocol, localpname, cp, hostname);
++ *localpnamelastcharp = '/';
+ *hostnameslastcharp = '/';
+-
+ #else /* ! HAVE_SOCKETS */
+ fatal(_("TCP/IP communications are not supported"));
+ #endif /* HAVE_SOCKETS */
diff --git a/sys-apps/gawk/files/gawk-3.1.5-mbread.patch b/sys-apps/gawk/files/gawk-3.1.5-mbread.patch
new file mode 100644
index 000000000000..078c97d1b6f1
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-3.1.5-mbread.patch
@@ -0,0 +1,41 @@
+Ripped from Fedora
+
+ Date: Mon, 18 Dec 2006 18:38:13 +0300
+ From: "Dmitry V. Levin" <ldv@altlinux.org>
+ Subject: gawk: do_match() invalid read
+ To: bug-gawk@gnu.org
+
+ Due to missing mounds check, do_match() may do invalid read in multibyte
+ locales:
+
+ $ printf '\n\n' |env -i gawk '{print match(""," *")}'
+ 1
+ 1
+ $ printf '\n\n' |env -i LC_ALL=3Dru_RU.UTF-8 gawk '{print match(""," *")}'
+ -1208299079
+ 134843273
+
+ As you see, match() output in multibyte locale is wrong; valgrind reports
+ about "Invalid read of size 4".
+
+
+--- gawk-3.1.5/builtin.c.mbread 2007-01-12 13:23:55.000000000 +0100
++++ gawk-3.1.5/builtin.c 2007-01-12 13:24:41.000000000 +0100
+@@ -2020,7 +2020,7 @@
+
+ rlength = REEND(rp, t1->stptr) - RESTART(rp, t1->stptr); /* byte length */
+ #ifdef MBS_SUPPORT
+- if (gawk_mb_cur_max > 1) {
++ if (rlength > 0 && gawk_mb_cur_max > 1) {
+ t1 = str2wstr(t1, & wc_indices);
+ rlength = wc_indices[rstart + rlength - 1] - wc_indices[rstart] + 1;
+ rstart = wc_indices[rstart];
+@@ -2046,7 +2046,7 @@
+ subpat_start = s;
+ subpat_len = len = SUBPATEND(rp, t1->stptr, ii) - s;
+ #ifdef MBS_SUPPORT
+- if (gawk_mb_cur_max > 1) {
++ if (len > 0 && gawk_mb_cur_max > 1) {
+ subpat_start = wc_indices[s];
+ subpat_len = wc_indices[s + len - 1] - subpat_start + 1;
+ }
diff --git a/sys-apps/gawk/gawk-3.1.5-r5.ebuild b/sys-apps/gawk/gawk-3.1.5-r5.ebuild
new file mode 100644
index 000000000000..3fe36420de63
--- /dev/null
+++ b/sys-apps/gawk/gawk-3.1.5-r5.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2007 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-r5.ebuild,v 1.1 2007/08/25 16:10:52 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 ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+SFFS=${WORKDIR}/filefuncs
+
+src_unpack() {
+ unpack ${P}.tar.gz
+
+ # Copy filefuncs module's source over ...
+ cp -r "${FILESDIR}"/filefuncs "${SFFS}" || die "cp failed"
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-core.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch
+ epatch "${FILESDIR}"/${P}-autotools-crap.patch #139397
+ # 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
+ epatch "${FILESDIR}"/${P}-internal.patch
+ epatch "${FILESDIR}"/${P}-numflags.patch
+ epatch "${FILESDIR}"/${P}-syntaxerror.patch
+ epatch "${FILESDIR}"/${P}-wconcat.patch
+ epatch "${FILESDIR}"/${P}-ipv6.patch
+ epatch "${FILESDIR}"/${P}-mbread.patch
+ epatch "${FILESDIR}"/${P}-freewstr2.patch #135931 #188740
+}
+
+src_compile() {
+ local bindir=/usr/bin
+ use userland_GNU && bindir=/bin
+ econf \
+ --bindir=${bindir} \
+ --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() {
+ emake install DESTDIR="${D}" || die "install failed"
+ cd "${SFFS}"
+ emake 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 bindir=/usr/bin binpath= x=
+ use userland_GNU && bindir=/bin
+ for x in gawk pgawk igawk ; do
+ [[ ${x} == "gawk" ]] \
+ && binpath=${bindir} \
+ || binpath=/usr/bin
+
+ if [[ -f ${D}/${bindir}/${x} && ! -f ${D}/${bindir}/${x}-${PV} ]] ; then
+ mv -f "${D}"/${bindir}/${x} "${D}"/${binpath}/${x}-${PV}
+ elif [[ -f ${D}/${bindir}/${x}- && ! -f ${D}/${bindir}/${x}-${PV} ]] ; then
+ mv -f "${D}"/${bindir}/${x}- "${D}"/${binpath}/${x}-${PV}
+ elif [[ ${binpath} == "/usr/bin" && -f ${D}/${bindir}/${x}-${PV} ]] ; then
+ mv -f "${D}"/${bindir}/${x}-${PV} "${D}"/${binpath}/${x}-${PV}
+ fi
+
+ rm -f "${D}"/${bindir}/${x}
+ [[ -x "${D}"/${binpath}/${x}-${PV} ]] && dosym ${x}-${PV} ${binpath}/${x}
+ if use userland_GNU ; then
+ [[ ${binpath} == "/usr/bin" ]] && dosym /usr/bin/${x}-${PV} /bin/${x}
+ fi
+ done
+
+ rm -f "${D}"/bin/awk
+ dodir /usr/bin
+ # Compat symlinks
+ dosym gawk-${PV} ${bindir}/awk
+ dosym ${bindir}/gawk-${PV} /usr/bin/awk
+ if use userland_GNU ; then
+ dosym /bin/gawk-${PV} /usr/bin/gawk
+ else
+ rm -f "${D}"/{,usr/}bin/awk{,-${PV}}
+ fi
+
+ # 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
+
+ cd "${S}"
+ rm -f "${D}"/usr/share/man/man1/pgawk.1
+ dosym gawk.1 /usr/share/man/man1/pgawk.1
+ if use userland_GNU ; then
+ dosym gawk.1 /usr/share/man/man1/awk.1
+ fi
+ 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
+}