Commit d4f0350c authored by Mike Frysinger's avatar Mike Frysinger
Browse files

update to bash-3.1

parent 229a26a7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
# bash
#
#############################################################
BASH_VER:=3.0
BASH_VER:=3.1
BASH_SOURCE:=bash-$(BASH_VER).tar.gz
BASH_SITE:=ftp://ftp.gnu.org/gnu/bash
BASH_CAT:=zcat
@@ -25,11 +25,11 @@ $(BASH_DIR)/.unpacked: $(DL_DIR)/$(BASH_SOURCE)
	touch $(BASH_DIR)/.unpacked

$(BASH_DIR)/.configured: $(BASH_DIR)/.unpacked
	#		ac_cv_func_setvbuf_reversed=no
	#		bash_cv_have_mbstate_t=yes
	(cd $(BASH_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD="$(HOSTCC)" \
		CFLAGS="$(TARGET_CFLAGS)" \
		ac_cv_func_setvbuf_reversed=no \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \

package/bash/bash30-001

deleted100644 → 0
+0 −139
Original line number Diff line number Diff line
*** bash-3.0/arrayfunc.c	Fri Dec 19 00:03:09 2003
--- bash/arrayfunc.c	Sun Aug  1 20:43:00 2004
***************
*** 612,616 ****
  
    free (t);
!   return var;
  }
  
--- 612,616 ----
  
    free (t);
!   return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
  }
  

*** bash-3.0/subst.c	Sun Jul  4 13:56:13 2004
--- bash/subst.c	Thu Aug 12 13:36:17 2004
***************
*** 4983,4987 ****
  	return -1;
      }
!   else if ((v = find_variable (varname)) && array_p (v))
      {
        vtype = VT_ARRAYMEMBER;
--- 5003,5007 ----
  	return -1;
      }
!   else if ((v = find_variable (varname)) && (invisible_p (v) == 0) && array_p (v))
      {
        vtype = VT_ARRAYMEMBER;

*** bash-3.0/variables.c	Sun Jul  4 13:57:26 2004
--- bash/variables.c	Wed Aug  4 15:28:04 2004
***************
*** 1420,1428 ****
  
  #  if defined (DEBUGGER)
!   v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, (att_invisible|att_noassign));
!   v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, (att_invisible|att_noassign));
  #  endif /* DEBUGGER */
!   v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, (att_invisible|att_noassign));
!   v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, (att_invisible|att_noassign));
  #endif
  
--- 1420,1428 ----
  
  #  if defined (DEBUGGER)
!   v = init_dynamic_array_var ("BASH_ARGC", get_self, null_array_assign, att_noassign);
!   v = init_dynamic_array_var ("BASH_ARGV", get_self, null_array_assign, att_noassign);
  #  endif /* DEBUGGER */
!   v = init_dynamic_array_var ("BASH_SOURCE", get_self, null_array_assign, att_noassign);
!   v = init_dynamic_array_var ("BASH_LINENO", get_self, null_array_assign, att_noassign);
  #endif
  
***************
*** 1600,1604 ****
    old_var = find_variable (name);
    if (old_var && local_p (old_var) && old_var->context == variable_context)
!     return (old_var);
  
    was_tmpvar = old_var && tempvar_p (old_var);
--- 1600,1607 ----
    old_var = find_variable (name);
    if (old_var && local_p (old_var) && old_var->context == variable_context)
!     {
!       VUNSETATTR (old_var, att_invisible);
!       return (old_var);
!     }
  
    was_tmpvar = old_var && tempvar_p (old_var);
*** bash-3.0/pcomplete.c	Thu Jan  8 10:36:17 2004
--- bash/pcomplete.c	Tue Aug  3 23:15:41 2004
***************
*** 864,867 ****
--- 864,869 ----
      v = convert_var_to_array (v);
    v = assign_array_var_from_word_list (v, lwords);
+ 
+   VUNSETATTR (v, att_invisible);
    return v;
  }
***************
*** 1022,1025 ****
--- 1024,1029 ----
    if (array_p (v) == 0)
      v = convert_var_to_array (v);
+ 
+   VUNSETATTR (v, att_invisible);
  
    a = array_cell (v);
*** bash-3.0/array.c	Thu May  6 08:24:13 2004
--- bash/array.c	Wed Aug 25 15:50:42 2004
***************
*** 452,456 ****
  			array_dispose_element(new);
  			free(element_value(ae));
! 			ae->value = savestring(v);
  			return(0);
  		} else if (element_index(ae) > i) {
--- 454,458 ----
  			array_dispose_element(new);
  			free(element_value(ae));
! 			ae->value = v ? savestring(v) : (char *)NULL;
  			return(0);
  		} else if (element_index(ae) > i) {

*** bash-3.0/patchlevel.h	Wed Aug 22 08:05:39 2001
--- bash/patchlevel.h	Thu Sep  2 15:04:32 2004
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 0
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 1
  
  #endif /* _PATCHLEVEL_H_ */
*** bash-3.0/tests/dbg-support.tests	Tue Mar 25 15:33:03 2003
--- bash/tests/dbg-support.tests	Tue Aug  3 23:09:29 2004
***************
*** 63,68 ****
  trap 'print_return_trap $LINENO' RETURN
  
! # Funcname is now an array. Vanilla Bash 2.05 doesn't have FUNCNAME array.
! echo "FUNCNAME" ${FUNCNAME[0]}
  
  # We should trace into the below. 
--- 63,68 ----
  trap 'print_return_trap $LINENO' RETURN
  
! # Funcname is now an array, but you still can't see it outside a function
! echo "FUNCNAME" ${FUNCNAME[0]:-main}
  
  # We should trace into the below. 

package/bash/bash30-002

deleted100644 → 0
+0 −44
Original line number Diff line number Diff line
*** bash-3.0/lib/readline/display.c	Thu May 27 22:57:51 2004
--- bash/lib/readline/display.c	Wed Jul 28 13:48:04 2004
***************
*** 352,356 ****
  				       &prompt_last_invisible,
  				       (int *)NULL,
! 				       (int *)NULL);
        c = *t; *t = '\0';
        /* The portion of the prompt string up to and including the
--- 352,356 ----
  				       &prompt_last_invisible,
  				       (int *)NULL,
! 				       &prompt_physical_chars);
        c = *t; *t = '\0';
        /* The portion of the prompt string up to and including the
***************
*** 359,363 ****
  						   (int *)NULL,
  						   &prompt_invis_chars_first_line,
! 						   &prompt_physical_chars);
        *t = c;
        return (prompt_prefix_length);
--- 359,363 ----
  						   (int *)NULL,
  						   &prompt_invis_chars_first_line,
! 						   (int *)NULL);
        *t = c;
        return (prompt_prefix_length);

*** bash-3.0/patchlevel.h	Wed Aug 22 08:05:39 2001
--- bash/patchlevel.h	Thu Sep  2 15:04:32 2004
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 1
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 2
  
  #endif /* _PATCHLEVEL_H_ */

package/bash/bash30-003

deleted100644 → 0
+0 −107
Original line number Diff line number Diff line
*** bash-3.0/builtins/trap.def	Thu May 27 22:26:19 2004
--- bash/builtins/trap.def	Thu Aug  5 08:55:43 2004
***************
*** 24,28 ****
  $BUILTIN trap
  $FUNCTION trap_builtin
! $SHORT_DOC trap [-lp] [[arg] signal_spec ...]
  The command ARG is to be read and executed when the shell receives
  signal(s) SIGNAL_SPEC.  If ARG is absent (and a single SIGNAL_SPEC
--- 24,28 ----
  $BUILTIN trap
  $FUNCTION trap_builtin
! $SHORT_DOC trap [-lp] [arg signal_spec ...]
  The command ARG is to be read and executed when the shell receives
  signal(s) SIGNAL_SPEC.  If ARG is absent (and a single SIGNAL_SPEC
***************
*** 88,92 ****
       WORD_LIST *list;
  {
!   int list_signal_names, display, result, opt;
  
    list_signal_names = display = 0;
--- 88,92 ----
       WORD_LIST *list;
  {
!   int list_signal_names, display, result, opt, first_signal;
  
    list_signal_names = display = 0;
***************
*** 119,130 ****
      {
        char *first_arg;
!       int operation, sig;
  
        operation = SET;
        first_arg = list->word->word;
        /* When in posix mode, the historical behavior of looking for a
  	 missing first argument is disabled.  To revert to the original
  	 signal handling disposition, use `-' as the first argument. */
!       if (posixly_correct == 0 && first_arg && *first_arg &&
  		(*first_arg != '-' || first_arg[1]) &&
  		signal_object_p (first_arg, opt) && list->next == 0)
--- 119,135 ----
      {
        char *first_arg;
!       int operation, sig, first_signal;
  
        operation = SET;
        first_arg = list->word->word;
+       first_signal = first_arg && *first_arg && all_digits (first_arg) && signal_object_p (first_arg, opt);
+ 
+       /* Backwards compatibility */
+       if (first_signal)
+ 	operation = REVERT;
        /* When in posix mode, the historical behavior of looking for a
  	 missing first argument is disabled.  To revert to the original
  	 signal handling disposition, use `-' as the first argument. */
!       else if (posixly_correct == 0 && first_arg && *first_arg &&
  		(*first_arg != '-' || first_arg[1]) &&
  		signal_object_p (first_arg, opt) && list->next == 0)
*** bash-3.0/doc/bashref.texi	Sat Jun 26 14:26:07 2004
--- bash/doc/bashref.texi	Fri Aug 27 12:33:46 2004
***************
*** 5954,5958 ****
  The @code{trap} builtin doesn't check the first argument for a possible
  signal specification and revert the signal handling to the original
! disposition if it is.  If users want to reset the handler for a given
  signal to the original disposition, they should use @samp{-} as the
  first argument.
--- 5967,5972 ----
  The @code{trap} builtin doesn't check the first argument for a possible
  signal specification and revert the signal handling to the original
! disposition if it is, unless that argument consists solely of digits and
! is a valid signal number.  If users want to reset the handler for a given
  signal to the original disposition, they should use @samp{-} as the
  first argument.

*** bash-3.0/patchlevel.h	Wed Aug 22 08:05:39 2001
--- bash/patchlevel.h	Thu Sep  2 15:04:32 2004
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 2
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 3
  
  #endif /* _PATCHLEVEL_H_ */
*** bash-3.0/tests/errors.right	Thu May 27 22:26:03 2004
--- bash/tests/errors.right	Sat Aug  7 22:35:10 2004
***************
*** 86,90 ****
  ./errors.tests: line 216: trap: NOSIG: invalid signal specification
  ./errors.tests: line 219: trap: -s: invalid option
! trap: usage: trap [-lp] [[arg] signal_spec ...]
  ./errors.tests: line 225: return: can only `return' from a function or sourced script
  ./errors.tests: line 229: break: 0: loop count out of range
--- 86,90 ----
  ./errors.tests: line 216: trap: NOSIG: invalid signal specification
  ./errors.tests: line 219: trap: -s: invalid option
! trap: usage: trap [-lp] [arg signal_spec ...]
  ./errors.tests: line 225: return: can only `return' from a function or sourced script
  ./errors.tests: line 229: break: 0: loop count out of range

package/bash/bash30-004

deleted100644 → 0
+0 −128
Original line number Diff line number Diff line
*** bash-3.0/subst.c	Sun Jul  4 13:56:13 2004
--- bash/subst.c	Thu Aug 12 13:36:17 2004
***************
*** 4692,4695 ****
--- 4692,4715 ----
  }
  
+ #if defined (HANDLE_MULTIBYTE)
+ size_t
+ mbstrlen (s)
+      const char *s;
+ {
+   size_t clen, nc;
+   mbstate_t mbs;
+ 
+   nc = 0;
+   memset (&mbs, 0, sizeof (mbs));
+   while ((clen = mbrlen(s, MB_CUR_MAX, &mbs)) != 0 && (MB_INVALIDCH(clen) == 0))
+     {
+       s += clen;
+       nc++;
+     }
+   return nc;
+ }
+ #endif
+       
+ 
  /* Handle the parameter brace expansion that requires us to return the
     length of a parameter. */
***************
*** 4747,4758 ****
  	{
  	  t = get_dollar_var_value (arg_index);
! 	  number = STRLEN (t);
  	  FREE (t);
  	}
  #if defined (ARRAY_VARS)
!       else if ((var = find_variable (name + 1)) && array_p (var))
  	{
  	  t = array_reference (array_cell (var), 0);
! 	  number = STRLEN (t);
  	}
  #endif
--- 4767,4778 ----
  	{
  	  t = get_dollar_var_value (arg_index);
! 	  number = MB_STRLEN (t);
  	  FREE (t);
  	}
  #if defined (ARRAY_VARS)
!       else if ((var = find_variable (name + 1)) && (invisible_p (var) == 0) && array_p (var))
  	{
  	  t = array_reference (array_cell (var), 0);
! 	  number = MB_STRLEN (t);
  	}
  #endif
***************
*** 4767,4771 ****
  	    dispose_words (list);
  
! 	  number = STRLEN (t);
  	  FREE (t);
  	}
--- 4787,4791 ----
  	    dispose_words (list);
  
! 	  number = MB_STRLEN (t);
  	  FREE (t);
  	}
***************
*** 4872,4876 ****
      case VT_VARIABLE:
      case VT_ARRAYMEMBER:
!       len = strlen (value);
        break;
      case VT_POSPARMS:
--- 4892,4896 ----
      case VT_VARIABLE:
      case VT_ARRAYMEMBER:
!       len = MB_STRLEN (value);
        break;
      case VT_POSPARMS:
*** bash-3.0/include/shmbutil.h	Mon Apr 19 09:59:42 2004
--- bash/include/shmbutil.h	Thu Sep  2 15:20:47 2004
***************
*** 32,35 ****
--- 32,37 ----
  extern size_t xdupmbstowcs __P((wchar_t **, char ***, const char *));
  
+ extern size_t mbstrlen __P((const char *));
+ 
  extern char *xstrchr __P((const char *, int));
  
***************
*** 39,42 ****
--- 41,47 ----
  #endif
  
+ #define MBSLEN(s)	(((s) && (s)[0]) ? ((s)[1] ? mbstrlen (s) : 1) : 0)
+ #define MB_STRLEN(s)	((MB_CUR_MAX > 1) ? MBSLEN (s) : STRLEN (s))
+ 
  #else /* !HANDLE_MULTIBYTE */
  
***************
*** 54,57 ****
--- 59,64 ----
  #define MB_NULLWCH(x)		(0)
  #endif
+ 
+ #define MB_STRLEN(s)		(STRLEN(s))
  
  #endif /* !HANDLE_MULTIBYTE */

*** bash-3.0/patchlevel.h	Wed Aug 22 08:05:39 2001
--- bash/patchlevel.h	Thu Sep  2 15:04:32 2004
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 3
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 4
  
  #endif /* _PATCHLEVEL_H_ */
Loading