From e0417322d8db8274f9bf4b5c495c48d0a1a19e013e0bd65b69777cfcd8e02276 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 24 Jul 2008 20:02:31 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bash?expand=0&rev=25 --- bash.changes | 5 ++++ bash.spec | 15 ++++++---- command-not-found.patch | 63 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 command-not-found.patch diff --git a/bash.changes b/bash.changes index 0168a94..ec735d0 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 24 16:41:41 CEST 2008 - werner@suse.de + +- Add command-not-found.patch for scout support (fate#303730) + ------------------------------------------------------------------- Tue Jun 17 11:05:07 CEST 2008 - werner@suse.de diff --git a/bash.spec b/bash.spec index c3ec115..e8db25f 100644 --- a/bash.spec +++ b/bash.spec @@ -18,9 +18,10 @@ Group: System/Shells %define bash_vers 3.2 %define rl_vers 5.2 Recommends: bash-doc = %bash_vers +Suggests: scout AutoReqProv: on Version: 3.2 -Release: 114 +Release: 119 Summary: The GNU Bourne-Again Shell Url: http://www.gnu.org/software/bash/bash.html Source0: bash-%{bash_vers}.tar.bz2 @@ -51,6 +52,7 @@ Patch21: readline-4.3-input.dif Patch22: readline-5.2-wrap.patch Patch23: readline-5.2-conf.patch Patch30: readline-5.1-destdir.patch +Patch40: command-not-found.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _incdir %{_includedir} @@ -76,7 +78,7 @@ Group: Documentation/Man Provides: bash:%{_infodir}/bash.info.gz PreReq: %install_info_prereq Version: 3.2 -Release: 73 +Release: 78 AutoReqProv: on %description -n bash-doc @@ -96,7 +98,7 @@ Summary: The Readline Library Group: System/Libraries Provides: bash:/%{_lib}/libreadline.so.5 Version: 5.2 -Release: 73 +Release: 78 Recommends: readline-doc = %{version} Provides: readline = 5.2 Obsoletes: readline <= 5.2 @@ -120,7 +122,7 @@ Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Provides: bash:%{_libdir}/libreadline.a Version: 5.2 -Release: 114 +Release: 119 Requires: libreadline5 = %{version} Requires: ncurses-devel Recommends: readline-doc = %{version} @@ -144,7 +146,7 @@ Group: System/Libraries Provides: readline:%{_infodir}/readline.info.gz PreReq: %install_info_prereq Version: 5.2 -Release: 73 +Release: 78 AutoReqProv: on %description -n readline-doc @@ -183,6 +185,7 @@ unset p %patch21 -p0 -b .zerotty %patch22 -p0 -b .wrap %patch23 -p0 -b .conf +%patch40 -p0 -b .cmdnotfnd %patch0 -p0 cd ../readline-%{rl_vers} for p in ../readline-%{rl_vers}-patches/*; do @@ -421,6 +424,8 @@ EOF %doc %{_defaultdocdir}/readline/ %changelog +* Thu Jul 24 2008 werner@suse.de +- Add command-not-found.patch for scout support (fate#303730) * Tue Jun 17 2008 werner@suse.de - Avoid underline the full paragraph in the man page (bnc#400767) * Sat May 17 2008 coolo@suse.de diff --git a/command-not-found.patch b/command-not-found.patch new file mode 100644 index 0000000..cdd1766 --- /dev/null +++ b/command-not-found.patch @@ -0,0 +1,63 @@ +--- doc/bash.1 ++++ doc/bash.1 +@@ -2035,6 +2035,13 @@ + be a prefix of a stopped job's name; this provides functionality + analogous to the \fB%\fP\fIstring\fP job identifier. + .TP ++.B command_not_found_handle ++The name of a shell function to be called if a command cannot be ++found. The return value of this function should be 0, if the command ++is available after execution of the function, otherwise 127 (EX_NOTFOUND). ++Enabled only in interactive, non POSIX mode shells. This is a Debian ++extension. ++.TP + .B histchars + The two or three characters which control history expansion + and tokenization (see +--- doc/bashref.texi ++++ doc/bashref.texi +@@ -4809,6 +4809,13 @@ + @item UID + The numeric real user id of the current user. This variable is readonly. + ++@item command_not_found_handle ++The name of a shell function to be called if a command cannot be ++found. The return value of this function should be 0, if the command ++is available after execution of the function, otherwise 127 (EX_NOTFOUND). ++Enabled only in interactive, non POSIX mode shells. This is a Debian ++extension. ++ + @end vtable + + @node Bash Features +--- execute_cmd.c ++++ execute_cmd.c +@@ -3722,8 +3722,26 @@ + + if (command == 0) + { +- internal_error (_("%s: command not found"), pathname); +- exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */ ++ SHELL_VAR *f, *v; ++ WORD_LIST *cmdlist; ++ WORD_DESC *w; ++ int fval; ++ if( (posixly_correct || interactive_shell == 0) || ++ (f = find_function ("command_not_found_handle")) == 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_handle"); ++ 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); + } + + /* Execve expects the command name to be in args[0]. So we