rpms/bash/F-12 bash-requires.patch,1.4,1.5 bash.spec,1.192,1.193
Roman Rakus
rrakus at fedoraproject.org
Tue Mar 30 13:55:01 UTC 2010
Author: rrakus
Update of /cvs/pkgs/rpms/bash/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv11943
Modified Files:
bash-requires.patch bash.spec
Log Message:
Corrected requires patch (#563301)
bash-requires.patch:
builtins.h | 2 ++
builtins/mkbuiltins.c | 27 ++++++++++++++++++++++++++-
doc/bash.1 | 7 +++++++
doc/bashref.texi | 7 +++++++
eval.c | 3 ++-
execute_cmd.c | 13 +++++++++++--
execute_cmd.h | 2 ++
make_cmd.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
shell.c | 10 ++++++++++
9 files changed, 117 insertions(+), 4 deletions(-)
Index: bash-requires.patch
===================================================================
RCS file: /cvs/pkgs/rpms/bash/F-12/bash-requires.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- bash-requires.patch 26 Jan 2009 11:50:44 -0000 1.4
+++ bash-requires.patch 30 Mar 2010 13:55:00 -0000 1.5
@@ -1,57 +1,94 @@
-diff -up bash-4.0/shell.c.requires bash-4.0/shell.c
---- bash-4.0/shell.c.requires 2009-01-21 15:28:16.000000000 +0100
-+++ bash-4.0/shell.c 2009-01-21 15:28:16.000000000 +0100
-@@ -193,6 +193,9 @@ int have_devfd = 0;
- /* The name of the .(shell)rc file. */
- static char *bashrc_file = "~/.bashrc";
-
-+/* Non-zero if we are finding the scripts requirements. */
-+int rpm_requires;
+diff -up bash-4.0/builtins.h.requires bash-4.0/builtins.h
+--- bash-4.0/builtins.h.requires 2009-01-04 20:32:23.000000000 +0100
++++ bash-4.0/builtins.h 2010-03-30 14:47:10.000000000 +0200
+@@ -41,6 +41,8 @@
+ #define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */
+ #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */
+ #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */
++#define REQUIRES_BUILTIN 0x40 /* This builtin requires other files. */
+
- /* Non-zero means to act more like the Bourne shell on startup. */
- static int act_like_sh;
-@@ -251,6 +254,7 @@ static const struct {
- { "posix", Int, &posixly_correct, (char **)0x0 },
- { "protected", Int, &protected_mode, (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
-@@ -479,6 +483,12 @@ main (argc, argv, env)
- if (dump_translatable_strings)
- read_but_dont_execute = 1;
+ #define BASE_INDENT 4
-+ if (rpm_requires)
-+ {
-+ read_but_dont_execute = 1;
-+ initialize_shell_builtins ();
-+ }
+diff -up bash-4.0/builtins/mkbuiltins.c.requires bash-4.0/builtins/mkbuiltins.c
+--- bash-4.0/builtins/mkbuiltins.c.requires 2009-01-04 20:32:23.000000000 +0100
++++ bash-4.0/builtins/mkbuiltins.c 2010-03-30 14:47:10.000000000 +0200
+@@ -69,9 +69,15 @@ extern char *strcpy ();
+ #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_POSIX_BUILTIN 0x04
++#define BUILTIN_FLAG_REQUIRES 0x08
+
- if (running_setuid && privileged_mode == 0)
- disable_priv_mode ();
-diff -up bash-4.0/doc/bashref.texi.requires bash-4.0/doc/bashref.texi
---- bash-4.0/doc/bashref.texi.requires 2009-01-21 15:28:16.000000000 +0100
-+++ bash-4.0/doc/bashref.texi 2009-01-21 15:28:16.000000000 +0100
-@@ -5253,6 +5253,13 @@ standard. @xref{Bash POSIX Mode}, for a
- @item --restricted
- Make the shell a restricted shell (@pxref{The Restricted Shell}).
+ #define BASE_INDENT 4
-+ at 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.
+@@ -163,10 +169,18 @@ char *posix_builtins[] =
+ (char *)NULL
+ };
+
++/* The builtin commands that cause requirements on other files. */
++static char *requires_builtins[] =
++{
++ ".", "command", "exec", "source", "inlib",
++ (char *)NULL
++};
++
+ /* Forward declarations. */
+ static int is_special_builtin ();
+ static int is_assignment_builtin ();
+ static int is_posix_builtin ();
++static int is_requires_builtin ();
+
+ #if !defined (HAVE_RENAME)
+ static int rename ();
+@@ -812,6 +826,9 @@ builtin_handler (self, defs, arg)
+ new->flags |= BUILTIN_FLAG_ASSIGNMENT;
+ if (is_posix_builtin (name))
+ new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
++ if (is_requires_builtin (name))
++ new->flags |= BUILTIN_FLAG_REQUIRES;
+
- @item --verbose
- Equivalent to @option{-v}. Print shell input lines as they're read.
+ array_add ((char *)new, defs->builtins);
+ building_builtin = 1;
+@@ -1229,11 +1246,12 @@ write_builtins (defs, structfile, extern
+ else
+ fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
+
+- fprintf (structfile, "%s%s%s%s, %s_doc,\n",
++ fprintf (structfile, "%s%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_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "",
++ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "",
+ document_name (builtin));
+
+ fprintf
+@@ -1581,6 +1599,13 @@ is_posix_builtin (name)
+ return (_find_in_table (name, posix_builtins));
+ }
+
++static int
++is_requires_builtin (name)
++ char *name;
++{
++ return (_find_in_table (name, requires_builtins));
++}
++
+ #if !defined (HAVE_RENAME)
+ static int
+ rename (from, to)
diff -up bash-4.0/doc/bash.1.requires bash-4.0/doc/bash.1
---- bash-4.0/doc/bash.1.requires 2009-01-21 15:28:16.000000000 +0100
-+++ bash-4.0/doc/bash.1 2009-01-21 15:28:16.000000000 +0100
+--- bash-4.0/doc/bash.1.requires 2010-03-30 14:47:10.000000000 +0200
++++ bash-4.0/doc/bash.1 2010-03-30 14:47:10.000000000 +0200
@@ -231,6 +231,13 @@ The shell becomes restricted (see
.B "RESTRICTED SHELL"
below).
@@ -66,9 +103,96 @@ diff -up bash-4.0/doc/bash.1.requires ba
.B \-\-verbose
Equivalent to \fB\-v\fP.
.TP
+diff -up bash-4.0/doc/bashref.texi.requires bash-4.0/doc/bashref.texi
+--- bash-4.0/doc/bashref.texi.requires 2010-03-30 14:47:10.000000000 +0200
++++ bash-4.0/doc/bashref.texi 2010-03-30 14:47:10.000000000 +0200
+@@ -5282,6 +5282,13 @@ standard. @xref{Bash POSIX Mode}, for a
+ @item --restricted
+ Make the shell a restricted shell (@pxref{The Restricted Shell}).
+
++ at 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 @option{-v}. Print shell input lines as they're read.
+
+diff -up bash-4.0/eval.c.requires bash-4.0/eval.c
+--- bash-4.0/eval.c.requires 2009-01-04 20:32:26.000000000 +0100
++++ bash-4.0/eval.c 2010-03-30 14:47:10.000000000 +0200
+@@ -53,6 +53,7 @@ extern int last_command_exit_value, stdi
+ extern int need_here_doc;
+ extern int current_command_number, current_command_line_count, line_number;
+ extern int expand_aliases;
++extern int rpm_requires;
+
+ static void send_pwd_to_eterm __P((void));
+ static sighandler alrm_catcher __P((int));
+@@ -136,7 +137,7 @@ reader_loop ()
+
+ if (read_command () == 0)
+ {
+- if (interactive_shell == 0 && read_but_dont_execute)
++ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires))
+ {
+ last_command_exit_value = EXECUTION_SUCCESS;
+ dispose_command (global_command);
+diff -up bash-4.0/execute_cmd.c.requires bash-4.0/execute_cmd.c
+--- bash-4.0/execute_cmd.c.requires 2010-03-30 14:47:10.000000000 +0200
++++ bash-4.0/execute_cmd.c 2010-03-30 14:47:43.000000000 +0200
+@@ -497,6 +497,8 @@ async_redirect_stdin ()
+
+ #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
+
++extern int rpm_requires;
++
+ /* Execute the command passed in COMMAND, perhaps doing it asynchrounously.
+ COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
+ ASYNCHROUNOUS, if non-zero, says to do this command in the background.
+@@ -528,8 +530,15 @@ execute_command_internal (command, async
+ #else
+ if (breaking || continuing)
+ return (last_command_exit_value);
+- if (command == 0 || read_but_dont_execute)
++ if (command == 0 || (read_but_dont_execute && !rpm_requires))
++ return (EXECUTION_SUCCESS);
++ if (rpm_requires && command->type == cm_function_def)
++ return last_command_exit_value =
++ execute_intern_function (command->value.Function_def->name,
++ command->value.Function_def->command);
++ if (read_but_dont_execute)
+ return (EXECUTION_SUCCESS);
++
+ #endif
+
+ QUIT;
+@@ -4957,7 +4966,7 @@ execute_intern_function (name, function)
+
+ if (check_identifier (name, posixly_correct) == 0)
+ {
+- if (posixly_correct && interactive_shell == 0)
++ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0)
+ {
+ last_command_exit_value = EX_BADUSAGE;
+ jump_to_top_level (ERREXIT);
+diff -up bash-4.0/execute_cmd.h.requires bash-4.0/execute_cmd.h
+--- bash-4.0/execute_cmd.h.requires 2009-01-16 22:20:15.000000000 +0100
++++ bash-4.0/execute_cmd.h 2010-03-30 14:47:10.000000000 +0200
+@@ -22,6 +22,8 @@
+ #define _EXECUTE_CMD_H_
+
+ #include "stdc.h"
++#include "variables.h"
++#include "command.h"
+
+ extern struct fd_bitmap *new_fd_bitmap __P((int));
+ extern void dispose_fd_bitmap __P((struct fd_bitmap *));
diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c
--- bash-4.0/make_cmd.c.requires 2009-01-04 20:32:38.000000000 +0100
-+++ bash-4.0/make_cmd.c 2009-01-21 15:28:16.000000000 +0100
++++ bash-4.0/make_cmd.c 2010-03-30 14:47:10.000000000 +0200
@@ -41,11 +41,15 @@
#include "flags.h"
#include "make_cmd.h"
@@ -152,159 +276,37 @@ diff -up bash-4.0/make_cmd.c.requires ba
return (command);
}
-diff -up bash-4.0/execute_cmd.c.requires bash-4.0/execute_cmd.c
---- bash-4.0/execute_cmd.c.requires 2009-01-21 15:28:16.000000000 +0100
-+++ bash-4.0/execute_cmd.c 2009-01-21 15:28:16.000000000 +0100
-@@ -497,6 +497,8 @@ async_redirect_stdin ()
-
- #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
-
-+extern int rpm_requires;
-+
- /* Execute the command passed in COMMAND, perhaps doing it asynchrounously.
- COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
- ASYNCHROUNOUS, if non-zero, says to do this command in the background.
-@@ -528,8 +530,13 @@ execute_command_internal (command, async
- #else
- if (breaking || continuing)
- return (last_command_exit_value);
-- if (command == 0 || read_but_dont_execute)
-+ if (command == 0 || (read_but_dont_execute && !rpm_requires))
- return (EXECUTION_SUCCESS);
-+ if (rpm_requires && command->type == cm_function_def)
-+ return last_command_exit_value =
-+ execute_intern_function (command->value.Function_def->name,
-+ command->value.Function_def->command);
-+
- #endif
-
- QUIT;
-@@ -4859,7 +4866,7 @@ execute_intern_function (name, function)
-
- if (check_identifier (name, posixly_correct) == 0)
- {
-- if (posixly_correct && interactive_shell == 0)
-+ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0)
- {
- last_command_exit_value = EX_BADUSAGE;
- jump_to_top_level (ERREXIT);
-diff -up bash-4.0/execute_cmd.h.requires bash-4.0/execute_cmd.h
---- bash-4.0/execute_cmd.h.requires 2009-01-04 20:32:29.000000000 +0100
-+++ bash-4.0/execute_cmd.h 2009-01-21 15:28:16.000000000 +0100
-@@ -22,6 +22,8 @@
- #define _EXECUTE_CMD_H_
-
- #include "stdc.h"
-+#include "variables.h"
-+#include "command.h"
-
- extern struct fd_bitmap *new_fd_bitmap __P((int));
- extern void dispose_fd_bitmap __P((struct fd_bitmap *));
-diff -up bash-4.0/builtins.h.requires bash-4.0/builtins.h
---- bash-4.0/builtins.h.requires 2009-01-04 20:32:23.000000000 +0100
-+++ bash-4.0/builtins.h 2009-01-21 16:10:39.000000000 +0100
-@@ -41,6 +41,8 @@
- #define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */
- #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */
- #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */
-+#define REQUIRES_BUILTIN 0x40 /* This builtin requires other files. */
-+
-
- #define BASE_INDENT 4
-
-diff -up bash-4.0/eval.c.requires bash-4.0/eval.c
---- bash-4.0/eval.c.requires 2009-01-04 20:32:26.000000000 +0100
-+++ bash-4.0/eval.c 2009-01-21 15:28:16.000000000 +0100
-@@ -53,6 +53,7 @@ extern int last_command_exit_value, stdi
- extern int need_here_doc;
- extern int current_command_number, current_command_line_count, line_number;
- extern int expand_aliases;
-+extern int rpm_requires;
-
- static void send_pwd_to_eterm __P((void));
- static sighandler alrm_catcher __P((int));
-@@ -136,7 +137,7 @@ reader_loop ()
-
- if (read_command () == 0)
- {
-- if (interactive_shell == 0 && read_but_dont_execute)
-+ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires))
- {
- last_command_exit_value = EXECUTION_SUCCESS;
- dispose_command (global_command);
-diff -up bash-4.0/builtins/mkbuiltins.c.requires bash-4.0/builtins/mkbuiltins.c
---- bash-4.0/builtins/mkbuiltins.c.requires 2009-01-04 20:32:23.000000000 +0100
-+++ bash-4.0/builtins/mkbuiltins.c 2009-01-21 16:16:05.000000000 +0100
-@@ -69,9 +69,15 @@ extern char *strcpy ();
- #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
+diff -up bash-4.0/shell.c.requires bash-4.0/shell.c
+--- bash-4.0/shell.c.requires 2010-03-30 14:47:10.000000000 +0200
++++ bash-4.0/shell.c 2010-03-30 14:47:10.000000000 +0200
+@@ -193,6 +193,9 @@ int have_devfd = 0;
+ /* The name of the .(shell)rc file. */
+ static char *bashrc_file = "~/.bashrc";
- /* 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_POSIX_BUILTIN 0x04
-+#define BUILTIN_FLAG_REQUIRES 0x08
++/* 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;
- #define BASE_INDENT 4
-
-@@ -163,10 +169,18 @@ char *posix_builtins[] =
- (char *)NULL
- };
-
-+/* The builtin commands that cause requirements on other files. */
-+static char *requires_builtins[] =
-+{
-+ ".", "command", "exec", "source", "inlib",
-+ (char *)NULL
-+};
-+
- /* Forward declarations. */
- static int is_special_builtin ();
- static int is_assignment_builtin ();
- static int is_posix_builtin ();
-+static int is_requires_builtin ();
+@@ -251,6 +254,7 @@ static const struct {
+ { "posix", Int, &posixly_correct, (char **)0x0 },
+ { "protected", Int, &protected_mode, (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
+@@ -479,6 +483,12 @@ main (argc, argv, env)
+ if (dump_translatable_strings)
+ read_but_dont_execute = 1;
- #if !defined (HAVE_RENAME)
- static int rename ();
-@@ -812,6 +826,9 @@ builtin_handler (self, defs, arg)
- new->flags |= BUILTIN_FLAG_ASSIGNMENT;
- if (is_posix_builtin (name))
- new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
-+ if (is_requires_builtin (name))
-+ new->flags |= BUILTIN_FLAG_REQUIRES;
++ if (rpm_requires)
++ {
++ read_but_dont_execute = 1;
++ initialize_shell_builtins ();
++ }
+
+ if (running_setuid && privileged_mode == 0)
+ disable_priv_mode ();
- array_add ((char *)new, defs->builtins);
- building_builtin = 1;
-@@ -1229,11 +1246,12 @@ write_builtins (defs, structfile, extern
- else
- fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
-
-- fprintf (structfile, "%s%s%s%s, %s_doc,\n",
-+ fprintf (structfile, "%s%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_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "",
-+ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "",
- document_name (builtin));
-
- fprintf
-@@ -1581,6 +1599,13 @@ is_posix_builtin (name)
- return (_find_in_table (name, posix_builtins));
- }
-
-+static int
-+is_requires_builtin (name)
-+ char *name;
-+{
-+ return (_find_in_table (name, requires_builtins));
-+}
-+
- #if !defined (HAVE_RENAME)
- static int
- rename (from, to)
Index: bash.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bash/F-12/bash.spec,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -p -r1.192 -r1.193
--- bash.spec 11 Dec 2009 11:38:00 -0000 1.192
+++ bash.spec 30 Mar 2010 13:55:01 -0000 1.193
@@ -5,7 +5,7 @@
Version: %{baseversion}%{patchlevel}
Name: bash
Summary: The GNU Bourne Again shell
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: System Environment/Shells
License: GPLv2+
Url: http://www.gnu.org/software/bash
@@ -331,6 +331,9 @@ fi
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
%changelog
+* Tue Mar 30 2010 Roman Rakus <rrakus at redhat.com> - 4.0.35-3
+- Corrected requires patch (#563301)
+
* Fri Dec 11 2009 Roman Rakus <rrakus at redhat.com> - 4.0.35-1
- Don't segfault when TERM=eterm* and EMACS is unset (#530911)
- patch level 35
More information about the scm-commits
mailing list