OBS User unknown 2009-06-05 20:32:36 +00:00 committed by Git OBS Bridge
parent 8b24d02103
commit 5e51af484b
11 changed files with 146 additions and 177 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22f69b9eac5371c11a8dcc3e09de34a79c9a3d391fa3e7a7c35510255deb68da
size 10179
oid sha256:e787af9b7d2be9f0138d78da3086b37a5c2ff7c33ad19549805bc4cffbb68b2a
size 13552

View File

@ -1,29 +0,0 @@
|> On Wed, Mar 11, 2009 at 09:50:18PM -0400, Matt
|> > rm 2>&1 | grep --color op
|> > rm |& grep --color op
|> >
|> > Notice that they are behaving differently.
|>
|> Confirmed in 4.0.0 and 4.0.10:
|
|Interesting. Only for non-builtin simple commands and some shell functions.
|The attached patch fixes it for me.
|
|Chet
|
*** parse.y 2009-03-09 10:27:05.000000000 -0400
--- parse.y 2009-03-12 09:02:31.000000000 -0400
***************
*** 1123,1127 ****
REDIRECT *r;
! tc = $1;
rd.dest = 1;
r = make_redirection (2, r_duplicating_output, rd);
--- 1123,1127 ----
REDIRECT *r;
! tc = $1->type == cm_simple ? $1->value.Simple : $1;
rd.dest = 1;
r = make_redirection (2, r_duplicating_output, rd);

View File

@ -1,20 +0,0 @@
--- lib/glob/glob.c
+++ lib/glob/glob.c 2009-04-21 10:51:48.478986919 +0000
@@ -96,7 +96,7 @@ int noglob_dot_filenames = 1;
int glob_ignore_case = 0;
/* Global variable to return to signify an error in globbing. */
-char *glob_error_return;
+char *glob_error_return = (char *)NULL;
static struct globval finddirs_error_return;
@@ -356,7 +356,7 @@ finddirs (pat, sdir, flags, ep, np)
*np = 0;
if (ep)
*ep = 0;
- if (r)
+ if (r && r != (char **)&glob_error_return)
free (r);
return (struct globval *)0;
}

View File

@ -1,11 +0,0 @@
--- lib/glob/glob.c
+++ lib/glob/glob.c 2009-04-26 17:22:56.000000000 -0400
@@ -942,7 +942,7 @@
char **array;
register unsigned int l;
- array = glob_dir_to_array (directories[i], temp_results, flags);
+ array = glob_dir_to_array ((dflags & GX_ALLDIRS) ? "" : directories[i], temp_results, flags);
l = 0;
while (array[l] != NULL)
++l;

View File

@ -0,0 +1,99 @@
| Matt Zyzik wrote:
| > All,
| >
| > Previously, the behavior of globstar mimicked that of ksh/zsh for such a
| > command: "ls -adl **/*.cs".
| >
| > Now I've upgraded to Bash 4.0.24 from Bash 4.0.17 and the behavior is
| > different (seemingly incorrect). Previously, the above-mentioned command
| > would list all *.cs files in the current directory and all
| > subdirectories. With the latest Bash, it only lists *.cs files in
| > subdirectories. The *.cs files in the current working directory are
| > ignored.
| >
| > I think this is a bug. Again, "ls -adl **/*.cs" is now _not_ picking up
| > *.cs files in the current working directory.
|
| OK. I finally had some time to look at this.
|
| The issue is that you can't always add a null placeholder for the current
| directory (the original bash-4.0 code) or never add one (patch 24). You
| have to add one in certain circumstances, when it gets handled later in
| the process.
|
| Try the attached patch. It undoes portions of patch 24 and uses a
| different scheme to figure out when to add the null placeholder. It
| seems to work for all cases without any regressions.
|
| Chet
|
*** ../bash-4.0-patched/lib/glob/glob.c 2009-05-22 12:32:26.000000000 -0400
--- lib/glob/glob.c 2009-05-22 12:35:55.000000000 -0400
***************
*** 666,672 ****
}
! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an
! empty directory name. */
! if (add_current && (flags & GX_NULLDIR) == 0)
{
sdlen = strlen (dir);
--- 666,673 ----
}
! /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty
! directory name as a placeholder if GX_NULLDIR (in which case the passed
! directory name is "."). */
! if (add_current)
{
sdlen = strlen (dir);
***************
*** 680,684 ****
nextlink->next = lastlink;
lastlink = nextlink;
! bcopy (dir, nextname, sdlen + 1);
++count;
}
--- 681,688 ----
nextlink->next = lastlink;
lastlink = nextlink;
! if (flags & GX_NULLDIR)
! nextname[0] = '\0';
! else
! bcopy (dir, nextname, sdlen + 1);
++count;
}
***************
*** 1008,1016 ****
/* Just return what glob_vector () returns appended to the
directory name. */
dflags = flags & ~GX_MARKDIRS;
if (directory_len == 0)
dflags |= GX_NULLDIR;
if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
! dflags |= GX_ALLDIRS|GX_ADDCURDIR;
temp_results = glob_vector (filename,
(directory_len == 0 ? "." : directory_name),
--- 1012,1033 ----
/* Just return what glob_vector () returns appended to the
directory name. */
+ /* If flags & GX_ALLDIRS, we're called recursively */
dflags = flags & ~GX_MARKDIRS;
if (directory_len == 0)
dflags |= GX_NULLDIR;
if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
! {
! dflags |= GX_ALLDIRS|GX_ADDCURDIR;
! #if 0
! /* If we want all directories (dflags & GX_ALLDIRS) and we're not
! being called recursively as something like `echo **/*.o'
! ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from
! adding a null directory name to the front of the temp_results
! array. We turn off ADDCURDIR if not called recursively and
! dlen == 0 */
! #endif
! if (directory_len == 0 && (flags & GX_ALLDIRS) == 0)
! dflags &= ~GX_ADDCURDIR;
! }
temp_results = glob_vector (filename,
(directory_len == 0 ? "." : directory_name),

View File

@ -59,6 +59,12 @@
/* Define if you want the case-capitalizing operators (~[~]) and the
`capcase' variable attribute (declare -c). */
@@ -98,3 +98,5 @@
name is not found. If you want to name it something other than the
default ("command_not_found_handle"), change it here. */
/* #define NOTFOUND_HOOK "command_not_found_handle" */
+
+#define eaccess(path,mode) access(path,mode)
--- general.h
+++ general.h 2006-03-27 14:15:25.000000000 +0200
@@ -21,10 +21,13 @@

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Jun 3 12:16:43 CEST 2009 - werner@suse.de
- Enforce the usage of euidaccess(3) instead of stat(2) for testing
permissions for a file (bnc#509105)
-------------------------------------------------------------------
Mon May 25 14:09:03 CEST 2009 - werner@suse.de
- Update to newest patch level 24:
* include last few patches
- Add patches from mailing list for globstar expansion
-------------------------------------------------------------------
Mon May 11 10:18:06 CEST 2009 - werne@suse.de

View File

@ -27,7 +27,7 @@ Recommends: bash-doc = %bash_vers
Suggests: command-not-found
AutoReqProv: on
Version: 4.0
Release: 10
Release: 11
Summary: The GNU Bourne-Again Shell
Url: http://www.gnu.org/software/bash/bash.html
Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bash_vers}.tar.bz2
@ -57,13 +57,8 @@ Patch21: readline-4.3-input.dif
Patch22: readline-6.0-wrap.patch
Patch23: readline-5.2-conf.patch
Patch30: readline-6.0-destdir.patch
Patch40: bash-4.0.10-bar-and-piping.patch
Patch42: bash-4.0.10-typo.patch
Patch43: readline-6.0-redisplay-sigwinch.patch
Patch44: readline-6.0-display-clear-to-eol.patch
Patch45: bash-4.0.17-globstar.dif
Patch46: readline-6.0-promptlen-screenwidth.patch
Patch47: bash-4.0.17-globstar2.patch
Patch40: bash-4.0.10-typo.patch
Patch41: bash-4.0.24-globstar-nulldir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _incdir %{_includedir}
@ -91,7 +86,7 @@ Group: Documentation/Man
Provides: bash:%{_infodir}/bash.info.gz
PreReq: %install_info_prereq
Version: 4.0
Release: 10
Release: 11
AutoReqProv: on
%description -n bash-doc
@ -111,7 +106,7 @@ Summary: The Readline Library
Group: System/Libraries
Provides: bash:/%{_lib}/libreadline.so.%{rl_major}
Version: 6.0
Release: 10
Release: 11
Recommends: readline-doc = %{version}
# bug437293
%ifarch ppc64
@ -140,7 +135,7 @@ Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Provides: bash:%{_libdir}/libreadline.a
Version: 6.0
Release: 10
Release: 11
Requires: libreadline6 = %{version}
Requires: ncurses-devel
Recommends: readline-doc = %{version}
@ -169,7 +164,7 @@ Group: System/Libraries
Provides: readline:%{_infodir}/readline.info.gz
PreReq: %install_info_prereq
Version: 6.0
Release: 10
Release: 11
AutoReqProv: on
%description -n readline-doc
@ -189,6 +184,9 @@ for p in ../bash-%{bash_vers}-patches/*; do
test -e $p || break
echo Patch $p
patch -s -p0 < $p
grep -q '^--- lib/readline/' $p || continue
sed -r '\@^\*\*\*[[:blank:]][^[:blank:]]*patchlevel.h@,\@^\*\*\*[[:blank:]][^[:digit:]]@d' < $p | \
patch -d ../readline-%{rl_vers}/ -s -p2
done
unset p
%patch1 -p0 -b .manual
@ -207,10 +205,8 @@ unset p
%patch21 -p0 -b .zerotty
%patch22 -p0 -b .wrap
%patch23 -p0 -b .conf
%patch40 -p0 -b .pipe
%patch42 -p0 -b .typo
%patch45 -p0 -b .globstar
%patch47 -p0 -b .globstar2
%patch40 -p0 -b .typo
%patch41 -p0 -b .globstar
%patch0 -p0
cd ../readline-%{rl_vers}
for p in ../readline-%{rl_vers}-patches/*; do
@ -222,9 +218,6 @@ done
%patch22 -p2 -b .wrap
%patch23 -p2 -b .conf
%patch30 -p0 -b .destdir
%patch43 -p0 -b .sigwinch
%patch44 -p0 -b .cleartoeol
%patch46 -p0 -b .promptlen
%patch20 -p0
%build
@ -330,6 +323,8 @@ cd ../bash-%{bash_vers}
--infodir=%{_infodir} \
--libdir=%{_libdir} \
--with-curses \
--with-afs \
$SYSMALLOC \
--enable-minimal-config \
--enable-arith-for-command \
--enable-array-variables \
@ -358,6 +353,7 @@ cd ../bash-%{bash_vers}
--infodir=%{_infodir} \
--libdir=%{_libdir} \
--with-curses \
--with-afs \
$SYSMALLOC \
--enable-job-control \
--enable-alias \
@ -496,6 +492,10 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_mandir}/man1/bashbug.1.gz
%doc %{_mandir}/man1/rbash.1.gz
%doc %{_defaultdocdir}/bash/
#%files -n bash-plugins
#%defattr(-,root,root)
#%dir /%{_lib}/bash/%{version}/
#/%{_lib}/bash/%{version}/*.so
%files -n libreadline6
%defattr(-,root,root)
@ -520,6 +520,13 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true
%doc %{_defaultdocdir}/readline/
%changelog
* Wed Jun 03 2009 werner@suse.de
- Enforce the usage of euidaccess(3) instead of stat(2) for testing
permissions for a file (bnc#509105)
* Mon May 25 2009 werner@suse.de
- Update to newest patch level 24:
* include last few patches
- Add patches from mailing list for globstar expansion
* Mon May 11 2009 werne@suse.de
- Increase size of hash table for runtime linker a lot
* Mon Apr 27 2009 werne@suse.de

View File

@ -1,15 +0,0 @@
*** display.c 2009-01-04 14:32:32.000000000 -0500
--- display.c 2009-04-14 14:00:18.000000000 -0400
***************
*** 1773,1777 ****
adjust col_lendiff based on the difference between _rl_last_c_pos
and _rl_screenwidth */
! if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth))
#endif
{
--- 1773,1777 ----
adjust col_lendiff based on the difference between _rl_last_c_pos
and _rl_screenwidth */
! if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
#endif
{

View File

@ -1,30 +0,0 @@
*** display.c
--- display.c 2009-04-25 21:42:18.000000000 -0400
***************
*** 1893,1896 ****
--- 1895,1902 ----
woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
cpos = _rl_last_c_pos;
+
+ if (cpos == 0 && cpos == new)
+ return;
+
#if defined (HANDLE_MULTIBYTE)
/* If we have multibyte characters, NEW is indexed by the buffer point in
***************
*** 1906,1912 ****
desired display position. */
if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
! (prompt_physical_chars > _rl_screenwidth &&
_rl_last_v_pos == prompt_last_screen_line &&
! wrap_offset >= woff &&
new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
/* XXX last comparison might need to be >= */
--- 1912,1918 ----
desired display position. */
if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
! (prompt_physical_chars >= _rl_screenwidth &&
_rl_last_v_pos == prompt_last_screen_line &&
! wrap_offset >= woff && dpos >= woff &&
new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
/* XXX last comparison might need to be >= */

View File

@ -1,51 +0,0 @@
*** readline.h 2009-01-04 14:32:33.000000000 -0500
--- readline.h 2009-04-13 08:47:00.000000000 -0400
***************
*** 815,820 ****
#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
! #define RL_STATE_DONE 0x800000 /* done; accepted line */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
--- 815,821 ----
#define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */
#define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */
+ #define RL_STATE_REDISPLAYING 0x800000 /* updating terminal display */
! #define RL_STATE_DONE 0x1000000 /* done; accepted line */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
*** display.c 2009-01-04 14:32:32.000000000 -0500
--- display.c 2009-04-13 08:29:54.000000000 -0400
***************
*** 513,516 ****
--- 513,517 ----
data structures. */
_rl_block_sigint ();
+ RL_SETSTATE (RL_STATE_REDISPLAYING);
if (!rl_display_prompt)
***************
*** 1237,1240 ****
--- 1238,1242 ----
}
+ RL_UNSETSTATE (RL_STATE_REDISPLAYING);
_rl_release_sigint ();
}
*** terminal.c 2009-01-04 14:32:34.000000000 -0500
--- terminal.c 2009-04-13 08:43:00.000000000 -0400
***************
*** 356,360 ****
if (CUSTOM_REDISPLAY_FUNC ())
rl_forced_update_display ();
! else
_rl_redisplay_after_sigwinch ();
}
--- 356,360 ----
if (CUSTOM_REDISPLAY_FUNC ())
rl_forced_update_display ();
! else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0)
_rl_redisplay_after_sigwinch ();
}