1.1 --- a/openpkg/bash.patch Tue Jul 31 12:12:54 2012 +0200 1.2 +++ b/openpkg/bash.patch Tue Jul 31 12:23:42 2012 +0200 1.3 @@ -2,9 +2,9 @@ 1.4 line options "-v" and "-x". It is derived from Debian GNU/Linux. 1.5 1.6 Index: doc/bash.1 1.7 ---- doc/bash.1.orig 2004-07-12 17:27:08 +0200 1.8 -+++ doc/bash.1 2004-07-27 19:47:10 +0200 1.9 -@@ -116,6 +116,12 @@ 1.10 +--- doc/bash.1.orig 2011-01-16 21:31:39.000000000 +0100 1.11 ++++ doc/bash.1 2011-02-21 18:56:01.000000000 +0100 1.12 +@@ -117,6 +117,12 @@ 1.13 This option allows the positional parameters to be set 1.14 when invoking an interactive shell. 1.15 .TP 1.16 @@ -23,9 +23,9 @@ 1.17 Port to HP-UX 11i and similar less smart platforms. 1.18 1.19 Index: configure 1.20 ---- configure.orig 2004-07-21 22:18:56 +0200 1.21 -+++ configure 2004-07-27 19:47:10 +0200 1.22 -@@ -1517,6 +1517,7 @@ 1.23 +--- configure.orig 2011-02-07 23:03:22.000000000 +0100 1.24 ++++ configure 2011-02-21 18:56:01.000000000 +0100 1.25 +@@ -2202,6 +2202,7 @@ 1.26 *-beos*) opt_bash_malloc=no ;; # they say it's suitable 1.27 *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment 1.28 *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft 1.29 @@ -33,7 +33,7 @@ 1.30 esac 1.31 1.32 # memory scrambling on free() 1.33 -@@ -1662,7 +1663,7 @@ 1.34 +@@ -2270,7 +2271,7 @@ 1.35 1.36 else 1.37 MALLOC_LIB= 1.38 @@ -43,8 +43,8 @@ 1.39 MALLOC_DEP= 1.40 fi 1.41 Index: syntax.h 1.42 ---- syntax.h.orig 2004-04-15 05:19:36 +0200 1.43 -+++ syntax.h 2004-07-27 19:47:10 +0200 1.44 +--- syntax.h.orig 2009-01-04 20:32:42.000000000 +0100 1.45 ++++ syntax.h 2011-02-21 18:56:01.000000000 +0100 1.46 @@ -21,6 +21,8 @@ 1.47 #ifndef _SYNTAX_H_ 1.48 #define _SYNTAX_H_ 1.49 @@ -60,303 +60,70 @@ 1.50 This adds the OpenPKG packaging brand. 1.51 1.52 Index: version.c 1.53 ---- version.c.orig 2003-12-19 22:34:02 +0100 1.54 -+++ version.c 2004-07-27 19:47:10 +0200 1.55 -@@ -77,7 +77,7 @@ 1.56 +--- version.c.orig 2011-01-28 17:32:36.000000000 +0100 1.57 ++++ version.c 2011-02-21 18:56:01.000000000 +0100 1.58 +@@ -83,7 +83,7 @@ 1.59 show_shell_version (extended) 1.60 int extended; 1.61 { 1.62 -- printf ("GNU bash, version %s (%s)\n", shell_version_string (), MACHTYPE); 1.63 -+ printf ("GNU bash, version %s (%s) [@l_openpkg_release@]\n", shell_version_string (), MACHTYPE); 1.64 +- printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE); 1.65 ++ printf (_("GNU bash, version %s (%s) [@l_openpkg_release@]\n"), shell_version_string (), MACHTYPE); 1.66 if (extended) 1.67 - printf (_("Copyright (C) 2005 Free Software Foundation, Inc.\n")); 1.68 - } 1.69 + { 1.70 + printf ("%s\n", _(bash_copyright)); 1.71 1.72 ----------------------------------------------------------------------------- 1.73 1.74 -Accumulated vendor patches Bash 3.2 001-005 1.75 +Ensure that Autoconf and friends are not run. 1.76 1.77 -Generated via: 1.78 - 1.79 -$ gunzip <bash-3.2.tar.gz | tar xf - 1.80 -$ pushd bash-3.2 1.81 -$ cat bash32-[0-9]* | patch -p0 -Vt -b 1.82 -$ shtool move -e '*.~1~' '%1.orig' 1.83 -$ pushd /tmp 1.84 -$ curl -O ftp://ftp.gnu.org/gnu/bison/bison-1.28.tar.gz 1.85 -$ cd bison-1.28 1.86 -$ ./configure --prefix=/tmp/bison 1.87 -$ make 1.88 -$ make install 1.89 -$ popd 1.90 -$ mv y.tab.c y.tab.c.orig 1.91 -$ mv y.tab.h y.tab.h.orig 1.92 -$ /tmp/bison/bin/bison -y -d parse.y 1.93 -$ rm -rf /tmp/bison /tmp/bison-1.28 /tmp/bison-1.28.tar.gz 1.94 -$ shtool subst -b.dummy \ 1.95 - -e 's;parse\.y;/Users/chet/src/bash/src/parse.y;g' \ 1.96 - -e 's;/tmp/bison/share/bison\.simple;/usr/share/bison.simple;g' y.tab.c 1.97 -$ svs diff >/tmp/bash.patch 1.98 -$ popd 1.99 -$ rm -rf bash-3.2 1.100 - 1.101 -Index: parse.y 1.102 ---- parse.y.orig 2006-09-19 22:37:21 +0200 1.103 -+++ parse.y 2006-12-06 13:32:45 +0100 1.104 -@@ -1029,6 +1029,7 @@ 1.105 - #define PST_CMDTOKEN 0x1000 /* command token OK - unused */ 1.106 - #define PST_COMPASSIGN 0x2000 /* parsing x=(...) compound assignment */ 1.107 - #define PST_ASSIGNOK 0x4000 /* assignment statement ok in this context */ 1.108 -+#define PST_REGEXP 0x8000 /* parsing an ERE/BRE as a single word */ 1.109 +Index: Makefile.in 1.110 +--- Makefile.in.orig 2010-12-01 01:22:42.000000000 +0100 1.111 ++++ Makefile.in 2011-02-21 18:56:01.000000000 +0100 1.112 +@@ -711,7 +711,6 @@ 1.113 1.114 - /* Initial size to allocate for tokens, and the 1.115 - amount to grow them by. */ 1.116 -@@ -2591,6 +2592,9 @@ 1.117 - return (character); 1.118 - } 1.119 + # comment out for distribution 1.120 + $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in 1.121 +- cd $(srcdir) && autoconf 1.122 1.123 -+ if (parser_state & PST_REGEXP) 1.124 -+ goto tokword; 1.125 -+ 1.126 - /* Shell meta-characters. */ 1.127 - if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) 1.128 - { 1.129 -@@ -2698,6 +2702,7 @@ 1.130 - if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) 1.131 - return (character); 1.132 - 1.133 -+tokword: 1.134 - /* Okay, if we got this far, we have to read a word. Read one, 1.135 - and then check it against the known ones. */ 1.136 - result = read_token_word (character); 1.137 -@@ -2735,7 +2740,7 @@ 1.138 - /* itrace("parse_matched_pair: open = %c close = %c", open, close); */ 1.139 - count = 1; 1.140 - pass_next_character = backq_backslash = was_dollar = in_comment = 0; 1.141 -- check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; 1.142 -+ check_comment = (flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; 1.143 - 1.144 - /* RFLAGS is the set of flags we want to pass to recursive calls. */ 1.145 - rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); 1.146 -@@ -3202,8 +3207,11 @@ 1.147 - if (tok == WORD && test_binop (yylval.word->word)) 1.148 - op = yylval.word; 1.149 - #if defined (COND_REGEXP) 1.150 -- else if (tok == WORD && STREQ (yylval.word->word,"=~")) 1.151 -- op = yylval.word; 1.152 -+ else if (tok == WORD && STREQ (yylval.word->word, "=~")) 1.153 -+ { 1.154 -+ op = yylval.word; 1.155 -+ parser_state |= PST_REGEXP; 1.156 -+ } 1.157 - #endif 1.158 - else if (tok == '<' || tok == '>') 1.159 - op = make_word_from_token (tok); /* ( */ 1.160 -@@ -3234,6 +3242,7 @@ 1.161 - 1.162 - /* rhs */ 1.163 - tok = read_token (READ); 1.164 -+ parser_state &= ~PST_REGEXP; 1.165 - if (tok == WORD) 1.166 - { 1.167 - tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); 1.168 -@@ -3419,9 +3428,34 @@ 1.169 - goto next_character; 1.170 - } 1.171 - 1.172 -+#ifdef COND_REGEXP 1.173 -+ /* When parsing a regexp as a single word inside a conditional command, 1.174 -+ we need to special-case characters special to both the shell and 1.175 -+ regular expressions. Right now, that is only '(' and '|'. */ /*)*/ 1.176 -+ if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ 1.177 -+ { 1.178 -+ if (character == '|') 1.179 -+ goto got_character; 1.180 -+ 1.181 -+ push_delimiter (dstack, character); 1.182 -+ ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); 1.183 -+ pop_delimiter (dstack); 1.184 -+ if (ttok == &matched_pair_error) 1.185 -+ return -1; /* Bail immediately. */ 1.186 -+ RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, 1.187 -+ token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); 1.188 -+ token[token_index++] = character; 1.189 -+ strcpy (token + token_index, ttok); 1.190 -+ token_index += ttoklen; 1.191 -+ FREE (ttok); 1.192 -+ dollar_present = all_digit_token = 0; 1.193 -+ goto next_character; 1.194 -+ } 1.195 -+#endif /* COND_REGEXP */ 1.196 -+ 1.197 - #ifdef EXTENDED_GLOB 1.198 - /* Parse a ksh-style extended pattern matching specification. */ 1.199 -- if (extended_glob && PATTERN_CHAR (character)) 1.200 -+ if MBTEST(extended_glob && PATTERN_CHAR (character)) 1.201 - { 1.202 - peek_char = shell_getc (1); 1.203 - if MBTEST(peek_char == '(') /* ) */ 1.204 -Index: patchlevel.h 1.205 ---- patchlevel.h.orig 2006-04-13 14:31:04 +0200 1.206 -+++ patchlevel.h 2006-12-06 13:32:45 +0100 1.207 -@@ -25,6 +25,6 @@ 1.208 - regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 1.209 - looks for to find the patch level (for the sccs version string). */ 1.210 - 1.211 --#define PATCHLEVEL 0 1.212 -+#define PATCHLEVEL 5 1.213 - 1.214 - #endif /* _PATCHLEVEL_H_ */ 1.215 -Index: subst.c 1.216 ---- subst.c.orig 2006-09-19 14:35:09 +0200 1.217 -+++ subst.c 2006-12-06 13:32:45 +0100 1.218 -@@ -5707,6 +5707,11 @@ 1.219 - vtype &= ~VT_STARSUB; 1.220 - 1.221 - mflags = 0; 1.222 -+ if (patsub && *patsub == '/') 1.223 -+ { 1.224 -+ mflags |= MATCH_GLOBREP; 1.225 -+ patsub++; 1.226 -+ } 1.227 - 1.228 - /* Malloc this because expand_string_if_necessary or one of the expansion 1.229 - functions in its call chain may free it on a substitution error. */ 1.230 -@@ -5741,13 +5746,12 @@ 1.231 - } 1.232 - 1.233 - /* ksh93 doesn't allow the match specifier to be a part of the expanded 1.234 -- pattern. This is an extension. */ 1.235 -+ pattern. This is an extension. Make sure we don't anchor the pattern 1.236 -+ at the beginning or end of the string if we're doing global replacement, 1.237 -+ though. */ 1.238 - p = pat; 1.239 -- if (pat && pat[0] == '/') 1.240 -- { 1.241 -- mflags |= MATCH_GLOBREP|MATCH_ANY; 1.242 -- p++; 1.243 -- } 1.244 -+ if (mflags & MATCH_GLOBREP) 1.245 -+ mflags |= MATCH_ANY; 1.246 - else if (pat && pat[0] == '#') 1.247 - { 1.248 - mflags |= MATCH_BEG; 1.249 -Index: y.tab.c 1.250 ---- y.tab.c.orig 2006-09-25 14:15:16 +0200 1.251 -+++ y.tab.c 2006-12-06 13:39:36 +0100 1.252 -@@ -2359,6 +2359,7 @@ 1.253 - #define PST_CMDTOKEN 0x1000 /* command token OK - unused */ 1.254 - #define PST_COMPASSIGN 0x2000 /* parsing x=(...) compound assignment */ 1.255 - #define PST_ASSIGNOK 0x4000 /* assignment statement ok in this context */ 1.256 -+#define PST_REGEXP 0x8000 /* parsing an ERE/BRE as a single word */ 1.257 - 1.258 - /* Initial size to allocate for tokens, and the 1.259 - amount to grow them by. */ 1.260 -@@ -3921,6 +3922,9 @@ 1.261 - return (character); 1.262 - } 1.263 - 1.264 -+ if (parser_state & PST_REGEXP) 1.265 -+ goto tokword; 1.266 -+ 1.267 - /* Shell meta-characters. */ 1.268 - if MBTEST(shellmeta (character) && ((parser_state & PST_DBLPAREN) == 0)) 1.269 - { 1.270 -@@ -4028,6 +4032,7 @@ 1.271 - if MBTEST(character == '-' && (last_read_token == LESS_AND || last_read_token == GREATER_AND)) 1.272 - return (character); 1.273 - 1.274 -+tokword: 1.275 - /* Okay, if we got this far, we have to read a word. Read one, 1.276 - and then check it against the known ones. */ 1.277 - result = read_token_word (character); 1.278 -@@ -4065,7 +4070,7 @@ 1.279 - /* itrace("parse_matched_pair: open = %c close = %c", open, close); */ 1.280 - count = 1; 1.281 - pass_next_character = backq_backslash = was_dollar = in_comment = 0; 1.282 -- check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; 1.283 -+ check_comment = (flags & P_COMMAND) && qc != '`' && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0; 1.284 - 1.285 - /* RFLAGS is the set of flags we want to pass to recursive calls. */ 1.286 - rflags = (qc == '"') ? P_DQUOTE : (flags & P_DQUOTE); 1.287 -@@ -4532,8 +4537,11 @@ 1.288 - if (tok == WORD && test_binop (yylval.word->word)) 1.289 - op = yylval.word; 1.290 - #if defined (COND_REGEXP) 1.291 -- else if (tok == WORD && STREQ (yylval.word->word,"=~")) 1.292 -- op = yylval.word; 1.293 -+ else if (tok == WORD && STREQ (yylval.word->word, "=~")) 1.294 -+ { 1.295 -+ op = yylval.word; 1.296 -+ parser_state |= PST_REGEXP; 1.297 -+ } 1.298 - #endif 1.299 - else if (tok == '<' || tok == '>') 1.300 - op = make_word_from_token (tok); /* ( */ 1.301 -@@ -4564,6 +4572,7 @@ 1.302 - 1.303 - /* rhs */ 1.304 - tok = read_token (READ); 1.305 -+ parser_state &= ~PST_REGEXP; 1.306 - if (tok == WORD) 1.307 - { 1.308 - tright = make_cond_node (COND_TERM, yylval.word, (COND_COM *)NULL, (COND_COM *)NULL); 1.309 -@@ -4749,9 +4758,34 @@ 1.310 - goto next_character; 1.311 - } 1.312 - 1.313 -+#ifdef COND_REGEXP 1.314 -+ /* When parsing a regexp as a single word inside a conditional command, 1.315 -+ we need to special-case characters special to both the shell and 1.316 -+ regular expressions. Right now, that is only '(' and '|'. */ /*)*/ 1.317 -+ if MBTEST((parser_state & PST_REGEXP) && (character == '(' || character == '|')) /*)*/ 1.318 -+ { 1.319 -+ if (character == '|') 1.320 -+ goto got_character; 1.321 -+ 1.322 -+ push_delimiter (dstack, character); 1.323 -+ ttok = parse_matched_pair (cd, '(', ')', &ttoklen, 0); 1.324 -+ pop_delimiter (dstack); 1.325 -+ if (ttok == &matched_pair_error) 1.326 -+ return -1; /* Bail immediately. */ 1.327 -+ RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 2, 1.328 -+ token_buffer_size, TOKEN_DEFAULT_GROW_SIZE); 1.329 -+ token[token_index++] = character; 1.330 -+ strcpy (token + token_index, ttok); 1.331 -+ token_index += ttoklen; 1.332 -+ FREE (ttok); 1.333 -+ dollar_present = all_digit_token = 0; 1.334 -+ goto next_character; 1.335 -+ } 1.336 -+#endif /* COND_REGEXP */ 1.337 -+ 1.338 - #ifdef EXTENDED_GLOB 1.339 - /* Parse a ksh-style extended pattern matching specification. */ 1.340 -- if (extended_glob && PATTERN_CHAR (character)) 1.341 -+ if MBTEST(extended_glob && PATTERN_CHAR (character)) 1.342 - { 1.343 - peek_char = shell_getc (1); 1.344 - if MBTEST(peek_char == '(') /* ) */ 1.345 + # for chet 1.346 + reconfig: force 1.347 1.348 ----------------------------------------------------------------------------- 1.349 1.350 -Do not require autoconf. Fixes build on Solaris 10 8/07 u4 on sparc64 1.351 +Fix Bash getcwd(3) run-time issue seen on Solaris where size argument 1.352 +of 0 does not malloc buffer as expected by Bash code. 1.353 1.354 -Index: Makefile.in 1.355 ---- Makefile.in.orig 2006-08-17 20:03:35 +0200 1.356 -+++ Makefile.in 2007-10-15 13:00:34 +0200 1.357 -@@ -682,13 +682,9 @@ 1.358 - stamp-h: config.status $(srcdir)/config.h.in $(srcdir)/config-top.h $(srcdir)/config-bot.h 1.359 - CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) ./config.status 1.360 +Index: builtins/common.c 1.361 +--- builtins/common.c.orig 2011-01-05 23:51:26.000000000 +0100 1.362 ++++ builtins/common.c 2011-02-21 18:56:01.000000000 +0100 1.363 +@@ -553,10 +553,11 @@ 1.364 1.365 --config.status: $(srcdir)/configure 1.366 -+config.status: 1.367 - $(SHELL) ./config.status --recheck 1.368 + if (the_current_working_directory == 0) 1.369 + { 1.370 ++ char *t = xmalloc(PATH_MAX); 1.371 + #if defined (GETCWD_BROKEN) 1.372 +- the_current_working_directory = getcwd (0, PATH_MAX); 1.373 ++ the_current_working_directory = getcwd (t, PATH_MAX); 1.374 + #else 1.375 +- the_current_working_directory = getcwd (0, 0); 1.376 ++ the_current_working_directory = getcwd (t, PATH_MAX); 1.377 + #endif 1.378 + if (the_current_working_directory == 0) 1.379 + { 1.380 + 1.381 +----------------------------------------------------------------------------- 1.382 + 1.383 +Fix building under Linux. 1.384 + 1.385 +Index: externs.h 1.386 +--- externs.h.orig 2010-11-30 02:59:20.000000000 +0100 1.387 ++++ externs.h 2011-02-21 18:56:01.000000000 +0100 1.388 +@@ -25,6 +25,7 @@ 1.389 + # define _EXTERNS_H_ 1.390 1.391 --# comment out for distribution 1.392 --$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in 1.393 -- cd $(srcdir) && autoconf 1.394 -- 1.395 - # for chet 1.396 - reconfig: force 1.397 - sh $(srcdir)/configure -C 1.398 + #include "stdc.h" 1.399 ++#include <stdio.h> 1.400 + 1.401 + /* Functions from expr.c. */ 1.402 + extern intmax_t evalexp __P((char *, int *)); 1.403 +