- fix Savannah bug #29949
This commit is contained in:
parent
e1f9543c9d
commit
46e433431a
@ -1,4 +1,4 @@
|
||||
ChangeLog | 85 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
ChangeLog | 83 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
find/defs.h | 14 ++++----
|
||||
find/find.c | 69 +++++--------------------------------
|
||||
find/finddata.c | 12 +-----
|
||||
@ -10,13 +10,13 @@
|
||||
lib/dircallback.c | 36 +++++++++++++++++++-
|
||||
lib/dircallback.h | 5 ++-
|
||||
lib/listfile.c | 2 +-
|
||||
12 files changed, 293 insertions(+), 196 deletions(-)
|
||||
12 files changed, 291 insertions(+), 196 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index 34552d5..f040627 100644
|
||||
index 34552d5..fefc1b8 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,5 +1,90 @@
|
||||
@@ -1,5 +1,88 @@
|
||||
2010-04-10 James Youngman <jay@gnu.org>
|
||||
|
||||
+ Exec predicates now store which directory they want to run in.
|
||||
@ -101,8 +101,6 @@ index 34552d5..f040627 100644
|
||||
+ (starting_dir): Remove declaration of global variable.
|
||||
+ (starting_desc): Remove declaration of global variable.
|
||||
+ * import-gnulib.config (modules): Import module save-cwd.
|
||||
+
|
||||
+2010-04-10 James Youngman <jay@gnu.org>
|
||||
+
|
||||
Add a test which checks $CWD for find -execdir {} +/;
|
||||
* find/testsuite/find.gnu/execdir-multiple.exp: New test; verifies
|
||||
@ -506,7 +504,7 @@ index 3f237eb..b96d317 100644
|
||||
/* Get a timestamp and comparison type.
|
||||
|
||||
diff --git a/find/pred.c b/find/pred.c
|
||||
index 7c34119..9273bba 100644
|
||||
index 7c34119..d057d48 100644
|
||||
--- a/find/pred.c
|
||||
+++ b/find/pred.c
|
||||
@@ -47,6 +47,7 @@
|
||||
@ -572,7 +570,7 @@ index 7c34119..9273bba 100644
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* For the others (-exec, -ok), the parder should
|
||||
+ /* For the others (-exec, -ok), the parser should
|
||||
+ have set wd_for_exec to initial_wd, indicating
|
||||
+ that the exec should take place from find's initial
|
||||
+ working directory.
|
||||
|
@ -1,10 +1,10 @@
|
||||
ChangeLog | 10 ++++++++++
|
||||
NEWS | 13 +++++++++++++
|
||||
NEWS | 15 +++++++++++++++
|
||||
find/ftsfind.c | 37 +++++++++++++++++++------------------
|
||||
3 files changed, 42 insertions(+), 18 deletions(-)
|
||||
3 files changed, 44 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index 555caab..26d4be3 100644
|
||||
index fefc1b8..98d7962 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,5 +1,15 @@
|
||||
@ -24,10 +24,14 @@ index 555caab..26d4be3 100644
|
||||
* lib/dircallback.c (run_in_dirfd): New name for old run_in_dir
|
||||
function.
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 6b8b725..757ffd8 100644
|
||||
index 6b8b725..569ff51 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,3 +1,16 @@
|
||||
@@ -1,5 +1,20 @@
|
||||
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
|
||||
|
||||
+* Major changes in release 4.4.3-git, YYYY-MM-DD
|
||||
+
|
||||
+** Bug Fixes
|
||||
+
|
||||
+#19593: -execdir .... {} + has suboptimal performance (see below)
|
||||
@ -41,9 +45,9 @@ index 6b8b725..757ffd8 100644
|
||||
+arguments, since an exec will occur each time find encounters a
|
||||
+subdirectory (if at least one argument is pending).
|
||||
+
|
||||
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
|
||||
|
||||
* Major changes in release 4.4.2, 2009-11-26
|
||||
|
||||
** Functional Enhancements to find
|
||||
diff --git a/find/ftsfind.c b/find/ftsfind.c
|
||||
index 9945abd..3c9ae1d 100644
|
||||
--- a/find/ftsfind.c
|
||||
|
@ -1,18 +1,19 @@
|
||||
ChangeLog | 20 +++++++++
|
||||
ChangeLog | 21 +++++++++
|
||||
NEWS | 2 +
|
||||
find/pred.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
|
||||
3 files changed, 132 insertions(+), 25 deletions(-)
|
||||
find/pred.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
|
||||
3 files changed, 132 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index b6a0c6c..e796142 100644
|
||||
index 98d7962..8e5d0ce 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,3 +1,23 @@
|
||||
@@ -1,3 +1,24 @@
|
||||
+2010-04-11 James Youngman <jay@gnu.org>
|
||||
+
|
||||
+ Fix Savannah bug #27563, -L breaks -execdir.
|
||||
+ * find/pred.c (initialise_wd_for_exec): New function, factoring
|
||||
+ out part of the body of record_exec_dir.
|
||||
+ * find/pred.c (mdir_name): New function, taken from newer gnulib.
|
||||
+ (initialise_wd_for_exec): New function, factoring out part of the body
|
||||
+ of record_exec_dir.
|
||||
+ (record_exec_dir): If state.rel_pathname contains a /, extract the
|
||||
+ directory part and initialise execp->wd_for_exec to point at that
|
||||
+ directory.
|
||||
@ -32,10 +33,11 @@ index b6a0c6c..e796142 100644
|
||||
|
||||
Fix Savannah bug #19593, -execdir .... {} + has suboptimal performance
|
||||
diff --git a/NEWS b/NEWS
|
||||
index 4dcffa7..7f972eb 100644
|
||||
index 569ff51..c8eb0bc 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,5 +1,7 @@
|
||||
@@ -4,6 +4,8 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
|
||||
|
||||
** Bug Fixes
|
||||
|
||||
+#27563: -L breaks -execdir
|
||||
@ -44,7 +46,7 @@ index 4dcffa7..7f972eb 100644
|
||||
|
||||
** Performance changes
|
||||
diff --git a/find/pred.c b/find/pred.c
|
||||
index 9273bba..cf25184 100644
|
||||
index d057d48..cf25184 100644
|
||||
--- a/find/pred.c
|
||||
+++ b/find/pred.c
|
||||
@@ -504,6 +504,57 @@ pred_empty (const char *pathname, struct stat *stat_buf, struct predicate *pred_
|
||||
@ -164,7 +166,7 @@ index 9273bba..cf25184 100644
|
||||
{
|
||||
/* For -execdir/-okdir predicates, the parser did not fill in
|
||||
the wd_for_exec member of sturct exec_val. So for those
|
||||
@@ -550,15 +618,30 @@ new_impl_pred_exec (const char *pathname,
|
||||
@@ -550,6 +618,18 @@ new_impl_pred_exec (const char *pathname,
|
||||
safely_quote_err_filename (0, pathname));
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
@ -183,10 +185,7 @@ index 9273bba..cf25184 100644
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* For the others (-exec, -ok), the parder should
|
||||
+ /* For the others (-exec, -ok), the parser should
|
||||
have set wd_for_exec to initial_wd, indicating
|
||||
that the exec should take place from find's initial
|
||||
@@ -559,6 +639,9 @@ new_impl_pred_exec (const char *pathname,
|
||||
working directory.
|
||||
*/
|
||||
assert (execp->wd_for_exec == initial_wd);
|
||||
|
@ -1,16 +1,16 @@
|
||||
ChangeLog | 13 +++++++++++++
|
||||
ChangeLog | 11 +++++++++++
|
||||
find/testsuite/Makefile.am | 4 ++++
|
||||
find/testsuite/find.gnu/sv-bug-27563-execdir.exp | 6 ++++++
|
||||
find/testsuite/find.gnu/sv-bug-27563-execdir.xo | 1 +
|
||||
find/testsuite/find.posix/sv-bug-27563-exec.exp | 6 ++++++
|
||||
find/testsuite/find.posix/sv-bug-27563-exec.xo | 1 +
|
||||
6 files changed, 31 insertions(+), 0 deletions(-)
|
||||
6 files changed, 29 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index e796142..f42aa7a 100644
|
||||
index 8e5d0ce..5702e66 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,5 +1,18 @@
|
||||
@@ -1,5 +1,16 @@
|
||||
2010-04-11 James Youngman <jay@gnu.org>
|
||||
|
||||
+ Add a test case for Savannah bug 27563 (-L breaks -execdir).
|
||||
@ -23,14 +23,12 @@ index e796142..f42aa7a 100644
|
||||
+ * find/testsuite/find.posix/sv-bug-27563-exec.exp: New test.
|
||||
+ * find/testsuite/find.gnu/sv-bug-27563-execdir.xo: Expected output.
|
||||
+ * find/testsuite/find.posix/sv-bug-27563-exec.xo: Expected output.
|
||||
+
|
||||
+2010-04-11 James Youngman <jay@gnu.org>
|
||||
+
|
||||
Fix Savannah bug #27563, -L breaks -execdir.
|
||||
* find/pred.c (initialise_wd_for_exec): New function, factoring
|
||||
out part of the body of record_exec_dir.
|
||||
* find/pred.c (mdir_name): New function, taken from newer gnulib.
|
||||
(initialise_wd_for_exec): New function, factoring out part of the body
|
||||
diff --git a/find/testsuite/Makefile.am b/find/testsuite/Makefile.am
|
||||
index 1447132..2e661d9 100644
|
||||
index 1447132..aa32d4b 100644
|
||||
--- a/find/testsuite/Makefile.am
|
||||
+++ b/find/testsuite/Makefile.am
|
||||
@@ -63,6 +63,7 @@ find.gnu/samefile-same.xo \
|
||||
@ -53,7 +51,7 @@ index 1447132..2e661d9 100644
|
||||
find.gnu/sv-bug-17782.exp \
|
||||
find.gnu/sv-bug-18222.exp \
|
||||
find.gnu/sv-bug-24169.exp \
|
||||
+find.gnu/sv-bug-25359-execdir.exp \
|
||||
+find.gnu/sv-bug-27563-execdir.exp \
|
||||
find.gnu/quit.exp \
|
||||
find.gnu/used-invarg.exp \
|
||||
find.gnu/used-missing.exp \
|
||||
@ -61,7 +59,7 @@ index 1447132..2e661d9 100644
|
||||
find.posix/mtime0.exp \
|
||||
find.posix/sv-bug-11175.exp \
|
||||
find.posix/sv-bug-12181.exp \
|
||||
+find.posix/sv-bug-25359-exec.exp \
|
||||
+find.posix/sv-bug-27563-exec.exp \
|
||||
find.posix/depth1.exp \
|
||||
find.posix/sizes.exp \
|
||||
find.posix/name.exp \
|
||||
|
70
findutils-4.5.8-0006-Fix-Savannah-bug-29949.patch
Normal file
70
findutils-4.5.8-0006-Fix-Savannah-bug-29949.patch
Normal file
@ -0,0 +1,70 @@
|
||||
ChangeLog | 9 +++++++++
|
||||
NEWS | 2 ++
|
||||
find/pred.c | 10 ++++------
|
||||
find/testsuite/find.gnu/execdir-multiple.exp | 1 +
|
||||
4 files changed, 16 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index 5702e66..97b1b7c 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,3 +1,12 @@
|
||||
+2010-05-24 Kamil Dudka <kdudka@redhat.com>
|
||||
+
|
||||
+ Fix Savannah bug #29949, -execdir does not change working directory
|
||||
+ * find/pred.c (record_exec_dir): Do not throw the execdir when not
|
||||
+ working in the cumulative mode.
|
||||
+ * find/testsuite/find.gnu/execdir-multiple.exp: Add a test-case for
|
||||
+ the bug #29949.
|
||||
+ * NEWS: Mention this bugfix.
|
||||
+
|
||||
2010-04-11 James Youngman <jay@gnu.org>
|
||||
|
||||
Add a test case for Savannah bug 27563 (-L breaks -execdir).
|
||||
diff --git a/NEWS b/NEWS
|
||||
index c8eb0bc..2ba2111 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -4,6 +4,8 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
|
||||
|
||||
** Bug Fixes
|
||||
|
||||
+#29949: find -execdir does not change working directory
|
||||
+
|
||||
#27563: -L breaks -execdir
|
||||
|
||||
#19593: -execdir .... {} + has suboptimal performance (see below)
|
||||
diff --git a/find/pred.c b/find/pred.c
|
||||
index cf25184..cac74d1 100644
|
||||
--- a/find/pred.c
|
||||
+++ b/find/pred.c
|
||||
@@ -558,13 +558,11 @@ initialise_wd_for_exec (struct exec_val *execp, int cwd_fd, const char *dir)
|
||||
static boolean
|
||||
record_exec_dir (struct exec_val *execp)
|
||||
{
|
||||
- if (!execp->wd_for_exec)
|
||||
+ /* working directory not already known, so must be a *dir variant,
|
||||
+ and this must be the first arg we added. However, this may
|
||||
+ be -execdir foo {} \; (i.e. not multiple). */
|
||||
+ if (!execp->state.todo)
|
||||
{
|
||||
- /* working directory not already known, so must be a *dir variant,
|
||||
- and this must be the first arg we added. However, this may
|
||||
- be -execdir foo {} \; (i.e. not multiple). */
|
||||
- assert (!execp->state.todo);
|
||||
-
|
||||
/* Record the WD. If we're using -L or fts chooses to do so for
|
||||
any other reason, state.cwd_dir_fd may in fact not be the
|
||||
directory containing the target file. When this happens,
|
||||
diff --git a/find/testsuite/find.gnu/execdir-multiple.exp b/find/testsuite/find.gnu/execdir-multiple.exp
|
||||
index 6d4bd66..495b93b 100644
|
||||
--- a/find/testsuite/find.gnu/execdir-multiple.exp
|
||||
+++ b/find/testsuite/find.gnu/execdir-multiple.exp
|
||||
@@ -49,6 +49,7 @@ if { [ safe_path ] } {
|
||||
}
|
||||
|
||||
set SKIP_OLD 1
|
||||
+ find_start p {tmp -type f -empty -execdir sh ./runme \{\} \; } ""
|
||||
find_start p {tmp -type f -empty -execdir sh ./runme \{\} + } ""
|
||||
set SKIP_OLD 0
|
||||
exec rm -rf tmp
|
@ -1,7 +1,7 @@
|
||||
Summary: The GNU versions of find utilities (find and xargs)
|
||||
Name: findutils
|
||||
Version: 4.4.2
|
||||
Release: 7%{?dist}
|
||||
Release: 8%{?dist}
|
||||
Epoch: 1
|
||||
License: GPLv3+
|
||||
Group: Applications/File
|
||||
@ -45,6 +45,9 @@ Patch10: findutils-4.5.8-0004-e1d0a99.patch
|
||||
# backport of upstream commit a1f54022d1913a92ccb728211127d5c238397eb6
|
||||
Patch11: findutils-4.5.8-0005-a1f5402.patch
|
||||
|
||||
# Fix Savannah bug #29949, -execdir does not change working directory
|
||||
Patch12: findutils-4.5.8-0006-Fix-Savannah-bug-29949.patch
|
||||
|
||||
Requires(post): /sbin/install-info
|
||||
Requires(preun): /sbin/install-info
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
@ -76,6 +79,7 @@ useful for finding things on your system.
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
|
||||
autoreconf
|
||||
|
||||
@ -133,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_infodir}/find-maint.info.gz
|
||||
|
||||
%changelog
|
||||
* Tue Jun 01 2010 Kamil Dudka <kdudka@redhat.com> - 1:4.4.2-8
|
||||
- fix Savannah bug #29949
|
||||
|
||||
* Mon May 10 2010 Kamil Dudka <kdudka@redhat.com> - 1:4.4.2-7
|
||||
- backport of patches for upstream bugs #19593 and #27563 (rhbz #493143)
|
||||
- mention -xautofs in the output of --help (#590166)
|
||||
|
Loading…
Reference in New Issue
Block a user