rpms/bash/devel bash-3.2-command_not_found.patch, NONE, 1.1 bash.spec, 1.163, 1.164
Roman Rakus
rrakus at fedoraproject.org
Thu Dec 4 15:20:13 UTC 2008
Author: rrakus
Update of /cvs/extras/rpms/bash/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31946
Modified Files:
bash.spec
Added Files:
bash-3.2-command_not_found.patch
Log Message:
Resolves: #432579. Added check for "command_not_found_handler" shell function.
bash-3.2-command_not_found.patch:
--- NEW FILE bash-3.2-command_not_found.patch ---
diff -up bash-3.2/config-top.h.command_not_found bash-3.2/config-top.h
--- bash-3.2/config-top.h.command_not_found 2008-12-04 15:45:21.000000000 +0100
+++ bash-3.2/config-top.h 2008-12-04 15:45:55.000000000 +0100
@@ -87,3 +87,7 @@
/* Define this if you want bash to try to check whether it's being run by
sshd and source the .bashrc if so (like the rshd behavior). */
#define SSH_SOURCE_BASHRC
+
+/* Define this if you want bash to try to find command_not_found_handler
+ shell function */
+#define COMMAND_NOT_FOUND_HANDLER
diff -up bash-3.2/execute_cmd.c.command_not_found bash-3.2/execute_cmd.c
--- bash-3.2/execute_cmd.c.command_not_found 2008-12-04 15:34:48.000000000 +0100
+++ bash-3.2/execute_cmd.c 2008-12-04 15:34:52.000000000 +0100
@@ -3737,10 +3737,33 @@ execute_disk_command (words, redirects,
if (command == 0)
{
+#if defined (COMMAND_NOT_FOUND_HANDLER)
+ SHELL_VAR *f, *v;
+ WORD_LIST *cmdlist;
+ WORD_DESC *w;
+ int fval;
+ if ( (posixly_correct || interactive_shell == 0) ||
+ ( f = find_function ("command_not_found_handler")) == 0)
+ {
+ internal_error (_("%s: command not found"), pathname);
+ exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
+ }
+ w = make_word("command_not_found_handler");
+ cmdlist = make_word_list(w, (WORD_LIST*)NULL);
+
+ w = make_word(pathname);
+ cmdlist->next = make_word_list(w, (WORD_LIST*)NULL);
+
+ fval = execute_shell_function (f, cmdlist);
+ if (fval == EX_NOTFOUND)
+ internal_error (_("%s: command not found"), pathname);
+ exit(fval);
+ }
+#else
internal_error (_("%s: command not found"), pathname);
exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
}
-
+#endif
/* Execve expects the command name to be in args[0]. So we
leave it there, in the same format that the user used to
type it in. */
Index: bash.spec
===================================================================
RCS file: /cvs/extras/rpms/bash/devel/bash.spec,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- bash.spec 28 Oct 2008 21:33:41 -0000 1.163
+++ bash.spec 4 Dec 2008 15:19:43 -0000 1.164
@@ -1,7 +1,7 @@
Version: 3.2
Name: bash
Summary: The GNU Bourne Again shell (bash) version %{version}
-Release: 29%{?dist}
+Release: 30%{?dist}
Group: System Environment/Shells
License: GPLv2+
Url: http://www.gnu.org/software/bash
@@ -76,6 +76,7 @@
Patch141: bash-3.2-patch035.patch
Patch142: bash-3.2-execve_catch_signals.patch
Patch143: bash-3.2-ssh_source_bash.patch
+Patch144: bash-3.2-command_not_found.patch
Requires(post): ncurses-libs
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -163,6 +164,7 @@
%patch140 -p1 -b .man-page-suspend
%patch142 -p1 -b .execve_catch_signals
%patch143 -p1 -b .ssh_source_bash
+%patch144 -p1 -b .command_not_found
echo %{version} > _distribution
echo %{release} > _patchlevel
@@ -304,6 +306,10 @@
%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
%changelog
+* Thu Dec 04 2008 Roman Rakus <rrakus at redhat.com> - 3.2-30
+- Added check for `command_not_found_handler' shell function
+ Resolves: #432579
+
* Tue Oct 28 2008 Jesse Keating <jkeating at redhat.com> - 3.2-29
- Add the Requires(post) back for ncurses-libs, so that rpm knows
where to break the loop. The post actually does require the curses
More information about the fedora-extras-commits
mailing list