]> git.pld-linux.org Git - packages/bash.git/commitdiff
- merged rawhide patches.
authorkloczek <kloczek@pld-linux.org>
Mon, 12 Jun 2000 17:50:15 +0000 (17:50 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bash-compat.patch -> 1.1
    bash-requires.patch -> 1.4
    bash-shellfunc.patch -> 1.1

bash-compat.patch [new file with mode: 0644]
bash-requires.patch [new file with mode: 0644]
bash-shellfunc.patch [new file with mode: 0644]

diff --git a/bash-compat.patch b/bash-compat.patch
new file mode 100644 (file)
index 0000000..46215d5
--- /dev/null
@@ -0,0 +1,13 @@
+--- bash-2.04/parse.y.compat   Wed Mar 29 23:31:47 2000
++++ bash-2.04/parse.y  Wed Mar 29 23:33:11 2000
+@@ -275,7 +275,9 @@
+                       }
+       ;
+-word_list:    WORD
++word_list:
++                      { $$ = (WORD_LIST *)NULL; }
++      |       WORD
+                       { $$ = make_word_list ($1, (WORD_LIST *)NULL); }
+       |       word_list WORD
+                       { $$ = make_word_list ($2, $1); }
diff --git a/bash-requires.patch b/bash-requires.patch
new file mode 100644 (file)
index 0000000..2b5baa2
--- /dev/null
@@ -0,0 +1,240 @@
+--- bash-2.04-beta5/builtins/mkbuiltins.c.requires     Thu Aug  5 12:42:54 1999
++++ bash-2.04-beta5/builtins/mkbuiltins.c      Sun Mar 19 14:14:17 2000
+@@ -51,8 +51,13 @@
+ #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
+ /* Flag values that builtins can have. */
++/*  These flags are for the C code generator, 
++    the C which is produced (./builtin.c)
++    includes the flags definitions found 
++    in ../builtins.h */
+ #define BUILTIN_FLAG_SPECIAL  0x01
+ #define BUILTIN_FLAG_ASSIGNMENT 0x02
++#define BUILTIN_FLAG_REQUIRES 0x04
+ /* If this stream descriptor is non-zero, then write
+    texinfo documentation to it. */
+@@ -126,9 +131,17 @@
+   (char *)NULL
+ };
++/* The builtin commands that cause requirements on other files. */
++char *requires_builtins[] =
++{
++  ".", "command", "exec", "source", "inlib",
++  (char *)NULL
++};
++
+ /* Forward declarations. */
+ static int is_special_builtin ();
+ static int is_assignment_builtin ();
++static int is_requires_builtin ();
+ #if !defined (HAVE_RENAME)
+ static int rename ();
+@@ -759,6 +772,8 @@
+     new->flags |= BUILTIN_FLAG_SPECIAL;
+   if (is_assignment_builtin (name))
+     new->flags |= BUILTIN_FLAG_ASSIGNMENT;
++  if (is_requires_builtin (name))
++    new->flags |= BUILTIN_FLAG_REQUIRES;
+   array_add ((char *)new, defs->builtins);
+   building_builtin = 1;
+@@ -1164,10 +1179,11 @@
+                 else
+                   fprintf (structfile, "(Function *)0x0, ");
+-                fprintf (structfile, "%s%s%s, %s_doc,\n",
++                fprintf (structfile, "%s%s%s%s, %s_doc,\n",
+                   "BUILTIN_ENABLED | STATIC_BUILTIN",
+                   (builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "",
+                   (builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "",
++                  (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "",
+                   builtin->docname ? builtin->docname : builtin->name);
+                 fprintf
+@@ -1401,6 +1417,13 @@
+      char *name;
+ {
+   return (_find_in_table (name, assignment_builtins));
++}
++
++static int
++is_requires_builtin (name)
++     char *name;
++{
++  return (_find_in_table (name, requires_builtins));
+ }
+ #if !defined (HAVE_RENAME)
+--- bash-2.04-beta5/doc/bash.1.requires        Tue Jan 11 19:36:49 2000
++++ bash-2.04-beta5/doc/bash.1 Sun Mar 19 14:14:17 2000
+@@ -196,6 +196,12 @@
+ .B "RESTRICTED SHELL"
+ below).
+ .TP
++.B \-\-rpm-requires
++Produce the list of files that are required for the 
++shell script to run.  This implies '-n' and is subject
++to the same limitations as compile time error checking checking;
++Backticks, [] tests,  and evals are not parsed so some 
++dependencies may be missed.
+ .B \-\-verbose
+ Equivalent to  \fB\-v\fP.
+ .TP
+--- bash-2.04-beta5/doc/bashref.texi.requires  Wed Jan 12 16:18:50 2000
++++ bash-2.04-beta5/doc/bashref.texi   Sun Mar 19 14:14:17 2000
+@@ -4333,6 +4333,13 @@
+ @item --restricted
+ Make the shell a restricted shell (@pxref{The Restricted Shell}).
++@item --rpm-requires
++Produce the list of files that are required for the 
++shell script to run.  This implies '-n' and is subject
++to the same limitations as compile time error checking checking;
++Backticks, [] tests,  and evals are not parsed so some 
++dependencies may be missed.
++
+ @item --verbose
+ Equivalent to @samp{-v}.  Print shell input lines as they're read.
+--- bash-2.04-beta5/builtins.h.requires        Thu Aug  5 11:18:12 1999
++++ bash-2.04-beta5/builtins.h Sun Mar 19 14:14:17 2000
+@@ -40,6 +40,7 @@
+ #define STATIC_BUILTIN  0x4   /* This builtin is not dynamically loaded. */
+ #define SPECIAL_BUILTIN 0x8   /* This is a Posix `special' builtin. */
+ #define ASSIGNMENT_BUILTIN 0x10       /* This builtin takes assignment statements. */
++#define REQUIRES_BUILTIN 0x20 /* This builtin requires other files. */
+ /* The thing that we build the array of builtins out of. */
+ struct builtin {
+--- bash-2.04-beta5/make_cmd.c.requires        Thu Aug  5 11:21:23 1999
++++ bash-2.04-beta5/make_cmd.c Sun Mar 19 14:17:34 2000
+@@ -41,6 +41,9 @@
+ #include "subst.h"
+ #include "input.h"
+ #include "externs.h"
++#include "builtins.h"
++
++#include "builtins/common.h"
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
+@@ -49,7 +52,10 @@
+ extern int line_number, current_command_line_count;
+ extern int disallow_filename_globbing;
+ extern int last_command_exit_value;
++extern int rpm_requires;
++char *alphabet_set = "abcdefghijklmnopqrstuvwxyz"
++                   "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ WORD_DESC *
+ make_bare_word (string)
+@@ -696,6 +702,36 @@
+   return (make_command (cm_subshell, (SIMPLE_COM *)temp));
+ }
++void
++output_requirement (file)
++char *file;
++{
++  if ( (file[0] != '/') || strchr(file, '$')) {
++    /* if we are not given a full path name we require the basename
++       otherwise we require the full path.  This does not work in the
++       Win/Dos world but I don't know what to do there.*/
++    char *basename;
++    basename = strrchr(file, '/');
++    if (basename) {    
++      basename++;
++      file=basename;
++    }
++  }  
++
++    /* 
++       if the executable is called via variable substitution we can
++       not dermine what it is at compile time.  
++
++       if the executable consists only of characters not in the
++       alphabet we do not consider it a dependency just an artifact of
++       shell parsing (ex "exec < ${infile}").
++    */
++
++  if ( !strchr(file, '$') && strpbrk(file, alphabet_set) ) {
++    printf ("executable(%s)\n", file);
++  }
++}
++
+ /* Reverse the word list and redirection list in the simple command
+    has just been parsed.  It seems simpler to do this here the one
+    time then by any other method that I can think of. */
+@@ -712,6 +748,35 @@
+       command->value.Simple->redirects =
+       REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
+     }
++
++  if (rpm_requires && command->value.Simple->words)
++    {
++      char *cmd0;
++      char *cmd1;
++      struct builtin *b;
++
++      cmd0 = command->value.Simple->words->word->word;
++      b = builtin_address_internal (cmd0, 0);
++      cmd1 = 0;
++      if (command->value.Simple->words->next) {
++      cmd1 = command->value.Simple->words->next->word->word;
++      }
++      if (b) {
++      if ( (b->flags & REQUIRES_BUILTIN) && cmd1){
++        output_requirement(cmd1);
++      }
++      } else {
++      if (!assignment(cmd0)) {
++        output_requirement(cmd0);
++      } else {
++
++        /* This will not work, the subshell that this runs in does
++             not get the "requires" commandline argument. */
++
++        execute_command(command);
++      }
++      }
++    } /*rpm_requires*/
+   return (command);
+ }
+--- bash-2.04-beta5/shell.c.requires   Fri Nov 19 19:58:15 1999
++++ bash-2.04-beta5/shell.c    Sun Mar 19 14:14:17 2000
+@@ -163,6 +163,9 @@
+ /* The name of the .(shell)rc file. */
+ static char *bashrc_file = "~/.bashrc";
++/* Non-zero if we are finding the scripts requirements. */
++int rpm_requires;
++
+ /* Non-zero means to act more like the Bourne shell on startup. */
+ static int act_like_sh;
+@@ -208,6 +211,7 @@
+   { "norc", Int, &no_rc, (char **)0x0 },
+   { "posix", Int, &posixly_correct, (char **)0x0 },
+   { "rcfile", Charp, (int *)0x0, &bashrc_file },
++  { "rpm-requires", Int, &rpm_requires, (char **)0x0 },
+ #if defined (RESTRICTED_SHELL)
+   { "restricted", Int, &restricted, (char **)0x0 },
+ #endif
+@@ -393,6 +397,12 @@
+   if (dump_translatable_strings)
+     read_but_dont_execute = 1;
++
++  if (rpm_requires)
++    {
++      read_but_dont_execute = 1;
++      initialize_shell_builtins ();
++    }
+   if (running_setuid && privileged_mode == 0)
+     disable_priv_mode ();
diff --git a/bash-shellfunc.patch b/bash-shellfunc.patch
new file mode 100644 (file)
index 0000000..137bf9c
--- /dev/null
@@ -0,0 +1,20 @@
+--- bash-2.04/execute_cmd.c.shellfunc  Tue Jan 25 11:29:11 2000
++++ bash-2.04/execute_cmd.c    Tue May  2 21:26:24 2000
+@@ -2762,6 +2762,8 @@
+   if (tc && (flags & CMD_IGNORE_RETURN))
+     tc->flags |= CMD_IGNORE_RETURN;
++  old_shell_function = this_shell_function;
++
+   if (subshell == 0)
+     {
+       begin_unwind_frame ("function_calling");
+@@ -2843,6 +2845,8 @@
+   if (variable_context == 0 || this_shell_function == 0)
+     make_funcname_visible (0);
++
++  this_shell_function = old_shell_function;
+   return (result);
+ }
This page took 0.067577 seconds and 4 git commands to generate.