This commit is contained in:
parent
1e9219bc66
commit
e0417322d8
@ -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
|
Tue Jun 17 11:05:07 CEST 2008 - werner@suse.de
|
||||||
|
|
||||||
|
15
bash.spec
15
bash.spec
@ -18,9 +18,10 @@ Group: System/Shells
|
|||||||
%define bash_vers 3.2
|
%define bash_vers 3.2
|
||||||
%define rl_vers 5.2
|
%define rl_vers 5.2
|
||||||
Recommends: bash-doc = %bash_vers
|
Recommends: bash-doc = %bash_vers
|
||||||
|
Suggests: scout
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Version: 3.2
|
Version: 3.2
|
||||||
Release: 114
|
Release: 119
|
||||||
Summary: The GNU Bourne-Again Shell
|
Summary: The GNU Bourne-Again Shell
|
||||||
Url: http://www.gnu.org/software/bash/bash.html
|
Url: http://www.gnu.org/software/bash/bash.html
|
||||||
Source0: bash-%{bash_vers}.tar.bz2
|
Source0: bash-%{bash_vers}.tar.bz2
|
||||||
@ -51,6 +52,7 @@ Patch21: readline-4.3-input.dif
|
|||||||
Patch22: readline-5.2-wrap.patch
|
Patch22: readline-5.2-wrap.patch
|
||||||
Patch23: readline-5.2-conf.patch
|
Patch23: readline-5.2-conf.patch
|
||||||
Patch30: readline-5.1-destdir.patch
|
Patch30: readline-5.1-destdir.patch
|
||||||
|
Patch40: command-not-found.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%global _sysconfdir /etc
|
%global _sysconfdir /etc
|
||||||
%global _incdir %{_includedir}
|
%global _incdir %{_includedir}
|
||||||
@ -76,7 +78,7 @@ Group: Documentation/Man
|
|||||||
Provides: bash:%{_infodir}/bash.info.gz
|
Provides: bash:%{_infodir}/bash.info.gz
|
||||||
PreReq: %install_info_prereq
|
PreReq: %install_info_prereq
|
||||||
Version: 3.2
|
Version: 3.2
|
||||||
Release: 73
|
Release: 78
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
|
|
||||||
%description -n bash-doc
|
%description -n bash-doc
|
||||||
@ -96,7 +98,7 @@ Summary: The Readline Library
|
|||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Provides: bash:/%{_lib}/libreadline.so.5
|
Provides: bash:/%{_lib}/libreadline.so.5
|
||||||
Version: 5.2
|
Version: 5.2
|
||||||
Release: 73
|
Release: 78
|
||||||
Recommends: readline-doc = %{version}
|
Recommends: readline-doc = %{version}
|
||||||
Provides: readline = 5.2
|
Provides: readline = 5.2
|
||||||
Obsoletes: 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++
|
Group: Development/Libraries/C and C++
|
||||||
Provides: bash:%{_libdir}/libreadline.a
|
Provides: bash:%{_libdir}/libreadline.a
|
||||||
Version: 5.2
|
Version: 5.2
|
||||||
Release: 114
|
Release: 119
|
||||||
Requires: libreadline5 = %{version}
|
Requires: libreadline5 = %{version}
|
||||||
Requires: ncurses-devel
|
Requires: ncurses-devel
|
||||||
Recommends: readline-doc = %{version}
|
Recommends: readline-doc = %{version}
|
||||||
@ -144,7 +146,7 @@ Group: System/Libraries
|
|||||||
Provides: readline:%{_infodir}/readline.info.gz
|
Provides: readline:%{_infodir}/readline.info.gz
|
||||||
PreReq: %install_info_prereq
|
PreReq: %install_info_prereq
|
||||||
Version: 5.2
|
Version: 5.2
|
||||||
Release: 73
|
Release: 78
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
|
|
||||||
%description -n readline-doc
|
%description -n readline-doc
|
||||||
@ -183,6 +185,7 @@ unset p
|
|||||||
%patch21 -p0 -b .zerotty
|
%patch21 -p0 -b .zerotty
|
||||||
%patch22 -p0 -b .wrap
|
%patch22 -p0 -b .wrap
|
||||||
%patch23 -p0 -b .conf
|
%patch23 -p0 -b .conf
|
||||||
|
%patch40 -p0 -b .cmdnotfnd
|
||||||
%patch0 -p0
|
%patch0 -p0
|
||||||
cd ../readline-%{rl_vers}
|
cd ../readline-%{rl_vers}
|
||||||
for p in ../readline-%{rl_vers}-patches/*; do
|
for p in ../readline-%{rl_vers}-patches/*; do
|
||||||
@ -421,6 +424,8 @@ EOF
|
|||||||
%doc %{_defaultdocdir}/readline/
|
%doc %{_defaultdocdir}/readline/
|
||||||
|
|
||||||
%changelog
|
%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
|
* Tue Jun 17 2008 werner@suse.de
|
||||||
- Avoid underline the full paragraph in the man page (bnc#400767)
|
- Avoid underline the full paragraph in the man page (bnc#400767)
|
||||||
* Sat May 17 2008 coolo@suse.de
|
* Sat May 17 2008 coolo@suse.de
|
||||||
|
63
command-not-found.patch
Normal file
63
command-not-found.patch
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user