SHA256
3
0
forked from pool/bash
OBS User unknown 2009-03-03 17:12:53 +00:00 committed by Git OBS Bridge
parent 4d9f0f7a9c
commit 2c7ca49ae2
24 changed files with 308 additions and 394 deletions

View File

@ -1,4 +1,4 @@
libreadline5
libreadline6
obsoletes "readline-<targettype> <= <version>"
provides "readline-<targettype> = <version>"
targettype x86 package bash
@ -7,4 +7,4 @@ targettype x86 package bash
prereq -glibc-x86
readline-devel
requires -readline-<targettype>
requires "libreadline5-<targettype> = <version>"
requires "libreadline6-<targettype> = <version>"

View File

@ -13,15 +13,6 @@
.B \-D
A list of all double-quoted strings preceded by \fB$\fP
is printed on the standard ouput.
@@ -2539,7 +2539,7 @@ The \fIpattern\fP is expanded to produce
pathname expansion.
\fIParameter\fP is expanded and the longest match of \fIpattern\fP
against its value is replaced with \fIstring\fP.
-If \Ipattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are
+If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are
replaced with \fIstring\fP. Normally only the first match is replaced.
If \fIpattern\fP begins with \fB#\fP, it must match at the beginning
of the expanded value of \fIparameter\fP.
@@ -5799,6 +5805,11 @@
.SH "SHELL BUILTIN COMMANDS"
.\" start of bash_builtins

View File

@ -1,19 +0,0 @@
*** parse.y
--- parse.y Tue Jan 10 11:36:59 2006
***************
*** 2842,2848 ****
ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
xfree (nestret);
! if ((rflags & P_DQUOTE) == 0)
{
nestret = sh_single_quote (ttrans);
free (ttrans);
--- 2842,2848 ----
ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
xfree (nestret);
! if (extended_quote || (rflags & P_DQUOTE) == 0)
{
nestret = sh_single_quote (ttrans);
free (ttrans);

View File

@ -1,16 +0,0 @@
builtins/printf.def | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: bash-3.1/builtins/printf.def
===================================================================
--- bash-3.1.orig/builtins/printf.def 2005-12-12 16:00:42.000000000 +0100
+++ bash-3.1/builtins/printf.def 2005-12-12 16:01:38.000000000 +0100
@@ -558,7 +558,7 @@ printstr (fmt, string, len, fieldwidth,
#else
if (string == 0 || len == 0)
#endif
- return;
+ return 0;
#if 0
s = fmt;

View File

@ -1,31 +0,0 @@
--- pcomplete.c
+++ pcomplete.c 2009-01-30 16:59:12.648484782 +0100
@@ -990,7 +990,7 @@ gen_shell_function_matches (cs, text, li
SHELL_VAR *f, *v;
WORD_LIST *cmdlist;
int fval;
- sh_parser_state_t ps;
+ sh_parser_state_t ps, *__restrict__ pps = &ps;
#if defined (ARRAY_VARS)
ARRAY *a;
#endif
@@ -1015,9 +1015,16 @@ gen_shell_function_matches (cs, text, li
cmdlist = build_arg_list (funcname, text, lwords, cw);
- save_parser_state (&ps);
- fval = execute_shell_function (f, cmdlist);
- restore_parser_state (&ps);
+ save_parser_state (pps);
+ begin_unwind_frame ("gen-shell-function-matches");
+ add_unwind_protect (restore_parser_state, (char *)pps);
+ add_unwind_protect (dispose_words, (char *)cmdlist);
+ add_unwind_protect (unbind_compfunc_variables, (char *)0);
+
+ fval = execute_shell_function (f, cmdlist);
+
+ discard_unwind_frame ("gen-shell-function-matches");
+ restore_parser_state (pps);
/* Now clean up and destroy everything. */
dispose_words (cmdlist);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e006f67aef32036d0bf9385888d6c1f3f4ce15a9fb702e58ce7e42cf39967692
size 29070

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db7d1eda0e56a05c5d6931a4f9949c8f40b3d6deed41b699dd313160203bfd8f
size 1930918

View File

@ -0,0 +1,20 @@
--- parse.y
+++ parse.y 2009-02-27 16:09:21.720002034 +0100
@@ -3101,7 +3101,7 @@ parse_matched_pair (qc, open, close, len
ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
xfree (nestret);
- if ((rflags & P_DQUOTE) == 0)
+ if (extended_quote || (rflags & P_DQUOTE) == 0)
{
nestret = sh_single_quote (ttrans);
free (ttrans);
@@ -3470,7 +3470,7 @@ eof_error:
ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
xfree (nestret);
- if ((rflags & P_DQUOTE) == 0)
+ if (extended_quote || (rflags & P_DQUOTE) == 0)
{
nestret = sh_single_quote (ttrans);
free (ttrans);

View File

@ -1,22 +1,23 @@
--- examples/loadables/Makefile.in
+++ examples/loadables/Makefile.in 2006-09-25 13:31:55.000000000 +0200
@@ -81,7 +81,7 @@
@@ -83,7 +83,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/l
$(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $<
-ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
+ALLPROG = print sleep finfo logname basename dirname \
tty pathchk tee head mkdir rmdir printenv id whoami \
uname sync push ln unlink cut realpath getconf strftime
uname sync push ln unlink cut realpath getconf strftime mypid
OTHERPROG = necho hello cat
--- examples/loadables/basename.c
+++ examples/loadables/basename.c 2006-09-25 13:49:31.000000000 +0200
@@ -9,9 +9,12 @@
@@ -9,10 +9,13 @@
#endif
#include <stdio.h>
-#include "builtins.h"
#include "shell.h"
#include "common.h"
+#include "builtins.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
@ -27,7 +28,7 @@
{
--- examples/loadables/cat.c
+++ examples/loadables/cat.c 2006-09-25 13:37:46.000000000 +0200
@@ -7,8 +7,10 @@
@@ -25,8 +25,10 @@
#include <fcntl.h>
#include <errno.h>
@ -41,7 +42,7 @@
extern int errno;
--- examples/loadables/cut.c
+++ examples/loadables/cut.c 2006-09-25 14:00:21.000000000 +0200
@@ -60,8 +60,10 @@
@@ -60,8 +60,10 @@ static const char sccsid[] = "@(#)cut.c
# include <unistd.h>
#endif
@ -51,9 +52,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#if !defined (errno)
@@ -243,7 +245,7 @@
@@ -244,7 +246,7 @@ c_cut(fp, fname)
pos = positions + 1;
for (col = maxval; col; --col) {
if ((ch = getc(fp)) == EOF)
@ -64,12 +65,13 @@
if (*pos++)
--- examples/loadables/dirname.c
+++ examples/loadables/dirname.c 2006-09-25 13:49:38.000000000 +0200
@@ -9,9 +9,12 @@
@@ -27,10 +27,13 @@
#endif
#include <stdio.h>
-#include "builtins.h"
#include "shell.h"
#include "common.h"
+#include "builtins.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
@ -80,7 +82,7 @@
{
--- examples/loadables/finfo.c
+++ examples/loadables/finfo.c 2006-09-25 13:48:52.000000000 +0200
@@ -16,6 +16,8 @@
@@ -20,6 +20,8 @@
#include "bashansi.h"
#include "shell.h"
#include "builtins.h"
@ -89,7 +91,7 @@
#include "common.h"
#ifndef errno
@@ -77,7 +79,7 @@
@@ -81,7 +83,7 @@ int argc;
char **argv;
{
register int i;
@ -98,7 +100,7 @@
sh_optind = 0; /* XXX */
prog = base_pathname(argv[0]);
@@ -170,7 +172,7 @@
@@ -174,7 +176,7 @@ int m;
return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID));
}
@ -107,7 +109,7 @@
perms(m)
int m;
{
@@ -214,7 +216,7 @@
@@ -218,7 +220,7 @@ int m;
printf ("u=%s,g=%s,o=%s", ubits, gbits, obits);
}
@ -116,7 +118,7 @@
printmode(mode)
int mode;
{
@@ -309,13 +311,13 @@
@@ -313,13 +315,13 @@ int flags;
else
printf("%ld\n", st->st_ctime);
} else if (flags & OPT_DEV)
@ -134,7 +136,7 @@
else if (flags & OPT_LNKNAM) {
#ifdef S_ISLNK
b = xmalloc(4096);
@@ -365,7 +367,6 @@
@@ -369,7 +371,6 @@ finfo_builtin(list)
{
int c, r;
char **v;
@ -153,7 +155,7 @@
#include "stdc.h"
#include "common.h"
#include "bashgetopt.h"
@@ -1119,8 +1121,6 @@
@@ -1119,8 +1121,6 @@ static const struct conf_variable conf_t
{ NULL }
};
@ -162,7 +164,7 @@
extern char *this_command_name;
extern char **make_builtin_argv ();
@@ -1133,8 +1133,7 @@
@@ -1133,8 +1133,7 @@ int
getconf_builtin (list)
WORD_LIST *list;
{
@ -172,7 +174,7 @@
aflag = 0;
reset_internal_getopt();
@@ -1169,7 +1168,6 @@
@@ -1169,7 +1168,6 @@ static void
getconf_help()
{
const struct conf_variable *cp;
@ -182,16 +184,16 @@
printf("Acceptable variable names are:\n");
--- examples/loadables/head.c
+++ examples/loadables/head.c 2006-09-25 13:55:24.000000000 +0200
@@ -20,6 +20,8 @@
@@ -38,6 +38,8 @@
#include "builtins.h"
#include "shell.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#if !defined (errno)
@@ -69,8 +71,10 @@
@@ -88,8 +90,10 @@ file_head (fp, cnt)
break;
}
}
@ -202,7 +204,7 @@
head_builtin (list)
WORD_LIST *list;
{
@@ -78,8 +82,6 @@
@@ -97,8 +101,6 @@ head_builtin (list)
WORD_LIST *l;
FILE *fp;
@ -227,7 +229,7 @@
/* A builtin `xxx' is normally implemented with an `xxx_builtin' function.
--- examples/loadables/id.c
+++ examples/loadables/id.c 2006-09-25 13:57:41.000000000 +0200
@@ -29,6 +29,8 @@
@@ -47,6 +47,8 @@ extern struct group *getgrgid ();
#include "shell.h"
#include "builtins.h"
@ -236,7 +238,7 @@
#include "stdc.h"
#include "common.h"
#include "bashgetopt.h"
@@ -46,8 +48,6 @@
@@ -64,8 +66,6 @@ static int id_flags;
static uid_t ruid, euid;
static gid_t rgid, egid;
@ -247,7 +249,7 @@
static int id_pruser ();
--- examples/loadables/ln.c
+++ examples/loadables/ln.c 2006-09-25 13:59:09.000000000 +0200
@@ -15,8 +15,10 @@
@@ -33,8 +33,10 @@
#include <stdio.h>
#include <errno.h>
@ -257,9 +259,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#if !defined (errno)
@@ -31,6 +33,7 @@
@@ -50,6 +52,7 @@ typedef int unix_link_syscall_t __P((con
static unix_link_syscall_t *linkfn;
static int dolink ();
@ -269,7 +271,7 @@
{
--- examples/loadables/logname.c
+++ examples/loadables/logname.c 2006-09-25 13:30:40.000000000 +0200
@@ -9,8 +9,10 @@
@@ -27,8 +27,10 @@
#include <stdio.h>
#include <errno.h>
@ -278,12 +280,12 @@
+#include "builtins.h"
+#include "builtins/common.h"
+#include "builtins/builtext.h"
#include "common.h"
#if !defined (errno)
extern int errno;
--- examples/loadables/mkdir.c
+++ examples/loadables/mkdir.c 2006-09-25 13:56:07.000000000 +0200
@@ -13,8 +13,10 @@
@@ -31,8 +31,10 @@
# include <unistd.h>
#endif
@ -293,9 +295,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#if !defined (errno)
@@ -33,7 +35,7 @@
@@ -52,7 +54,7 @@ int
mkdir_builtin (list)
WORD_LIST *list;
{
@ -304,7 +306,7 @@
char *mode;
WORD_LIST *l;
@@ -150,7 +152,7 @@
@@ -169,7 +171,7 @@ make_path (path, nmode, parent_mode)
while (*p == '/')
p++;
@ -315,9 +317,9 @@
if (stat (npath, &sb) != 0)
--- examples/loadables/necho.c
+++ examples/loadables/necho.c 2006-09-25 13:39:26.000000000 +0200
@@ -3,9 +3,15 @@
/* Sample builtin to be dynamically loaded with enable -f and replace an
existing builtin. */
@@ -21,9 +21,15 @@
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
@ -334,7 +336,7 @@
WORD_LIST *list;
--- examples/loadables/pathchk.c
+++ examples/loadables/pathchk.c 2006-09-25 13:53:13.000000000 +0200
@@ -40,8 +40,10 @@
@@ -58,8 +58,10 @@
#include <stdio.h>
#include <errno.h>
@ -346,7 +348,7 @@
#include "stdc.h"
#include "bashgetopt.h"
#include "maxpath.h"
@@ -79,6 +81,7 @@
@@ -98,6 +100,7 @@ extern char *strerror ();
static int validate_path ();
@ -354,7 +356,7 @@
pathchk_builtin (list)
WORD_LIST *list;
{
@@ -257,7 +260,7 @@
@@ -278,7 +281,7 @@ validate_path (path, portability)
char *path;
int portability;
{
@ -363,7 +365,7 @@
int last_elem; /* Nonzero if checking last element of path. */
int exists; /* 2 if the path element exists. */
char *slash;
@@ -269,10 +272,8 @@
@@ -290,10 +293,8 @@ validate_path (path, portability)
if (*path == '\0')
return 0;
@ -374,7 +376,7 @@
/* Figure out the parent of the first element in PATH. */
parent = xstrdup (*path == '/' ? "/" : ".");
@@ -349,7 +350,7 @@
@@ -370,7 +371,7 @@ validate_path (path, portability)
free (parent);
if (strlen (path) > path_max)
{
@ -385,7 +387,7 @@
}
--- examples/loadables/print.c
+++ examples/loadables/print.c 2006-09-25 13:23:46.000000000 +0200
@@ -15,6 +15,8 @@
@@ -33,6 +33,8 @@
#include "bashansi.h"
#include "shell.h"
#include "builtins.h"
@ -393,8 +395,8 @@
+#include "builtins/builtext.h"
#include "stdc.h"
#include "bashgetopt.h"
@@ -55,7 +57,7 @@
#include "builtext.h"
@@ -77,7 +79,7 @@ print_builtin (list)
{
int c, r, nflag, raw, ofd, sflag;
intmax_t lfd;
@ -405,7 +407,7 @@
nflag = raw = sflag = 0;
--- examples/loadables/printenv.c
+++ examples/loadables/printenv.c 2006-09-25 13:39:47.000000000 +0200
@@ -8,8 +8,10 @@
@@ -26,8 +26,10 @@
#include <config.h>
#include <stdio.h>
@ -415,11 +417,11 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
extern char **export_env;
--- examples/loadables/push.c
+++ examples/loadables/push.c 2006-09-25 13:39:53.000000000 +0200
@@ -7,8 +7,10 @@
@@ -25,8 +25,10 @@
#include <stdio.h>
#include <errno.h>
@ -430,10 +432,10 @@
+#include "builtins/common.h"
#include "jobs.h"
#include "bashgetopt.h"
#include "common.h"
--- examples/loadables/realpath.c
+++ examples/loadables/realpath.c 2006-09-25 14:03:01.000000000 +0200
@@ -31,8 +31,10 @@
@@ -49,8 +49,10 @@
#include <maxpath.h>
#include <errno.h>
@ -443,9 +445,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#ifndef errno
@@ -41,6 +43,7 @@
@@ -60,6 +62,7 @@ extern int errno;
extern char *sh_realpath();
@ -453,26 +455,9 @@
realpath_builtin(list)
WORD_LIST *list;
{
@@ -67,14 +70,14 @@
vflag = 1;
break;
default:
- usage();
+ builtin_usage();
}
}
list = loptend;
if (list == 0)
- usage();
+ builtin_usage();
for (es = EXECUTION_SUCCESS; list; list = list->next) {
p = list->word->word;
--- examples/loadables/rmdir.c
+++ examples/loadables/rmdir.c 2006-09-25 13:56:28.000000000 +0200
@@ -6,13 +6,16 @@
@@ -24,14 +24,17 @@
#include <stdio.h>
#include <errno.h>
@ -481,6 +466,7 @@
+#include "builtins.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "common.h"
#if !defined (errno)
extern int errno;
@ -491,19 +477,19 @@
WORD_LIST *list;
{
--- examples/loadables/sleep.c
+++ examples/loadables/sleep.c 2006-09-25 13:24:54.000000000 +0200
@@ -27,6 +27,8 @@
+++ examples/loadables/sleep.c 2009-02-27 16:36:23.740001554 +0100
@@ -46,6 +46,8 @@
#include "shell.h"
#include "builtins.h"
+#include "builtins/common.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "common.h"
#define RETURN(x) \
do { \
--- examples/loadables/strftime.c
+++ examples/loadables/strftime.c 2006-09-25 13:40:17.000000000 +0200
@@ -13,8 +13,10 @@
@@ -31,8 +31,10 @@
#include <stdio.h>
@ -517,7 +503,7 @@
int
--- examples/loadables/sync.c
+++ examples/loadables/sync.c 2006-09-25 13:58:50.000000000 +0200
@@ -6,10 +6,13 @@
@@ -24,10 +24,13 @@
#include <unistd.h>
#endif
@ -534,8 +520,8 @@
{
--- examples/loadables/tee.c
+++ examples/loadables/tee.c 2006-09-25 13:54:21.000000000 +0200
@@ -19,8 +19,10 @@
#include <stdio.h>
@@ -38,8 +38,10 @@
#include <signal.h>
#include <errno.h>
-#include "builtins.h"
@ -544,9 +530,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#if !defined (errno)
@@ -41,6 +43,7 @@
@@ -61,6 +63,7 @@ extern volatile sig_atomic_t interrupt_i
extern char *strerror ();
@ -554,7 +540,7 @@
tee_builtin (list)
WORD_LIST *list;
{
@@ -49,8 +52,6 @@
@@ -69,8 +72,6 @@ tee_builtin (list)
FLIST *fl;
char *buf, *bp;
@ -579,8 +565,9 @@
#if !defined (errno)
--- examples/loadables/truefalse.c
+++ examples/loadables/truefalse.c 2006-09-25 13:40:42.000000000 +0200
@@ -1,16 +1,22 @@
/* true and false builtins */
@@ -20,18 +20,24 @@
#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
@ -591,6 +578,7 @@
#include "builtins.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "common.h"
-true_builtin (list)
+int true_builtin (list)
@ -606,7 +594,7 @@
return EXECUTION_FAILURE;
--- examples/loadables/tty.c
+++ examples/loadables/tty.c 2006-09-25 13:49:53.000000000 +0200
@@ -5,12 +5,15 @@
@@ -23,13 +23,16 @@
#include "config.h"
#include <stdio.h>
@ -616,6 +604,7 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
extern char *ttyname ();
@ -625,7 +614,7 @@
{
--- examples/loadables/uname.c
+++ examples/loadables/uname.c 2006-09-25 13:58:18.000000000 +0200
@@ -24,8 +24,10 @@
@@ -42,8 +42,10 @@ struct utsname {
#include <errno.h>
@ -635,9 +624,9 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
#define FLAG_SYSNAME 0x01 /* -s */
@@ -44,10 +46,11 @@
@@ -63,10 +65,11 @@ static void uprint();
static int uname_flags;
@ -652,7 +641,7 @@
uname_flags = 0;
--- examples/loadables/unlink.c
+++ examples/loadables/unlink.c 2006-09-25 13:59:37.000000000 +0200
@@ -12,13 +12,16 @@
@@ -30,14 +30,17 @@
#include <stdio.h>
#include <errno.h>
@ -661,6 +650,7 @@
+#include "builtins.h"
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "common.h"
#ifndef errno
extern int errno;
@ -672,7 +662,7 @@
{
--- examples/loadables/whoami.c
+++ examples/loadables/whoami.c 2006-09-25 13:57:54.000000000 +0200
@@ -5,10 +5,13 @@
@@ -23,11 +23,14 @@
#include <config.h>
#include <stdio.h>
@ -682,8 +672,21 @@
+#include "builtins/builtext.h"
+#include "builtins/common.h"
#include "bashgetopt.h"
#include "common.h"
+int
whoami_builtin (list)
WORD_LIST *list;
{
--- shell.h
+++ shell.h 2009-03-02 14:39:17.706427251 +0100
@@ -22,6 +22,9 @@
#include "config.h"
#endif
+#include <sys/types.h>
+#include <unistd.h>
+
#include "bashjmp.h"
#include "command.h"

3
bash-4.0-patches.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8576ac72c83ab0e295f1b2101a79251e808cc505a7ce0dce4f99ce24a7935d44
size 128

View File

@ -1,6 +1,6 @@
--- variables.c
+++ variables.c Wed Aug 21 12:14:18 2002
@@ -1035,6 +1035,7 @@
+++ variables.c 2009-02-27 17:44:46.626430014 +0100
@@ -1203,6 +1203,7 @@ init_seconds_var ()
return v;
}
@ -8,8 +8,8 @@
/* The random number seed. You can change this by setting RANDOM. */
static unsigned long rseed = 1;
static int last_random_value;
@@ -1060,6 +1061,21 @@
last_random_value = 0;
@@ -1256,6 +1257,24 @@ seedrand ()
sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ());
}
+#else
@ -25,20 +25,34 @@
+{
+ srandom(seed);
+}
+
+static void
+seedrand () {}
+#endif
+
static SHELL_VAR *
assign_random (self, value, unused)
assign_random (self, value, unused, key)
SHELL_VAR *self;
@@ -1075,6 +1091,7 @@
@@ -1264,8 +1283,10 @@ assign_random (self, value, unused, key)
char *key;
{
int rv;
sbrand (strtoul (value, (char **)NULL, 10));
+#if !defined(linux)
if (subshell_environment)
seeded_subshell = getpid ();
+#endif
return (self);
}
@@ -1274,6 +1295,7 @@ get_random_number ()
{
int rv, pid;
+#if !defined(linux)
/* Reset for command and process substitution. */
if (subshell_environment)
sbrand (rseed + getpid() + NOW);
@@ -1082,6 +1099,18 @@
pid = getpid ();
if (subshell_environment && seeded_subshell != pid)
@@ -1285,6 +1307,18 @@ get_random_number ()
do
rv = brand ();
while (rv == last_random_value);
@ -57,7 +71,7 @@
return rv;
}
@@ -1093,7 +1122,9 @@
@@ -1296,7 +1330,9 @@ get_random (var)
char *p;
rv = get_random_number ();

View File

@ -1,6 +1,6 @@
--- locale.c
+++ locale.c 2008-11-25 13:26:15.482501498 +0000
@@ -42,6 +42,7 @@ extern int dump_translatable_strings, du
+++ locale.c 2009-02-27 16:40:50.576066695 +0100
@@ -47,6 +47,7 @@ extern int dump_translatable_strings, du
/* The current locale when the program begins */
static char *default_locale;
@ -8,26 +8,30 @@
/* The current domain for textdomain(3). */
static char *default_domain;
@@ -294,7 +295,21 @@ get_locale_var (var)
@@ -314,11 +315,21 @@ get_locale_var (var)
if (locale == 0 || *locale == 0)
locale = lang;
if (locale == 0 || *locale == 0)
-#if 0
- locale = default_locale; /* system-dependent; not really portable. should it be "C"? */
-#else
- locale = "";
-#endif
+ {
+ char *ptr;
+ if (default_locale && *default_locale && (ptr = strstr(default_locale, var)) && (ptr = strchr(ptr, '=')) && ++ptr)
+ {
+ memset (fallback, 0, sizeof(fallback));
+ strncpy(fallback, ptr, sizeof(fallback)-1);
+
+
+ if ((ptr = strchr(fallback, ';')))
+ *ptr = '\0';
+
+
+ locale = fallback;
+ }
+ else
+ locale = default_locale; /* system-dependent; not really portable. should it be "C"? */
+ }
return (locale);
}

View File

@ -1,26 +1,23 @@
--- .pkgextract
+++ .pkgextract 2006-03-27 14:15:25.000000000 +0200
@@ -0,0 +1,17 @@
+tar Oxfj ../bash-3.2-patches.tar.bz2 | patch -p0 -s
@@ -0,0 +1,14 @@
+tar Oxfj ../bash-4.0-patches.tar.bz2 | patch -p0 -s
+patch -p0 -s --suffix=".manual" < ../bash-2.03-manual.patch
+patch -p0 -s --suffix=".security" < ../bash-2.05a-security.patch
+patch -p0 -s --suffix=".security" < ../bash-4.0-security.patch
+patch -p0 -s --suffix=".2.4.4" < ../bash-3.2-2.4.4.patch
+patch -p0 -s --suffix=".evalexp" < ../bash-3.0-evalexp.patch
+patch -p0 -s --suffix=".warnlc" < ../bash-3.0-warn-locale.patch
+patch -p0 -s --suffix=".nfs_redir"< ../bash-3.0-nfs_redir.patch
+patch -p0 -s --suffix=".decl" < ../bash-3.0-decl.patch
+patch -p1 -s --suffix=".random2" < ../bash-3.1-random.patch
+patch -p0 -s --suffix=".equote" < ../bash-3.1-extended_quote.patch
+patch -p0 -s --suffix=".equote" < ../bash-4.0-extended_quote.patch
+patch -p0 -s --suffix=".printf" < ../bash-3.2-printf.patch
+patch -p0 -s --suffix=".plugins" < ../bash-3.1-loadables.dif
+patch -p0 -s --suffix=".valgrind" < ../bash-3.2-valgrind.patch
+patch -p0 -s --suffix=".plugins" < ../bash-4.0-loadables.dif
+patch -p0 -s --suffix=".zerotty" < ../readline-4.3-input.dif
+patch -p0 -s --suffix=".wrap" < ../readline-5.2-wrap.patch
+patch -p0 -s --suffix=".wrap" < ../readline-6.0-wrap.patch
+patch -p0 -s --suffix=".conf" < ../readline-5.2-conf.patch
+patch -p0 -s --suffix=".input" < ../readline-5.1-input.patch
--- config-top.h
+++ config-top.h 2007-12-04 15:44:39.314025629 +0100
@@ -52,14 +52,14 @@
+++ config-top.h 2009-02-27 17:03:21.460110230 +0100
@@ -54,14 +54,14 @@
/* The default value of the PATH variable. */
#ifndef DEFAULT_PATH_VALUE
#define DEFAULT_PATH_VALUE \
@ -37,7 +34,7 @@
#endif
/* Default primary and secondary prompt strings. */
@@ -73,15 +73,15 @@
@@ -75,20 +75,20 @@
#define KSH_COMPATIBLE_SELECT
/* System-wide .bashrc file for interactive shells. */
@ -54,9 +51,14 @@
+#define NON_INTERACTIVE_LOGIN_SHELLS
/* 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). */
sshd and source the .bashrc if so (like the rshd behavior). This checks
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
which can be fooled under certain not-uncommon circumstances. */
-/* #define SSH_SOURCE_BASHRC */
+#define SSH_SOURCE_BASHRC
/* Define if you want the case-capitalizing operators (~[~]) and the
`capcase' variable attribute (declare -c). */
--- general.h
+++ general.h 2006-03-27 14:15:25.000000000 +0200
@@ -21,10 +21,13 @@
@ -75,7 +77,7 @@
# if defined (HAVE_SYS_TIME_H)
--- jobs.c
+++ jobs.c 2006-03-27 14:15:25.000000000 +0200
@@ -197,10 +197,10 @@ int previous_job = NO_JOB;
@@ -199,10 +199,10 @@ int previous_job = NO_JOB;
#endif
/* Last child made by the shell. */
@ -88,7 +90,7 @@
/* The pipeline currently being built. */
PROCESS *the_pipeline = (PROCESS *)NULL;
@@ -213,7 +213,7 @@ int already_making_children = 0;
@@ -215,7 +215,7 @@ int already_making_children = 0;
/* If this is non-zero, $LINES and $COLUMNS are reset after every process
exits from get_tty_state(). */
@ -99,7 +101,7 @@
--- jobs.h
+++ jobs.h 2006-03-27 14:15:25.000000000 +0200
@@ -162,7 +162,7 @@ extern pid_t fork (), getpid (), getpgrp
@@ -165,7 +165,7 @@ extern pid_t fork (), getpid (), getpgrp
extern struct jobstats js;
extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp;
@ -110,7 +112,7 @@
extern JOB **jobs;
--- parse.y
+++ parse.y 2006-03-27 14:15:25.000000000 +0200
@@ -1182,7 +1182,7 @@ input_file_descriptor ()
@@ -1283,7 +1283,7 @@ input_file_descriptor ()
#if defined (READLINE)
char *current_readline_prompt = (char *)NULL;
@ -121,7 +123,7 @@
static int
--- shell.c
+++ shell.c 2006-03-27 14:15:25.000000000 +0200
@@ -460,7 +460,7 @@ main (argc, argv, env)
@@ -479,7 +479,7 @@ main (argc, argv, env)
if (dump_translatable_strings)
read_but_dont_execute = 1;
@ -132,7 +134,7 @@
/* Need to get the argument to a -c option processed in the
--- subst.c
+++ subst.c 2006-03-27 14:15:25.000000000 +0200
@@ -2717,6 +2717,7 @@ call_expand_word_internal (w, q, i, c, e
@@ -2859,6 +2859,7 @@ call_expand_word_internal (w, q, i, c, e
last_command_exit_value = EXECUTION_FAILURE;
exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF);
/* NOTREACHED */
@ -140,22 +142,9 @@
}
else
return (result);
--- variables.c
+++ variables.c 2006-03-27 14:15:25.000000000 +0200
@@ -1191,8 +1191,10 @@ assign_random (self, value, unused)
arrayind_t unused;
{
sbrand (strtoul (value, (char **)NULL, 10));
+#if !defined(linux)
if (subshell_environment)
seeded_subshell = 1;
+#endif
return (self);
}
--- builtins/shopt.def
+++ builtins/shopt.def 2006-03-27 14:15:25.000000000 +0200
@@ -252,9 +252,9 @@ reset_shopt_options ()
@@ -279,9 +279,9 @@ reset_shopt_options ()
allow_null_glob_expansion = glob_dot_filenames = 0;
cdable_vars = mail_warning = 0;
no_exit_on_failed_exec = print_shift_error = 0;
@ -169,18 +158,18 @@
extended_glob = 0;
--- doc/Makefile.in
+++ doc/Makefile.in 2006-03-27 14:15:25.000000000 +0200
@@ -141,7 +141,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $
@@ -142,7 +142,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $
${RM} $@
-${DVIPS} $<
-all: ps info dvi text html
+all: info html
nodvi: ps info text html
everything: all pdf
PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
--- doc/bash.1
+++ doc/bash.1 2006-03-27 14:15:25.000000000 +0200
@@ -4370,8 +4370,8 @@ file (the \fIinputrc\fP file).
@@ -4627,8 +4627,8 @@ file (the \fIinputrc\fP file).
The name of this file is taken from the value of the
.SM
.B INPUTRC
@ -191,7 +180,7 @@
When a program which uses the readline library starts up, the
initialization file is read, and the key bindings and variables
are set.
@@ -8816,6 +8816,9 @@ The individual login shell cleanup file,
@@ -9346,6 +9346,9 @@ The individual login shell cleanup file,
.TP
.FN ~/.inputrc
Individual \fIreadline\fP initialization file
@ -202,7 +191,7 @@
.SH AUTHORS
Brian Fox, Free Software Foundation
--- support/printenv.c
+++ support/printenv.c 2007-12-06 16:33:46.899561365 +0100
+++ support/printenv.c 2007-12-06 16:33:47.000000000 +0100
@@ -27,6 +27,7 @@
#if defined (HAVE_CONFIG_H)
# include <config.h>
@ -229,7 +218,7 @@
while [ $# -gt 0 ]; do
--- support/shobj-conf
+++ support/shobj-conf 2006-09-22 16:11:58.000000000 +0200
@@ -108,10 +108,11 @@ sunos5*|solaris2*)
@@ -112,10 +112,11 @@ sunos5*|solaris2*)
linux*-*|gnu*-*|k*bsd*-gnu-*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
@ -242,4 +231,20 @@
+ SHLIB_LIBS=-lncurses
;;
freebsd2* | netbsd*)
freebsd2*)
--- tests/run-intl
+++ tests/run-intl 2009-03-02 13:20:15.978553796 +0100
@@ -5,4 +5,4 @@ echo "warning: some of these tests will
echo "warning: locales installed on your system." >&2
echo "warning: please ignore any differences consisting only of white space" >&2
${THIS_SH} ./intl.tests > /tmp/xx
-diff $AFLAG /tmp/xx intl.right && rm -f /tmp/xx
+diff -w $AFLAG /tmp/xx intl.right && rm -f /tmp/xx
--- tests/run-read
+++ tests/run-read 2009-03-02 13:09:18.212713847 +0100
@@ -1,4 +1,4 @@
echo "warning: please do not consider output differing only in the amount of" >&2
echo "warning: white space to be an error." >&2
${THIS_SH} ./read.tests > /tmp/xx 2>&1
-diff /tmp/xx read.right && rm -f /tmp/xx
+diff -w /tmp/xx read.right && rm -f /tmp/xx

3
bash-4.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:690aaee489da2dcd0749109f89efa30a486299ac8a9a199c48ddfd2c53757c08
size 4706830

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Feb 27 17:39:08 CET 2009 - werner@suse.de
- Update bash 4.0 to patch level 0
- Update readline 6.0 to patch level 0
-------------------------------------------------------------------
Wed Feb 18 16:42:47 CET 2009 - werner@suse.de

106
bash.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package bash (Version 3.2)
# spec file for package bash (Version 4.0)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -21,17 +21,17 @@ Name: bash
BuildRequires: bison fdupes ncurses-devel
License: GPL v2 or later
Group: System/Shells
%define bash_vers 3.2
%define rl_vers 5.2
%define bash_vers 4.0
%define rl_vers 6.0
Recommends: bash-doc = %bash_vers
Suggests: command-not-found
AutoReqProv: on
Version: 3.2
Release: 148
Version: 4.0
Release: 2
Summary: The GNU Bourne-Again Shell
Url: http://www.gnu.org/software/bash/bash.html
Source0: bash-%{bash_vers}.tar.bz2
Source1: readline-%{rl_vers}.tar.bz2
Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bash_vers}.tar.bz2
Source1: ftp://ftp.gnu.org/gnu/readline/readline-%{rl_vers}.tar.bz2
Source2: bash-%{bash_vers}-patches.tar.bz2
Source3: readline-%{rl_vers}-patches.tar.bz2
Source4: run-tests
@ -40,30 +40,28 @@ Source6: dot.profile
Source7: bash-rpmlintrc
Patch0: bash-%{bash_vers}.dif
Patch1: bash-2.03-manual.patch
Patch2: bash-2.05a-security.patch
Patch2: bash-4.0-security.patch
Patch3: bash-3.2-2.4.4.patch
Patch4: bash-3.0-evalexp.patch
Patch5: bash-3.0-warn-locale.patch
Patch6: bash-3.0-nfs_redir.patch
Patch7: bash-3.0-decl.patch
Patch8: bash-3.1-random.patch
Patch9: bash-3.1-extended_quote.patch
Patch9: bash-4.0-extended_quote.patch
Patch10: bash-3.2-printf.patch
Patch11: bash-3.1-loadables.dif
Patch11: bash-4.0-loadables.dif
Patch14: bash-3.2-sigrestart.patch
Patch15: bash-3.2-longjmp.dif
Patch16: bash-3.2-setlocale.dif
Patch17: bash-3.2-complete.dif
Patch16: bash-4.0-setlocale.dif
Patch20: readline-%{rl_vers}.dif
Patch21: readline-4.3-input.dif
Patch22: readline-5.2-wrap.patch
Patch22: readline-6.0-wrap.patch
Patch23: readline-5.2-conf.patch
Patch30: readline-5.1-destdir.patch
Patch40: command-not-found.patch
Patch30: readline-6.0-destdir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _incdir %{_includedir}
%global _minsh 0
%{expand: %%global rl_major %(echo %{rl_vers} | sed -r 's/.[0-9]+//g')}
%description
Bash is an sh-compatible command interpreter that executes commands
@ -85,8 +83,8 @@ Summary: Documentation how to Use the GNU Bourne-Again Shell
Group: Documentation/Man
Provides: bash:%{_infodir}/bash.info.gz
PreReq: %install_info_prereq
Version: 3.2
Release: 107
Version: 4.0
Release: 2
AutoReqProv: on
%description -n bash-doc
@ -100,24 +98,24 @@ Authors:
Brian Fox <bfox@gnu.org>
Chet Ramey <chet@ins.cwru.edu>
%package -n libreadline5
%package -n libreadline6
License: GPL v2 or later
Summary: The Readline Library
Group: System/Libraries
Provides: bash:/%{_lib}/libreadline.so.5
Version: 5.2
Release: 107
Provides: bash:/%{_lib}/libreadline.so.%{rl_major}
Version: 6.0
Release: 2
Recommends: readline-doc = %{version}
# bug437293
%ifarch ppc64
Obsoletes: readline-64bit
%endif
#
Provides: readline = 5.2
Obsoletes: readline <= 5.2
Provides: readline = 6.0
Obsoletes: readline <= 6.0
AutoReqProv: on
%description -n libreadline5
%description -n libreadline6
The readline library is used by the Bourne Again Shell (bash, the
standard command interpreter) for easy editing of command lines. This
includes history and search functionality.
@ -134,9 +132,9 @@ License: GPL v2 or later
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Provides: bash:%{_libdir}/libreadline.a
Version: 5.2
Release: 148
Requires: libreadline5 = %{version}
Version: 6.0
Release: 2
Requires: libreadline6 = %{version}
Requires: ncurses-devel
Recommends: readline-doc = %{version}
AutoReqProv: on
@ -163,8 +161,8 @@ Summary: Documentation how to Use and Program with the Readline Library
Group: System/Libraries
Provides: readline:%{_infodir}/readline.info.gz
PreReq: %install_info_prereq
Version: 5.2
Release: 107
Version: 6.0
Release: 2
AutoReqProv: on
%description -n readline-doc
@ -193,18 +191,15 @@ unset p
%patch5 -p0 -b .warnlc
%patch6 -p0 -b .nfs_redir
%patch7 -p0 -b .decl
%patch8 -p1 -b .random2
%patch9 -p0 -b .extended_quote
%patch10 -p0 -b .printf
%patch11 -p0 -b .plugins
%patch14 -p0 -b .sigrestart
%patch15 -p0 -b .longjmp
%patch16 -p0 -b .setlocale
%patch17 -p0 -b .complete
%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
@ -254,6 +249,8 @@ cd ../readline-%{rl_vers}
cflags -Wextra CFLAGS
cflags -Wno-unprototyped-calls CFLAGS
cflags -Wno-switch-enum CFLAGS
cflags -Wno-unused-variable CFLAGS
cflags -Wno-unused-parameter CFLAGS
cflags -ftree-loop-linear CFLAGS
cflags -pipe CFLAGS
cflags -Wl,--as-needed LDFLAGS
@ -272,9 +269,9 @@ cd ../readline-%{rl_vers}
make
make documentation
ln -sf shlib/libreadline.so.%{rl_vers} libreadline.so
ln -sf shlib/libreadline.so.%{rl_vers} libreadline.so.5
ln -sf shlib/libreadline.so.%{rl_vers} libreadline.so.%{rl_major}
ln -sf shlib/libhistory.so.%{rl_vers} libhistory.so
ln -sf shlib/libhistory.so.%{rl_vers} libhistory.so.5
ln -sf shlib/libhistory.so.%{rl_vers} libhistory.so.%{rl_major}
cd ../bash-%{bash_vers}
# /proc is required for correct configuration
test -d /dev/fd || { echo "/proc is not mounted!" >&2; exit 1; }
@ -291,9 +288,6 @@ cd ../bash-%{bash_vers}
# cflags -fno-stack-protector CFLAGS
# cflags -fno-unwind-tables CFLAGS
# cflags -fno-asynchronous-unwind-tables CFLAGS
%else
cflags -fPIE CFLAGS
cflags -pie LDFLAGS
%endif
CC_FOR_BUILD="$CC"
CFLAGS_FOR_BUILD="$CFLAGS"
@ -305,6 +299,7 @@ cd ../bash-%{bash_vers}
#
SYSMALLOC="
--without-gnu-malloc
--without-bash-malloc
"
#
# System readline library (comment out it not to be used)
@ -324,8 +319,12 @@ cd ../bash-%{bash_vers}
--enable-arith-for-command \
--enable-array-variables \
--enable-brace-expansion \
--enable-casemod-attributes \
--enable-casemod-expansion \
--enable-command-timing \
--enable-cond-command \
--enable-cond-regexp \
--enable-coprocesses \
--enable-directory-stack \
--enable-dparen-arithmetic \
--enable-extended-glob \
@ -362,21 +361,17 @@ cd ../bash-%{bash_vers}
--disable-strict-posix-default \
--enable-separate-helpfiles=%{_datadir}/bash/helpfiles \
$READLINE
%if %do_profiling
make CFLAGS="$CFLAGS "%cflags_profile_generate bash printenv recho zecho
env -i TERM=$TERM make TESTSCRIPT=%{SOURCE4} check
make clean
make CFLAGS="$CFLAGS "%cflags_profile_feedback
%else
make all printenv recho zecho
env -i TERM=$TERM make TESTSCRIPT=%{SOURCE4} check
%endif
make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_generate"} \
all printenv recho zecho xcase
env -i HOME=$PWD TERM=$TERM LD_LIBRARY_PATH=$LD_LIBRARY_PATH make TESTSCRIPT=%{SOURCE4} check
make %{?do_profiling:CFLAGS="$CFLAGS %cflags_profile_feedback" clean} all
make -C examples/loadables/
make documentation
%install
cd ../readline-%{rl_vers}
make install htmldir=%{_defaultdocdir}/readline DESTDIR=%{buildroot}
make install htmldir=%{_defaultdocdir}/readline \
installdir=%{_defaultdocdir}/readline/examples DESTDIR=%{buildroot}
make install-shared libdir=/%{_lib} linkagedir=%{_libdir} DESTDIR=%{buildroot}
rm -rf %{buildroot}%{_defaultdocdir}/bash
mkdir -p %{buildroot}%{_defaultdocdir}/bash
@ -384,6 +379,8 @@ cd ../readline-%{rl_vers}
chmod 0755 %{buildroot}/%{_lib}/libreadline.so.%{rl_vers}
rm -f %{buildroot}/%{_lib}/libhistory.so.%{rl_vers}*old
rm -f %{buildroot}/%{_lib}/libreadline.so.%{rl_vers}*old
rm -f %{buildroot}/%{_lib}/libhistory.so
rm -f %{buildroot}/%{_lib}/libreadline.so
cd ../bash-%{bash_vers}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/bin
@ -442,9 +439,9 @@ EOF
%postun -n bash-doc
%install_info_delete --info-dir=%{_infodir} %{_infodir}/bash.info.gz
%post -n libreadline5 -p /sbin/ldconfig
%post -n libreadline6 -p /sbin/ldconfig
%postun -n libreadline5 -p /sbin/ldconfig
%postun -n libreadline6 -p /sbin/ldconfig
%post -n readline-doc
%install_info --info-dir=%{_infodir} %{_infodir}/history.info.gz
@ -483,11 +480,11 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_mandir}/man1/rbash.1.gz
%doc %{_defaultdocdir}/bash/
%files -n libreadline5
%files -n libreadline6
%defattr(-,root,root)
/%{_lib}/libhistory.so.5
/%{_lib}/libhistory.so.%{rl_major}
/%{_lib}/libhistory.so.%{rl_vers}
/%{_lib}/libreadline.so.5
/%{_lib}/libreadline.so.%{rl_major}
/%{_lib}/libreadline.so.%{rl_vers}
%files -n readline-devel
@ -506,6 +503,9 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_defaultdocdir}/readline/
%changelog
* Fri Feb 27 2009 werner@suse.de
- Update bash 4.0 to patch level 0
- Update readline 6.0 to patch level 0
* Wed Feb 18 2009 werner@suse.de
- Add readline patch 13
* Fri Jan 30 2009 werner@suse.de

View File

@ -1,63 +0,0 @@
--- 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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd53f4d6c900264b2d2f2c4f29cd4e4e7879da7d370751530c090ede453a8f15
size 8691

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ca925a6e9126e0363d3a1d40c749a792c6d64ba805dd9663c649c37a7658a29
size 1693788

View File

@ -1,14 +1,14 @@
--- shlib/Makefile.in
+++ shlib/Makefile.in 2005-12-09 17:00:46.000000000 +0100
@@ -57,6 +57,7 @@
+++ shlib/Makefile.in 2009-02-27 17:21:24.428797577 +0100
@@ -58,6 +58,7 @@ bindir = @bindir@
libdir = @libdir@
datadir = @datadir@
localedir = $(datadir)/locale
localedir = @localedir@
+linkagedir = $(libdir)
# Support an alternate destination root directory for package building
DESTDIR =
@@ -181,13 +182,13 @@
@@ -182,13 +183,13 @@ installdirs: $(topdir)/support/mkdirs
-$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir)
install: installdirs $(SHLIB_STATUS)
@ -27,7 +27,7 @@
clean mostlyclean: force
--- support/shlib-install
+++ support/shlib-install 2005-12-09 17:05:28.000000000 +0100
+++ support/shlib-install 2009-02-27 17:22:54.688001513 +0100
@@ -3,7 +3,7 @@
# shlib-install - install a shared library and do any necessary host-specific
# post-installation configuration (like ldconfig)
@ -51,7 +51,7 @@
# process options
@@ -23,14 +25,19 @@
@@ -23,14 +25,19 @@ while [ $# -gt 0 ]; do
case "$1" in
-O) shift; host_os="$1"; shift ;;
-d) shift; INSTALLDIR="$1"; shift ;;
@ -71,7 +71,7 @@
# set install target name
LIBNAME="$1"
@@ -48,18 +55,18 @@
@@ -48,18 +55,18 @@ LN="ln -s"
# pre-install
if [ -z "$uninstall" ]; then
@ -95,16 +95,16 @@
fi
# post-install/uninstall
@@ -70,7 +77,7 @@
@@ -71,7 +78,7 @@ fi
case "$host_os" in
hpux*|darwin*|macosx*)
hpux*|darwin*|macosx*|linux*)
if [ -z "$uninstall" ]; then
- chmod 555 ${INSTALLDIR}/${LIBNAME}
+ chmod 555 ${DESTDIR}${INSTALLDIR}/${LIBNAME}
fi ;;
cygwin*)
cygwin*|mingw*)
IMPLIBNAME=`echo ${LIBNAME} \
@@ -108,8 +115,8 @@
@@ -109,8 +116,8 @@ case "$LIBNAME" in
LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]\.[0-9]:\1:'` # libname.dylib
esac
@ -115,7 +115,7 @@
#
# Create symlinks to the installed library. This section is incomplete.
@@ -117,27 +124,27 @@
@@ -118,27 +125,27 @@ INSTALL_LINK2='${echo} cd $INSTALLDIR &&
case "$host_os" in
*linux*)
# libname.so.M -> libname.so.M.N
@ -127,14 +127,14 @@
# libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${LINKAGEDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
- ${echo} cd $INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1
+ ${echo} ln -s ${INSTALLDIR}/$LIBNAME ${DESTDIR}${LINKAGEDIR}/$LINK1
+ ${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1
fi
;;
bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu)
bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|netbsd*)
# libname.so.M -> libname.so.M.N
- ${echo} ${RM} ${INSTALLDIR}/$LINK2
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
@ -148,16 +148,16 @@
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -145,7 +152,7 @@
@@ -146,7 +153,7 @@ bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|
solaris2*|aix4.[2-9]*|osf*|irix[56]*|sysv[45]*|dgux*)
solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|irix[56]*|sysv[45]*|dgux*|interix*)
# libname.so -> libname.so.M
- ${echo} ${RM} ${INSTALLDIR}/$LINK1
+ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -156,19 +163,19 @@
@@ -157,19 +164,19 @@ solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|iri
freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
# libname.so -> libname.so.M
@ -180,7 +180,7 @@
if [ -z "$uninstall" ]; then
eval $INSTALL_LINK1
fi
@@ -177,7 +184,7 @@
@@ -178,7 +185,7 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdao
hpux1*)
# libname.sl -> libname.M

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8bb90b3b3a91efdadb99fee54c91bbdb9218f96e7178e626c2447456538f73b6
size 130

View File

@ -1,9 +1,9 @@
--- lib/readline/display.c
+++ lib/readline/display.c 2006-11-13 16:55:24.000000000 +0100
@@ -665,7 +665,10 @@
+++ lib/readline/display.c 2009-02-27 16:57:28.988001786 +0100
@@ -713,7 +713,10 @@ rl_redisplay ()
inv_lbreaks[++newlines] = temp;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
- lpos -= _rl_col_width (local_prompt, n0, num);
+ {
+ if (local_prompt_len > 0)

View File

@ -1,17 +1,17 @@
--- .pkgextract
+++ .pkgextract 2005-12-09 17:09:26.000000000 +0100
@@ -0,0 +1,5 @@
+tar Oxfj ../readline-5.2-patches.tar.bz2 | patch -p0 -s
+tar Oxfj ../readline-6.0-patches.tar.bz2 | patch -p0 -s
+patch -p2 -s --suffix=".zerotty" < ../readline-4.3-input.dif
+patch -p2 -s --suffix=".wrap" < ../readline-5.2-wrap.patch
+patch -p2 -s --suffix=".wrap" < ../readline-6.0-wrap.patch
+patch -p2 -s --suffix=".conf" < ../readline-5.2-conf.patch
+patch -p0 -s --suffix=".destdir" < ../readline-5.1-destdir.patch
+patch -p0 -s --suffix=".destdir" < ../readline-6.0-destdir.patch
--- Makefile.in
+++ Makefile.in 2005-12-09 17:09:26.000000000 +0100
@@ -220,10 +220,8 @@ maybe-uninstall-headers: uninstall-heade
install: $(INSTALL_TARGETS)
+++ Makefile.in 2009-02-27 17:25:01.076001005 +0100
@@ -222,10 +222,8 @@ uninstall-headers:
maybe-uninstall-headers: uninstall-headers
install-static: installdirs $(STATIC_LIBS) install-headers install-doc
install-static: installdirs $(STATIC_LIBS) install-headers install-doc install-examples
- -$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
$(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
@ -19,7 +19,7 @@
$(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
@@ -246,7 +244,7 @@ uninstall-shared: maybe-uninstall-header
@@ -254,7 +252,7 @@ uninstall-examples: maybe-uninstall-head
install-doc: installdirs
-( if test -d doc ; then \
cd doc && \
@ -29,8 +29,8 @@
uninstall-doc:
--- complete.c
+++ complete.c 2005-12-09 17:11:19.000000000 +0100
@@ -883,7 +883,7 @@ _rl_find_completion_word (fp, dp)
+++ complete.c 2009-02-27 17:25:26.616935393 +0100
@@ -942,7 +942,7 @@ _rl_find_completion_word (fp, dp)
/* We didn't find an unclosed quoted substring upon which to do
completion, so use the word break characters to find the
substring on which to complete. */
@ -39,16 +39,16 @@
{
scan = rl_line_buffer[rl_point];
@@ -1802,7 +1802,7 @@ rl_completion_matches (text, entry_funct
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
@@ -1884,7 +1884,7 @@ rl_completion_matches (text, entry_funct
match_list[1] = (char *)NULL;
_rl_interrupt_immediately++;
- while (string = (*entry_function) (text, matches))
+ while ((string = (*entry_function) (text, matches)))
{
if (matches + 1 == match_list_size)
match_list = (char **)xrealloc
@@ -1853,7 +1853,7 @@ rl_username_completion_function (text, s
@@ -1936,7 +1936,7 @@ rl_username_completion_function (text, s
}
#if defined (HAVE_GETPWENT)
@ -59,7 +59,7 @@
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
--- readline.c
+++ readline.c 2005-12-09 17:09:26.000000000 +0100
@@ -735,7 +735,11 @@ _rl_dispatch_subseq (key, map, got_subse
@@ -767,7 +767,11 @@ _rl_dispatch_subseq (key, map, got_subse
{
/* Special case rl_do_lowercase_version (). */
if (func == rl_do_lowercase_version)
@ -74,7 +74,7 @@
--- readline.h
+++ readline.h 2005-12-09 17:09:26.000000000 +0100
@@ -445,7 +445,7 @@ extern char *rl_filename_completion_func
@@ -448,7 +448,7 @@ extern char *rl_filename_completion_func
extern int rl_completion_mode PARAMS((rl_command_func_t *));
@ -84,19 +84,19 @@
extern void free_undo_list PARAMS((void));
extern int maybe_save_line PARAMS((void));
--- doc/Makefile.in
+++ doc/Makefile.in 2005-12-09 17:09:26.000000000 +0100
@@ -96,7 +96,7 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ
+++ doc/Makefile.in 2009-02-27 17:27:31.104001597 +0100
@@ -98,7 +98,7 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ
$(RM) $@
-${DVIPDF} $<
-all: info dvi html ps text
-all: info dvi html ps text pdf
+all: info html
nodvi: info html text
info: $(INFOOBJ)
xdist: $(DIST_DOCS)
--- doc/readline.3
+++ doc/readline.3 2006-11-13 17:33:27.000000000 +0100
@@ -118,6 +118,14 @@ environment variable. If that variable
@@ -118,6 +118,14 @@ environment variable. If that variable
.IR ~/.inputrc .
If that file does not exist or cannot be read, the ultimate default is
.IR /etc/inputrc .
@ -111,7 +111,7 @@
When a program which uses the readline library starts up, the
init file is read, and the key bindings and variables are set.
There are only a few basic constructs allowed in the
@@ -1270,6 +1278,9 @@ VI Command Mode functions
@@ -1286,6 +1294,9 @@ VI Command Mode functions
.TP
.FN ~/.inputrc
Individual \fBreadline\fP initialization file
@ -123,7 +123,7 @@
Brian Fox, Free Software Foundation
--- support/shobj-conf
+++ support/shobj-conf 2006-09-22 16:17:48.000000000 +0200
@@ -108,10 +108,11 @@ sunos5*|solaris2*)
@@ -112,10 +112,11 @@ sunos5*|solaris2*)
linux*-*|gnu*-*|k*bsd*-gnu-*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
@ -136,4 +136,4 @@
+ SHLIB_LIBS=-lncurses
;;
freebsd2* | netbsd*)
freebsd2*)

3
readline-6.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1d5bf4673464aaf5605a5b4f0d5aa02ef97acafa037b7ffe398b96b1c6283308
size 1905460