summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/findutils')
-rw-r--r--meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch53
-rw-r--r--meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch23
-rw-r--r--meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch56
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch781
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch294
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch58
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_doc.patch84
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_automake-1.12.patch22
-rw-r--r--meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_x32.patch40
-rw-r--r--meta/recipes-extended/findutils/findutils.inc24
-rw-r--r--meta/recipes-extended/findutils/findutils_4.2.31.bb13
-rw-r--r--meta/recipes-extended/findutils/findutils_4.4.2.bb25
12 files changed, 1473 insertions, 0 deletions
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch b/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
new file mode 100644
index 0000000000..2076e44097
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
@@ -0,0 +1,53 @@
1From 33cba24cba7b0973a702e9627bd5b93962948ae4 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Tue, 17 Sep 2013 16:11:16 +0800
4Subject: [PATCH] findutils: fix doc build error
5
6Upstream-Status: Backport
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 doc/find.texi | 6 +++---
11 1 files changed, 3 insertions(+), 3 deletions(-)
12
13diff --git a/doc/find.texi b/doc/find.texi
14index 5b5f0cf..b3d9c6b 100644
15--- a/doc/find.texi
16+++ b/doc/find.texi
17@@ -63,7 +63,7 @@ translation approved by the Foundation.
18
19 @page
20 @vskip 0pt plus 1filll
21-@insertcopying{}
22+@insertcopying
23 @end titlepage
24
25 @contents
26@@ -1466,6 +1466,7 @@ no output is ever sent to it.
27 * Escapes::
28 * Format Directives::
29 * Time Formats::
30+* Formatting Flags::
31 @end menu
32
33 @node Escapes
34@@ -1534,7 +1535,6 @@ from the novel you are reading.
35 * Size Directives::
36 * Location Directives::
37 * Time Directives::
38-* Formatting Flags::
39 @end menu
40
41 @node Name Directives
42@@ -1780,7 +1780,7 @@ setting the TZ environment variable). This is a GNU extension.
43 @end table
44
45 @node Formatting Flags
46-@subsubsection Formatting Flags
47+@subsection Formatting Flags
48
49 The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
50 and @samp{+} flags, but the other directives do not, even if they
51--
521.7.4.1
53
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch b/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000000..2d0ddb43f5
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
@@ -0,0 +1,23 @@
1Upstream-Status: Pending
2
3automake 1.12 has depricated automatic de-ANSI-fication support
4
5this patch avoids these kinds of errors:
6
7| configure.in:75: error: automatic de-ANSI-fication support has been removed
8
9Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
102012/05/04
11
12Index: findutils-4.2.31/configure.in
13===================================================================
14--- findutils-4.2.31.orig/configure.in
15+++ findutils-4.2.31/configure.in
16@@ -72,7 +72,6 @@ dnl gl_EARLY calls AC_GNU_SOURCE anyway.
17
18
19 AC_ISC_POSIX
20-AM_C_PROTOTYPES
21
22 AC_PROG_INSTALL
23 AC_PROG_RANLIB
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
new file mode 100644
index 0000000000..65bd64277c
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Inappropriate [legacy version]
2
3the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
4
5against 4.2.31
607/08/2010 - qhe
7
8diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
9index 143a9e5..0f27ceb 100644
10--- a/gnulib/m4/extensions.m4
11+++ b/gnulib/m4/extensions.m4
12@@ -12,44 +12,6 @@
13 # enough in this area it's likely we'll need to redefine
14 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
15
16-# AC_USE_SYSTEM_EXTENSIONS
17-# ------------------------
18-# Enable extensions on systems that normally disable them,
19-# typically due to standards-conformance issues.
20-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
21-[
22- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
23- AC_BEFORE([$0], [AC_RUN_IFELSE])
24-
25- AC_REQUIRE([AC_GNU_SOURCE])
26- AC_REQUIRE([AC_AIX])
27- AC_REQUIRE([AC_MINIX])
28-
29- AH_VERBATIM([__EXTENSIONS__],
30-[/* Enable extensions on Solaris. */
31-#ifndef __EXTENSIONS__
32-# undef __EXTENSIONS__
33-#endif
34-#ifndef _POSIX_PTHREAD_SEMANTICS
35-# undef _POSIX_PTHREAD_SEMANTICS
36-#endif
37-#ifndef _TANDEM_SOURCE
38-# undef _TANDEM_SOURCE
39-#endif])
40- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
41- [ac_cv_safe_to_define___extensions__],
42- [AC_COMPILE_IFELSE(
43- [AC_LANG_PROGRAM([
44-# define __EXTENSIONS__ 1
45- AC_INCLUDES_DEFAULT])],
46- [ac_cv_safe_to_define___extensions__=yes],
47- [ac_cv_safe_to_define___extensions__=no])])
48- test $ac_cv_safe_to_define___extensions__ = yes &&
49- AC_DEFINE([__EXTENSIONS__])
50- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
51- AC_DEFINE([_TANDEM_SOURCE])
52-])
53-
54 # gl_USE_SYSTEM_EXTENSIONS
55 # ------------------------
56 # Enable extensions on systems that normally disable them,
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch b/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch
new file mode 100644
index 0000000000..69c1486cf7
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/01-27017.patch
@@ -0,0 +1,781 @@
1Upstream-Status: Backport
2
3commit af974034b68bf59337c7a384e488a518a77dfecd
4Author: James Youngman <jay@gnu.org>
5Date: Sat Jul 11 19:55:27 2009 +0100
6
7 Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit coredump.
8
9 Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit
10 coredumps.
11 * find/tree.c (set_new_parent): Initialise struct
12 predicate->arg_text to NULL (instead of leaving it uninitialised).
13 (get_new_pred_noarg): Likewise.
14 (get_new_pred): Initialise predicate->arg_text to
15 "ThisShouldBeSetToSomethingElse" to make it easier to notice
16 bugs.
17 (get_new_pred_chk_op): Use get_new_pred_noarg.
18 (print_predicate): Use an if statement instead of
19 two ternary operators.
20 * find/util.c (insert_primary_withpred): Accept new argument, arg,
21 being the argument (if any) of this predicate. Pass it to
22 get_new_pred_chk_op.
23 (insert_primary): Likewise (pass arg to insert_primary_withpred).
24 (insert_primary_noarg): New function; calls insert_primary with
25 arg=NULL.
26 * find/parser.c (collect_arg_stat_info): Add an output parameter;
27 the filename from which we collected the stat information.
28 (parse_closeparen, parse_delete, parse_and, parse_or,
29 parse_comma): Use get_new_pred_noarg.
30 (parse_cnewer, parse_newer, parse_anewer): Use new
31 collect_arg_stat_info and insert_primary interface.
32 (parse_print, parse_prune, parse_nouser, parse_empty): Use
33 insert_primary_noarg.
34 (parse_accesscheck, parse_false): Use insert_primary_noarg.
35 (parse_used, parse_iname, parse_fprint, insert_fprint,
36 parse_fstype, parse_ilname): Use new collect_arg and
37 insert_primary interfaces.
38 (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path,
39 parse_perm, parse_size, parse_user, parse_time): Use new
40 collect_arg and insert_primary_withpred interface.
41 (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface.
42 (parse_newerXY, parse_nogroup): Use new insert_primary interface.
43 (insert_regex, parse_samefile): Use new insert_primary_withpred
44 interface.
45 (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use
46 new insert_primary_withpred interface.
47 * find/defs.h (struct predicate.arg_text): make const.
48 Add declarations for new function get_new_pred_noarg and
49 insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op
50 and insert_primary_withpred.
51
52diff --git a/ChangeLog b/ChangeLog
53index 6e346b8..e8ba0f8 100644
54--- a/ChangeLog
55+++ b/ChangeLog
56@@ -1,0 +1,45 @@
57+2009-07-11 James Youngman <jay@gnu.org>
58+
59+ Fix Savannah bug #27017: find -D opt / -fstype ext3 -print , -quit
60+ coredumps.
61+ * find/tree.c (set_new_parent): Initialise struct
62+ predicate->arg_text to NULL (instead of leaving it uninitialised).
63+ (get_new_pred_noarg): Likewise.
64+ (get_new_pred): Initialise predicate->arg_text to
65+ "ThisShouldBeSetToSomethingElse" to make it easier to notice
66+ bugs.
67+ (get_new_pred_chk_op): Use get_new_pred_noarg.
68+ (print_predicate): Use an if statement instead of
69+ two ternary operators.
70+ * find/util.c (insert_primary_withpred): Accept new argument, arg,
71+ being the argument (if any) of this predicate. Pass it to
72+ get_new_pred_chk_op.
73+ (insert_primary): Likewise (pass arg to insert_primary_withpred).
74+ (insert_primary_noarg): New function; calls insert_primary with
75+ arg=NULL.
76+ * find/parser.c (collect_arg_stat_info): Add an output parameter;
77+ the filename from which we collected the stat information.
78+ (parse_closeparen, parse_delete, parse_and, parse_or,
79+ parse_comma): Use get_new_pred_noarg.
80+ (parse_cnewer, parse_newer, parse_anewer): Use new
81+ collect_arg_stat_info and insert_primary interface.
82+ (parse_print, parse_prune, parse_nouser, parse_empty): Use
83+ insert_primary_noarg.
84+ (parse_accesscheck, parse_false): Use insert_primary_noarg.
85+ (parse_used, parse_iname, parse_fprint, insert_fprint,
86+ parse_fstype, parse_ilname): Use new collect_arg and
87+ insert_primary interfaces.
88+ (parse_ipath, parse_lname, do_parse_xmin, parse_name, parse_path,
89+ parse_perm, parse_size, parse_user, parse_time): Use new
90+ collect_arg and insert_primary_withpred interface.
91+ (parse_negate, parse_openparen): Use new get_new_pred_chk_op interface.
92+ (parse_newerXY, parse_nogroup): Use new insert_primary interface.
93+ (insert_regex, parse_samefile): Use new insert_primary_withpred
94+ interface.
95+ (insert_type, insert_fprintf, new_insert_exec_ok, insert_num): Use
96+ new insert_primary_withpred interface.
97+ * find/defs.h (struct predicate.arg_text): make const.
98+ Add declarations for new function get_new_pred_noarg and
99+ insert_primary_noarg. Add 'arg' parameter to get_new_pred_chk_op
100+ and insert_primary_withpred.
101+
102diff --git a/find/defs.h b/find/defs.h
103index 1708d83..4539fd9 100644
104--- a/find/defs.h
105+++ b/find/defs.h
106@@ -297,7 +297,7 @@ struct predicate
107 boolean artificial;
108
109 /* The raw text of the argument of this predicate. */
110- char *arg_text;
111+ const char *arg_text;
112
113 /* Information needed by the predicate processor.
114 Next to each member are listed the predicates that use it. */
115@@ -480,13 +480,16 @@ void show_success_rates(const struct predicate *node);
116 /* tree.c */
117 struct predicate * build_expression_tree PARAMS((int argc, char *argv[], int end_of_leading_options));
118 struct predicate * get_eval_tree PARAMS((void));
119+struct predicate *get_new_pred_noarg (const struct parser_table *entry);
120 struct predicate *get_new_pred PARAMS((const struct parser_table *entry));
121-struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry));
122+struct predicate *get_new_pred_chk_op PARAMS((const struct parser_table *entry,
123+ const char *arg));
124 float calculate_derived_rates PARAMS((struct predicate *p));
125
126 /* util.c */
127-struct predicate *insert_primary PARAMS((const struct parser_table *entry));
128-struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr));
129+struct predicate *insert_primary PARAMS((const struct parser_table *entry, const char *arg));
130+struct predicate *insert_primary_noarg PARAMS((const struct parser_table *entry));
131+struct predicate *insert_primary_withpred PARAMS((const struct parser_table *entry, PRED_FUNC fptr, const char *arg));
132 void usage PARAMS((FILE *fp, int status, char *msg));
133 extern boolean check_nofollow(void);
134 void complete_pending_execs(struct predicate *p);
135diff --git a/find/parser.c b/find/parser.c
136index 534b670..2e6b989 100644
137--- a/find/parser.c
138+++ b/find/parser.c
139@@ -640,11 +640,13 @@ collect_arg(char **argv, int *arg_ptr, const char **collected_arg)
140 }
141
142 static boolean
143-collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p)
144+collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p,
145+ const char **argument)
146 {
147 const char *filename;
148 if (collect_arg(argv, arg_ptr, &filename))
149 {
150+ *argument = filename;
151 if (0 == (options.xstat)(filename, p))
152 {
153 return true;
154@@ -656,6 +658,7 @@ collect_arg_stat_info(char **argv, int *arg_ptr, struct stat *p)
155 }
156 else
157 {
158+ *argument = NULL;
159 return false;
160 }
161 }
162@@ -679,7 +682,7 @@ parse_and (const struct parser_table* entry, char **argv, int *arg_ptr)
163 (void) argv;
164 (void) arg_ptr;
165
166- our_pred = get_new_pred (entry);
167+ our_pred = get_new_pred_noarg (entry);
168 our_pred->pred_func = pred_and;
169 our_pred->p_type = BI_OP;
170 our_pred->p_prec = AND_PREC;
171@@ -691,11 +694,12 @@ static boolean
172 parse_anewer (const struct parser_table* entry, char **argv, int *arg_ptr)
173 {
174 struct stat stat_newer;
175+ const char *arg;
176
177 set_stat_placeholders(&stat_newer);
178- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
179+ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
180 {
181- struct predicate *our_pred = insert_primary (entry);
182+ struct predicate *our_pred = insert_primary (entry, arg);
183 our_pred->args.reftime.xval = XVAL_ATIME;
184 our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
185 our_pred->args.reftime.kind = COMP_GT;
186@@ -713,7 +717,7 @@ parse_closeparen (const struct parser_table* entry, char **argv, int *arg_ptr)
187 (void) argv;
188 (void) arg_ptr;
189
190- our_pred = get_new_pred (entry);
191+ our_pred = get_new_pred_noarg (entry);
192 our_pred->pred_func = pred_closeparen;
193 our_pred->p_type = CLOSE_PAREN;
194 our_pred->p_prec = NO_PREC;
195@@ -725,11 +729,12 @@ static boolean
196 parse_cnewer (const struct parser_table* entry, char **argv, int *arg_ptr)
197 {
198 struct stat stat_newer;
199+ const char *arg;
200
201 set_stat_placeholders(&stat_newer);
202- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
203+ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
204 {
205- struct predicate *our_pred = insert_primary (entry);
206+ struct predicate *our_pred = insert_primary (entry, arg);
207 our_pred->args.reftime.xval = XVAL_CTIME; /* like -newercm */
208 our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
209 our_pred->args.reftime.kind = COMP_GT;
210@@ -747,7 +752,7 @@ parse_comma (const struct parser_table* entry, char **argv, int *arg_ptr)
211 (void) argv;
212 (void) arg_ptr;
213
214- our_pred = get_new_pred (entry);
215+ our_pred = get_new_pred_noarg (entry);
216 our_pred->pred_func = pred_comma;
217 our_pred->p_type = BI_OP;
218 our_pred->p_prec = COMMA_PREC;
219@@ -786,7 +791,7 @@ parse_delete (const struct parser_table* entry, char *argv[], int *arg_ptr)
220 (void) argv;
221 (void) arg_ptr;
222
223- our_pred = insert_primary (entry);
224+ our_pred = insert_primary_noarg (entry);
225 our_pred->side_effects = our_pred->no_default_print = true;
226 /* -delete implies -depth */
227 options.do_dir_first = false;
228@@ -831,7 +836,7 @@ parse_empty (const struct parser_table* entry, char **argv, int *arg_ptr)
229 (void) argv;
230 (void) arg_ptr;
231
232- our_pred = insert_primary (entry);
233+ our_pred = insert_primary_noarg (entry);
234 our_pred->est_success_rate = 0.01f; /* assume 1% of files are empty. */
235 return true;
236 }
237@@ -856,7 +861,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr)
238 (void) argv;
239 (void) arg_ptr;
240
241- our_pred = insert_primary (entry);
242+ our_pred = insert_primary_noarg (entry);
243 our_pred->need_stat = our_pred->need_type = false;
244 our_pred->side_effects = our_pred->no_default_print = false;
245 our_pred->est_success_rate = 0.0f;
246@@ -866,7 +871,7 @@ parse_false (const struct parser_table* entry, char **argv, int *arg_ptr)
247 static boolean
248 insert_fls (const struct parser_table* entry, const char *filename)
249 {
250- struct predicate *our_pred = insert_primary (entry);
251+ struct predicate *our_pred = insert_primary_noarg (entry);
252 if (filename)
253 open_output_file (filename, &our_pred->args.printf_vec);
254 else
255@@ -899,7 +904,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr)
256 const char *filename;
257 if (collect_arg(argv, arg_ptr, &filename))
258 {
259- our_pred = insert_primary (entry);
260+ our_pred = insert_primary (entry, filename);
261 open_output_file (filename, &our_pred->args.printf_vec);
262 our_pred->side_effects = our_pred->no_default_print = true;
263 our_pred->need_stat = our_pred->need_type = false;
264@@ -915,7 +920,7 @@ parse_fprint (const struct parser_table* entry, char **argv, int *arg_ptr)
265 static boolean
266 insert_fprint(const struct parser_table* entry, const char *filename)
267 {
268- struct predicate *our_pred = insert_primary (entry);
269+ struct predicate *our_pred = insert_primary (entry, filename);
270 if (filename)
271 open_output_file (filename, &our_pred->args.printf_vec);
272 else
273@@ -960,7 +965,7 @@ parse_fstype (const struct parser_table* entry, char **argv, int *arg_ptr)
274 const char *typename;
275 if (collect_arg(argv, arg_ptr, &typename))
276 {
277- struct predicate *our_pred = insert_primary (entry);
278+ struct predicate *our_pred = insert_primary (entry, typename);
279 our_pred->args.str = typename;
280
281 /* This is an expensive operation, so although there are
282@@ -1090,7 +1095,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
283 return false;
284 }
285 }
286- our_pred = insert_primary (entry);
287+ our_pred = insert_primary (entry, groupname);
288 our_pred->args.gid = gid;
289 our_pred->est_success_rate = (our_pred->args.numinfo.l_val < 100) ? 0.99 : 0.2;
290 return true;
291@@ -1160,7 +1165,7 @@ parse_ilname (const struct parser_table* entry, char **argv, int *arg_ptr)
292 const char *name;
293 if (collect_arg(argv, arg_ptr, &name))
294 {
295- struct predicate *our_pred = insert_primary (entry);
296+ struct predicate *our_pred = insert_primary (entry, name);
297 our_pred->args.str = name;
298 /* Use the generic glob pattern estimator to figure out how many
299 * links will match, but bear in mind that most files won't be links.
300@@ -1227,7 +1232,7 @@ parse_iname (const struct parser_table* entry, char **argv, int *arg_ptr)
301 {
302 if (check_name_arg("-iname", name))
303 {
304- struct predicate *our_pred = insert_primary (entry);
305+ struct predicate *our_pred = insert_primary (entry, name);
306 our_pred->need_stat = our_pred->need_type = false;
307 our_pred->args.str = name;
308 our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
309@@ -1268,7 +1273,7 @@ parse_ipath (const struct parser_table* entry, char **argv, int *arg_ptr)
310 fnmatch_sanitycheck ();
311 if (collect_arg (argv, arg_ptr, &name))
312 {
313- struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath);
314+ struct predicate *our_pred = insert_primary_withpred (entry, pred_ipath, name);
315 our_pred->need_stat = our_pred->need_type = false;
316 our_pred->args.str = name;
317 our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
318@@ -1316,7 +1321,7 @@ parse_lname (const struct parser_table* entry, char **argv, int *arg_ptr)
319 fnmatch_sanitycheck();
320 if (collect_arg(argv, arg_ptr, &name))
321 {
322- struct predicate *our_pred = insert_primary (entry);
323+ struct predicate *our_pred = insert_primary (entry, name);
324 our_pred->args.str = name;
325 our_pred->est_success_rate = 0.1 * estimate_pattern_match_rate(name, 0);
326 return true;
327@@ -1391,7 +1396,7 @@ do_parse_xmin (const struct parser_table* entry,
328 "arithmetic overflow while converting %s "
329 "minutes to a number of seconds"))
330 {
331- struct predicate *our_pred = insert_primary (entry);
332+ struct predicate *our_pred = insert_primary (entry, minutes);
333 our_pred->args.reftime = tval;
334 our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
335 return true;
336@@ -1427,7 +1432,7 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
337 fnmatch_sanitycheck();
338 if (check_name_arg("-name", name))
339 {
340- struct predicate *our_pred = insert_primary (entry);
341+ struct predicate *our_pred = insert_primary (entry, name);
342 our_pred->need_stat = our_pred->need_type = false;
343 our_pred->args.str = name;
344 our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
345@@ -1445,7 +1450,7 @@ parse_negate (const struct parser_table* entry, char **argv, int *arg_ptr)
346 (void) &argv;
347 (void) &arg_ptr;
348
349- our_pred = get_new_pred_chk_op (entry);
350+ our_pred = get_new_pred_chk_op (entry, NULL);
351 our_pred->pred_func = pred_negate;
352 our_pred->p_type = UNI_OP;
353 our_pred->p_prec = NEGATE_PREC;
354@@ -1458,11 +1463,12 @@ parse_newer (const struct parser_table* entry, char **argv, int *arg_ptr)
355 {
356 struct predicate *our_pred;
357 struct stat stat_newer;
358+ const char *arg;
359
360 set_stat_placeholders(&stat_newer);
361- if (collect_arg_stat_info(argv, arg_ptr, &stat_newer))
362+ if (collect_arg_stat_info(argv, arg_ptr, &stat_newer, &arg))
363 {
364- our_pred = insert_primary (entry);
365+ our_pred = insert_primary (entry, arg);
366 our_pred->args.reftime.ts = get_stat_mtime(&stat_newer);
367 our_pred->args.reftime.xval = XVAL_MTIME;
368 our_pred->args.reftime.kind = COMP_GT;
369@@ -1530,7 +1536,7 @@ parse_newerXY (const struct parser_table* entry, char **argv, int *arg_ptr)
370 (*arg_ptr)++;
371 }
372
373- our_pred = insert_primary (entry);
374+ our_pred = insert_primary (entry, argv[*arg_ptr]);
375
376
377 switch (x)
378@@ -1623,7 +1629,7 @@ parse_nogroup (const struct parser_table* entry, char **argv, int *arg_ptr)
379 (void) &argv;
380 (void) &arg_ptr;
381
382- our_pred = insert_primary (entry);
383+ our_pred = insert_primary (entry, NULL);
384 our_pred->est_success_rate = 1e-4;
385 #ifdef CACHE_IDS
386 if (gid_unused == NULL)
387@@ -1660,7 +1666,7 @@ parse_nouser (const struct parser_table* entry, char **argv, int *arg_ptr)
388 (void) arg_ptr;
389
390
391- our_pred = insert_primary (entry);
392+ our_pred = insert_primary_noarg (entry);
393 our_pred->est_success_rate = 1e-3;
394 #ifdef CACHE_IDS
395 if (uid_unused == NULL)
396@@ -1716,7 +1722,7 @@ parse_openparen (const struct parser_table* entry, char **argv, int *arg_ptr)
397 (void) argv;
398 (void) arg_ptr;
399
400- our_pred = get_new_pred_chk_op (entry);
401+ our_pred = get_new_pred_chk_op (entry, NULL);
402 our_pred->pred_func = pred_openparen;
403 our_pred->p_type = OPEN_PAREN;
404 our_pred->p_prec = NO_PREC;
405@@ -1732,7 +1738,7 @@ parse_or (const struct parser_table* entry, char **argv, int *arg_ptr)
406 (void) argv;
407 (void) arg_ptr;
408
409- our_pred = get_new_pred (entry);
410+ our_pred = get_new_pred_noarg (entry);
411 our_pred->pred_func = pred_or;
412 our_pred->p_type = BI_OP;
413 our_pred->p_prec = OR_PREC;
414@@ -1756,7 +1762,7 @@ parse_path (const struct parser_table* entry, char **argv, int *arg_ptr)
415 const char *name;
416 if (collect_arg(argv, arg_ptr, &name))
417 {
418- struct predicate *our_pred = insert_primary_withpred (entry, pred_path);
419+ struct predicate *our_pred = insert_primary_withpred (entry, pred_path, name);
420 our_pred->need_stat = our_pred->need_type = false;
421 our_pred->args.str = name;
422 our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
423@@ -1894,7 +1900,7 @@ parse_perm (const struct parser_table* entry, char **argv, int *arg_ptr)
424 rate = 0.9986; /* probably matches anything but a broken symlink */
425 }
426
427- our_pred = insert_primary (entry);
428+ our_pred = insert_primary (entry, perm_expr);
429 our_pred->est_success_rate = rate;
430 if (havekind)
431 {
432@@ -1928,7 +1934,7 @@ parse_print (const struct parser_table* entry, char **argv, int *arg_ptr)
433 (void) argv;
434 (void) arg_ptr;
435
436- our_pred = insert_primary (entry);
437+ our_pred = insert_primary_noarg (entry);
438 /* -print has the side effect of printing. This prevents us
439 from doing undesired multiple printing when the user has
440 already specified -print. */
441@@ -1981,7 +1987,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr)
442 (void) argv;
443 (void) arg_ptr;
444
445- our_pred = insert_primary (entry);
446+ our_pred = insert_primary_noarg (entry);
447 if (options.do_dir_first == false)
448 our_pred->need_stat = our_pred->need_type = false;
449 /* -prune has a side effect that it does not descend into
450@@ -1994,7 +2000,7 @@ parse_prune (const struct parser_table* entry, char **argv, int *arg_ptr)
451 static boolean
452 parse_quit (const struct parser_table* entry, char **argv, int *arg_ptr)
453 {
454- struct predicate *our_pred = insert_primary (entry);
455+ struct predicate *our_pred = insert_primary_noarg (entry);
456 (void) argv;
457 (void) arg_ptr;
458 our_pred->need_stat = our_pred->need_type = false;
459@@ -2036,7 +2042,7 @@ insert_regex (char **argv,
460 {
461 struct re_pattern_buffer *re;
462 const char *error_message;
463- struct predicate *our_pred = insert_primary_withpred (entry, pred_regex);
464+ struct predicate *our_pred = insert_primary_withpred (entry, pred_regex, rx);
465 our_pred->need_stat = our_pred->need_type = false;
466 re = xmalloc (sizeof (struct re_pattern_buffer));
467 our_pred->args.regex = re;
468@@ -2061,6 +2067,7 @@ static boolean
469 parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
470 {
471 struct predicate *our_pred;
472+ char *arg;
473 uintmax_t num;
474 char suffix;
475 enum comparison_type c_type;
476@@ -2073,42 +2080,43 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
477 */
478 if ((argv == NULL) || (argv[*arg_ptr] == NULL))
479 return false;
480+ arg = argv[*arg_ptr];
481
482- len = strlen (argv[*arg_ptr]);
483+ len = strlen (arg);
484 if (len == 0)
485 error (1, 0, _("invalid null argument to -size"));
486
487- suffix = argv[*arg_ptr][len - 1];
488+ suffix = arg[len - 1];
489 switch (suffix)
490 {
491 case 'b':
492 blksize = 512;
493- argv[*arg_ptr][len - 1] = '\0';
494+ arg[len - 1] = '\0';
495 break;
496
497 case 'c':
498 blksize = 1;
499- argv[*arg_ptr][len - 1] = '\0';
500+ arg[len - 1] = '\0';
501 break;
502
503 case 'k':
504 blksize = 1024;
505- argv[*arg_ptr][len - 1] = '\0';
506+ arg[len - 1] = '\0';
507 break;
508
509 case 'M': /* Megabytes */
510 blksize = 1024*1024;
511- argv[*arg_ptr][len - 1] = '\0';
512+ arg[len - 1] = '\0';
513 break;
514
515 case 'G': /* Gigabytes */
516 blksize = 1024*1024*1024;
517- argv[*arg_ptr][len - 1] = '\0';
518+ arg[len - 1] = '\0';
519 break;
520
521 case 'w':
522 blksize = 2;
523- argv[*arg_ptr][len - 1] = '\0';
524+ arg[len - 1] = '\0';
525 break;
526
527 case '0':
528@@ -2127,14 +2135,14 @@ parse_size (const struct parser_table* entry, char **argv, int *arg_ptr)
529 error (1, 0, _("invalid -size type `%c'"), argv[*arg_ptr][len - 1]);
530 }
531 /* TODO: accept fractional megabytes etc. ? */
532- if (!get_num (argv[*arg_ptr], &num, &c_type))
533+ if (!get_num (arg, &num, &c_type))
534 {
535 error(1, 0,
536 _("Invalid argument `%s%c' to -size"),
537- argv[*arg_ptr], (int)suffix);
538+ arg, (int)suffix);
539 return false;
540 }
541- our_pred = insert_primary (entry);
542+our_pred = insert_primary (entry, arg);
543 our_pred->args.size.kind = c_type;
544 our_pred->args.size.blocksize = blksize;
545 our_pred->args.size.size = num;
546@@ -2162,9 +2170,10 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
547 struct predicate *our_pred;
548 struct stat st, fst;
549 int fd, openflags;
550+ const char *filename;
551
552 set_stat_placeholders(&st);
553- if (!collect_arg_stat_info(argv, arg_ptr, &st))
554+ if (!collect_arg_stat_info(argv, arg_ptr, &st, &filename))
555 return false;
556
557 set_stat_placeholders(&fst);
558@@ -2289,7 +2298,7 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
559 }
560 }
561
562- our_pred = insert_primary (entry);
563+ our_pred = insert_primary (entry, filename);
564 our_pred->args.samefileid.ino = st.st_ino;
565 our_pred->args.samefileid.dev = st.st_dev;
566 our_pred->args.samefileid.fd = fd;
567@@ -2350,7 +2359,7 @@ parse_true (const struct parser_table* entry, char **argv, int *arg_ptr)
568 (void) argv;
569 (void) arg_ptr;
570
571- our_pred = insert_primary (entry);
572+ our_pred = insert_primary_noarg (entry);
573 our_pred->need_stat = our_pred->need_type = false;
574 our_pred->est_success_rate = 1.0f;
575 return true;
576@@ -2369,7 +2378,7 @@ parse_accesscheck (const struct parser_table* entry, char **argv, int *arg_ptr)
577 struct predicate *our_pred;
578 (void) argv;
579 (void) arg_ptr;
580- our_pred = insert_primary (entry);
581+ our_pred = insert_primary_noarg (entry);
582 our_pred->need_stat = our_pred->need_type = false;
583 our_pred->side_effects = our_pred->no_default_print = false;
584 if (pred_is(our_pred, pred_executable))
585@@ -2414,7 +2423,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr)
586 struct timespec zero = {0,0};
587 if (get_relative_timestamp(offset_str, &tval, zero, DAYSECS, errmsg))
588 {
589- our_pred = insert_primary (entry);
590+ our_pred = insert_primary (entry, offset_str);
591 our_pred->args.reftime = tval;
592 our_pred->est_success_rate = estimate_file_age_success_rate(tval.ts.tv_sec / DAYSECS);
593 return true;
594@@ -2472,7 +2481,7 @@ parse_user (const struct parser_table* entry, char **argv, int *arg_ptr)
595 return false;
596 }
597 }
598- our_pred = insert_primary (entry);
599+ our_pred = insert_primary (entry, username);
600 our_pred->args.uid = uid;
601 our_pred->est_success_rate = (our_pred->args.uid < 100) ? 0.99 : 0.2;
602 return true;
603@@ -2650,7 +2659,7 @@ insert_type (char **argv, int *arg_ptr,
604 error(1, 0, _("Unknown argument to -type: %c"), (*typeletter));
605 return false;
606 }
607- our_pred = insert_primary_withpred (entry, which_pred);
608+ our_pred = insert_primary_withpred (entry, which_pred, typeletter);
609 our_pred->est_success_rate = rate;
610
611 /* Figure out if we will need to stat the file, because if we don't
612@@ -2706,7 +2715,7 @@ insert_fprintf (struct format_val *vec,
613 struct segment **segmentp; /* Address of current segment. */
614 struct predicate *our_pred;
615
616- our_pred = insert_primary_withpred (entry, func);
617+ our_pred = insert_primary_withpred (entry, func, format_const);
618 our_pred->side_effects = our_pred->no_default_print = true;
619 our_pred->args.printf_vec = *vec;
620 our_pred->need_type = false;
621@@ -3045,7 +3054,7 @@ new_insert_exec_ok (const char *action,
622 if ((argv == NULL) || (argv[*arg_ptr] == NULL))
623 return false;
624
625- our_pred = insert_primary_withpred (entry, func);
626+ our_pred = insert_primary_withpred (entry, func, "(some -exec* arguments)");
627 our_pred->side_effects = our_pred->no_default_print = true;
628 our_pred->need_type = our_pred->need_stat = false;
629
630@@ -3374,7 +3383,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
631 if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg))
632 return false;
633
634- our_pred = insert_primary (entry);
635+ our_pred = insert_primary (entry, orig_timearg);
636 our_pred->args.reftime = tval;
637 our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
638
639@@ -3487,7 +3496,7 @@ insert_num (char **argv, int *arg_ptr, const struct parser_table *entry)
640
641 if (get_num (numstr, &num, &c_type))
642 {
643- struct predicate *our_pred = insert_primary (entry);
644+ struct predicate *our_pred = insert_primary (entry, numstr);
645 our_pred->args.numinfo.kind = c_type;
646 our_pred->args.numinfo.l_val = num;
647
648diff --git a/find/tree.c b/find/tree.c
649index 7420c60..60a0601 100644
650--- a/find/tree.c
651+++ b/find/tree.c
652@@ -269,10 +269,14 @@ predicate_is_cost_free(const struct predicate *p)
653 /* Prints a predicate */
654 void print_predicate(FILE *fp, const struct predicate *p)
655 {
656- fprintf (fp, "%s%s%s",
657- p->p_name,
658- p->arg_text ? " " : "",
659- p->arg_text ? p->arg_text : "");
660+ if (p->arg_text)
661+ {
662+ fprintf (fp, "%s %s", p->p_name, p->arg_text);
663+ }
664+ else
665+ {
666+ fprintf (fp, "%s", p->p_name);
667+ }
668 }
669
670
671@@ -832,7 +836,8 @@ set_new_parent (struct predicate *curr, enum predicate_precedence high_prec, str
672 new_parent->need_stat = false;
673 new_parent->need_type = false;
674 new_parent->p_cost = NeedsNothing;
675-
676+ new_parent->arg_text = NULL;
677+
678 switch (high_prec)
679 {
680 case COMMA_PREC:
681@@ -1393,6 +1398,18 @@ init_pred_perf(struct predicate *pred)
682 p->visits = p->successes = 0;
683 }
684
685+
686+struct predicate *
687+get_new_pred_noarg (const struct parser_table *entry)
688+{
689+ struct predicate *p = get_new_pred(entry);
690+ if (p)
691+ {
692+ p->arg_text = NULL;
693+ }
694+ return p;
695+}
696+
697
698 /* Return a pointer to a new predicate structure, which has been
699 linked in as the last one in the predicates list.
700@@ -1433,6 +1450,8 @@ get_new_pred (const struct parser_table *entry)
701 last_pred->no_default_print = false;
702 last_pred->need_stat = true;
703 last_pred->need_type = true;
704+ last_pred->p_cost = NeedsUnknown;
705+ last_pred->arg_text = "ThisShouldBeSetToSomethingElse";
706 last_pred->args.str = NULL;
707 last_pred->pred_next = NULL;
708 last_pred->pred_left = NULL;
709@@ -1449,7 +1468,8 @@ get_new_pred (const struct parser_table *entry)
710 predicate is an operator. If it isn't, the AND operator is inserted. */
711
712 struct predicate *
713-get_new_pred_chk_op (const struct parser_table *entry)
714+get_new_pred_chk_op (const struct parser_table *entry,
715+ const char *arg)
716 {
717 struct predicate *new_pred;
718 static const struct parser_table *entry_and = NULL;
719@@ -1471,13 +1491,14 @@ get_new_pred_chk_op (const struct parser_table *entry)
720 case PRIMARY_TYPE:
721 case CLOSE_PAREN:
722 /* We need to interpose the and operator. */
723- new_pred = get_new_pred (entry_and);
724+ new_pred = get_new_pred_noarg (entry_and);
725 new_pred->pred_func = pred_and;
726 new_pred->p_name = "-a";
727 new_pred->p_type = BI_OP;
728 new_pred->p_prec = AND_PREC;
729 new_pred->need_stat = false;
730 new_pred->need_type = false;
731+ new_pred->arg_text = NULL;
732 new_pred->args.str = NULL;
733 new_pred->side_effects = false;
734 new_pred->no_default_print = false;
735@@ -1488,6 +1509,7 @@ get_new_pred_chk_op (const struct parser_table *entry)
736 }
737
738 new_pred = get_new_pred (entry);
739+ new_pred->arg_text = arg;
740 new_pred->parser_entry = entry;
741 return new_pred;
742 }
743diff --git a/find/util.c b/find/util.c
744index a06eada..cc9a3eb 100644
745--- a/find/util.c
746+++ b/find/util.c
747@@ -89,11 +89,13 @@ static struct debug_option_assoc debugassoc[] =
748 operator. */
749
750 struct predicate *
751-insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func)
752+insert_primary_withpred (const struct parser_table *entry,
753+ PRED_FUNC pred_func,
754+ const char *arg)
755 {
756 struct predicate *new_pred;
757
758- new_pred = get_new_pred_chk_op (entry);
759+ new_pred = get_new_pred_chk_op (entry, arg);
760 new_pred->pred_func = pred_func;
761 new_pred->p_name = entry->parser_name;
762 new_pred->args.str = NULL;
763@@ -118,10 +120,16 @@ insert_primary_withpred (const struct parser_table *entry, PRED_FUNC pred_func)
764 either not there at all (we are the very first node) or is an
765 operator. */
766 struct predicate *
767-insert_primary (const struct parser_table *entry)
768+insert_primary (const struct parser_table *entry, const char *arg)
769 {
770 assert (entry->pred_func != NULL);
771- return insert_primary_withpred(entry, entry->pred_func);
772+ return insert_primary_withpred(entry, entry->pred_func, arg);
773+}
774+
775+struct predicate *
776+insert_primary_noarg (const struct parser_table *entry)
777+{
778+ return insert_primary(entry, NULL);
779 }
780
781
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch b/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch
new file mode 100644
index 0000000000..c0ff3ff1c0
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/02-28824.patch
@@ -0,0 +1,294 @@
1Upstream-Status: Backport
2
3commit 76ed377d6d3e4a83a00cabd401f751b37ecd1e7b
4Author: James Youngman <jay@gnu.org>
5Date: Sat Feb 20 13:11:45 2010 +0000
6
7 Fix Savannah bug# 28824: "-ctime x" yields "missing argument to `-ctime'".
8
9 * find/parser.c (parse_fls): If the argument is invalid, reverse
10 the change that collect_arg() made to *arg_ptr (that is, don't
11 consume the argument).
12 (parse_fprint0): Likewise.
13 (parse_gid): Likewise.
14 (parse_group): Likewise.
15 (parse_inum): Likewise.
16 (parse_links): Likewise.
17 (do_parse_xmin): Likewise.
18 (parse_name): Likewise.
19 (parse_printf): Likewise.
20 (parse_uid): Likewise.
21 (parse_used): Likewise.
22 (parse_time): Likewise.
23
24 Signed-off-by: James Youngman <jay@gnu.org>
25
26diff --git a/ChangeLog b/ChangeLog
27index d0ce1fe..13539a4 100644
28--- a/ChangeLog
29+++ b/ChangeLog
30@@ -1,0 +1,19 @@
31+2010-02-20 James Youngman <jay@gnu.org>
32+
33+ Fix Savannah bug# 28824: "-ctime x" yields "missing argument to
34+ `-ctime'".
35+ * find/parser.c (parse_fls): If the argument is invalid, reverse
36+ the change that collect_arg() made to *arg_ptr (that is, don't
37+ consume the argument).
38+ (parse_fprint0): Likewise.
39+ (parse_gid): Likewise.
40+ (parse_group): Likewise.
41+ (parse_inum): Likewise.
42+ (parse_links): Likewise.
43+ (do_parse_xmin): Likewise.
44+ (parse_name): Likewise.
45+ (parse_printf): Likewise.
46+ (parse_uid): Likewise.
47+ (parse_used): Likewise.
48+ (parse_time): Likewise.
49+
50diff --git a/NEWS b/NEWS
51index 5394311..4e910df 100644
52--- a/NEWS
53+++ b/NEWS
54@@ -4,5 +4,8 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
55
56 ** Bug Fixes
57
58+#28824: Corrected error message for "-ctime x".
59+ Likewise for -gid, -inum, -links, -mmin, -cmin, -amin,
60+ -uid, -used, -atime, -mtime, -ctime.
61 #26537: find -prune now makes sure it has valid stat() information.
62
63diff --git a/find/parser.c b/find/parser.c
64index 2e6b989..08758ee 100644
65--- a/find/parser.c
66+++ b/find/parser.c
67@@ -886,8 +886,14 @@ static boolean
68 parse_fls (const struct parser_table* entry, char **argv, int *arg_ptr)
69 {
70 const char *filename;
71- return collect_arg(argv, arg_ptr, &filename)
72- && insert_fls(entry, filename);
73+ if (collect_arg(argv, arg_ptr, &filename))
74+ {
75+ if (insert_fls(entry, filename))
76+ return true;
77+ else
78+ --*arg_ptr; /* don't consume the invalid arg. */
79+ }
80+ return false;
81 }
82
83 static boolean
84@@ -937,9 +943,13 @@ parse_fprint0 (const struct parser_table* entry, char **argv, int *arg_ptr)
85 {
86 const char *filename;
87 if (collect_arg(argv, arg_ptr, &filename))
88- return insert_fprint(entry, filename);
89- else
90- return false;
91+ {
92+ if (insert_fprint(entry, filename))
93+ return true;
94+ else
95+ --*arg_ptr; /* don't consume the bad arg. */
96+ }
97+ return false;
98 }
99
100 static float estimate_fstype_success_rate(const char *fsname)
101@@ -993,6 +1003,7 @@ parse_gid (const struct parser_table* entry, char **argv, int *arg_ptr)
102 }
103 else
104 {
105+ --*arg_ptr; /* don't consume the invalid argument. */
106 return false;
107 }
108 }
109@@ -1049,6 +1060,7 @@ static boolean
110 parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
111 {
112 const char *groupname;
113+ const int saved_argc = *arg_ptr;
114
115 if (collect_arg(argv, arg_ptr, &groupname))
116 {
117@@ -1077,6 +1089,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
118 "because it has the unexpected suffix %s"),
119 quotearg_n_style(0, options.err_quoting_style, groupname),
120 quotearg_n_style(1, options.err_quoting_style, groupname+gid_len));
121+ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
122 return false;
123 }
124 }
125@@ -1092,6 +1105,7 @@ parse_group (const struct parser_table* entry, char **argv, int *arg_ptr)
126 {
127 error(1, 0, _("argument to -group is empty, but should be a group name"));
128 }
129+ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
130 return false;
131 }
132 }
133@@ -1256,6 +1270,7 @@ parse_inum (const struct parser_table* entry, char **argv, int *arg_ptr)
134 }
135 else
136 {
137+ --*arg_ptr; /* don't consume the invalid argument. */
138 return false;
139 }
140 }
141@@ -1310,6 +1325,7 @@ parse_links (const struct parser_table* entry, char **argv, int *arg_ptr)
142 }
143 else
144 {
145+ --*arg_ptr; /* don't consume the invalid argument. */
146 return false;
147 }
148 }
149@@ -1358,6 +1374,7 @@ insert_depthspec(const struct parser_table* entry, char **argv, int *arg_ptr,
150 error(1, 0, _("Expected a positive decimal integer argument to %s, but got %s"),
151 predicate,
152 quotearg_n_style(0, options.err_quoting_style, depthstr));
153+ /* NOTREACHED */
154 return false;
155 }
156 /* missing argument */
157@@ -1385,6 +1402,7 @@ do_parse_xmin (const struct parser_table* entry,
158 enum xval xv)
159 {
160 const char *minutes;
161+ const int saved_argc = *arg_ptr;
162
163 if (collect_arg(argv, arg_ptr, &minutes))
164 {
165@@ -1401,6 +1419,11 @@ do_parse_xmin (const struct parser_table* entry,
166 our_pred->est_success_rate = estimate_timestamp_success_rate(tval.ts.tv_sec);
167 return true;
168 }
169+ else
170+ {
171+ /* Don't consume the invalid argument. */
172+ *arg_ptr = saved_argc;
173+ }
174 }
175 return false;
176 }
177@@ -1427,6 +1450,8 @@ static boolean
178 parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
179 {
180 const char *name;
181+ const int saved_argc = *arg_ptr;
182+
183 if (collect_arg(argv, arg_ptr, &name))
184 {
185 fnmatch_sanitycheck();
186@@ -1438,6 +1463,10 @@ parse_name (const struct parser_table* entry, char **argv, int *arg_ptr)
187 our_pred->est_success_rate = estimate_pattern_match_rate(name, 0);
188 return true;
189 }
190+ else
191+ {
192+ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
193+ }
194 }
195 return false;
196 }
197@@ -1954,11 +1983,21 @@ static boolean
198 parse_printf (const struct parser_table* entry, char **argv, int *arg_ptr)
199 {
200 const char *format;
201+ const int saved_argc = *arg_ptr;
202+
203 if (collect_arg(argv, arg_ptr, &format))
204 {
205 struct format_val fmt;
206 open_stdout(&fmt);
207- return insert_fprintf (&fmt, entry, pred_fprintf, format);
208+ if (insert_fprintf (&fmt, entry, pred_fprintf, format))
209+ {
210+ return true;
211+ }
212+ else
213+ {
214+ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
215+ return false;
216+ }
217 }
218 return false;
219 }
220@@ -1967,15 +2006,21 @@ static boolean
221 parse_fprintf (const struct parser_table* entry, char **argv, int *arg_ptr)
222 {
223 const char *format, *filename;
224+ int saved_argc = *arg_ptr;
225+
226 if (collect_arg(argv, arg_ptr, &filename))
227 {
228 if (collect_arg(argv, arg_ptr, &format))
229 {
230 struct format_val fmt;
231 open_output_file (filename, &fmt);
232- return insert_fprintf (&fmt, entry, pred_fprintf, format);
233+ saved_argc = *arg_ptr;
234+
235+ if (insert_fprintf (&fmt, entry, pred_fprintf, format))
236+ return true;
237 }
238 }
239+ *arg_ptr = saved_argc; /* don't consume the invalid argument. */
240 return false;
241 }
242
243@@ -2405,6 +2450,7 @@ parse_uid (const struct parser_table* entry, char **argv, int *arg_ptr)
244 }
245 else
246 {
247+ --*arg_ptr; /* don't consume the invalid argument. */
248 return false;
249 }
250 }
251@@ -2431,6 +2477,7 @@ parse_used (const struct parser_table* entry, char **argv, int *arg_ptr)
252 else
253 {
254 error(1, 0, _("Invalid argument %s to -used"), offset_str);
255+ /*NOTREACHED*/
256 return false;
257 }
258 }
259@@ -2610,6 +2657,7 @@ insert_type (char **argv, int *arg_ptr,
260 if (strlen(typeletter) != 1u)
261 {
262 error(1, 0, _("Arguments to -type should contain only one letter"));
263+ /*NOTREACHED*/
264 return false;
265 }
266
267@@ -2657,6 +2705,7 @@ insert_type (char **argv, int *arg_ptr,
268 #endif
269 default: /* None of the above ... nuke 'em. */
270 error(1, 0, _("Unknown argument to -type: %c"), (*typeletter));
271+ /*NOTREACHED*/
272 return false;
273 }
274 our_pred = insert_primary_withpred (entry, which_pred, typeletter);
275@@ -3349,6 +3398,7 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
276 const char *errmsg = "arithmetic overflow while converting %s "
277 "days to a number of seconds";
278 struct timespec origin;
279+ const int saved_argc = *arg_ptr;
280
281 if (!collect_arg(argv, arg_ptr, &timearg))
282 return false;
283@@ -3381,7 +3431,10 @@ parse_time (const struct parser_table* entry, char *argv[], int *arg_ptr)
284 timearg = orig_timearg;
285
286 if (!get_relative_timestamp(timearg, &tval, origin, DAYSECS, errmsg))
287- return false;
288+ {
289+ *arg_ptr = saved_argc; /* don't consume the invalid argument */
290+ return false;
291+ }
292
293 our_pred = insert_primary (entry, orig_timearg);
294 our_pred->args.reftime = tval;
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch b/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch
new file mode 100644
index 0000000000..940aaf6ff5
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/03-28872.patch
@@ -0,0 +1,58 @@
1Upstream-Status: Backport
2
3commit 5f5eb921765794e8fc58c4bdffa2daa2ae34800f
4Author: James Youngman <jay@gnu.org>
5Date: Sat Feb 20 19:53:13 2010 +0000
6
7 Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames"
8
9 * doc/find.texi (Problems with -exec and filenames): Add missing
10 $0 argument in example for sh -c 'something "$@" sh ...
11 * NEWS: Mention this change.
12
13 Signed-off-by: James Youngman <jay@gnu.org>
14
15diff --git a/ChangeLog b/ChangeLog
16index 13539a4..e94ba96 100644
17--- a/ChangeLog
18+++ b/ChangeLog
19@@ -1,5 +1,10 @@
20 2010-02-20 James Youngman <jay@gnu.org>
21
22+ Fix Savannah bug#28872, Mistake in "Problems with -exec and filenames"
23+ * doc/find.texi (Problems with -exec and filenames): Add missing
24+ $0 argument in example for sh -c 'something "$@" sh ...
25+ * NEWS: Mention this change.
26+
27 Fix Savannah bug# 28824: "-ctime x" yields "missing argument to
28 `-ctime'".
29 * find/parser.c (parse_fls): If the argument is invalid, reverse
30diff --git a/NEWS b/NEWS
31index 4e910df..4c97be9 100644
32--- a/NEWS
33+++ b/NEWS
34@@ -4,6 +4,9 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
35
36 ** Bug Fixes
37
38+#28872: Mistake in "#safer" example in "Problems with -exec and
39+ filenames" section of the Texinfo manual.
40+
41 #28824: Corrected error message for "-ctime x".
42 Likewise for -gid, -inum, -links, -mmin, -cmin, -amin,
43 -uid, -used, -atime, -mtime, -ctime.
44diff --git a/doc/find.texi b/doc/find.texi
45index 2e5958d..391ffa0 100644
46--- a/doc/find.texi
47+++ b/doc/find.texi
48@@ -4830,8 +4830,8 @@ problem:
49
50 @example
51 # safer
52-find -exec sh -c 'something "$@@"' @{@} \;
53-find -execdir sh -c 'something "$@@"' @{@}\;
54+find -exec sh -c 'something "$@@"' sh @{@} \;
55+find -execdir sh -c 'something "$@@"' sh @{@}\;
56 @end example
57
58 This approach is not guaranteed to avoid every problem, but it is much
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_doc.patch b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_doc.patch
new file mode 100644
index 0000000000..a48cdc221c
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_doc.patch
@@ -0,0 +1,84 @@
1Fix documentation build errors
2
3This fixes the following errors building the findutils documentation:
4find-maint.texi:45: misplaced {
5find-maint.texi:45: misplaced }
6find-maint.texi:236: warning: node next `Make the Compiler Find the Bugs' in menu `The File System Is Being Modified' and in sectioning `Factor Out Repeated Code' differ
7find-maint.texi:335: warning: node `Debugging is For Users Too' is next for `Factor Out Repeated Code' in sectioning but not in menu
8find-maint.texi:335: warning: node prev `Factor Out Repeated Code' in menu `Debugging is For Users Too' and in sectioning `Make the Compiler Find the Bugs' differ
9find-maint.texi:378: warning: node next `Debugging is For Users Too' in menu `Factor Out Repeated Code' and in sectioning `Don't Trust the File System Contents' differ
10find-maint.texi:378: warning: node prev `Debugging is For Users Too' in menu `Don't Trust the File System Contents' and in sectioning `Factor Out Repeated Code' differ
11find-maint.texi:392: warning: node next `Don't Trust the File System Contents' in menu `Debugging is For Users Too' and in sectioning `The File System Is Being Modified' differ
12find-maint.texi:392: warning: node prev `Don't Trust the File System Contents' in menu `The File System Is Being Modified' and in sectioning `Debugging is For Users Too' differ
13find-maint.texi:417: warning: node `Don't Trust the File System Contents' is next for `The File System Is Being Modified' in menu but not in sectioning
14find-maint.texi:417: warning: node prev `The File System Is Being Modified' in menu `Make the Compiler Find the Bugs' and in sectioning `Don't Trust the File System Contents' differ
15find.texi:53: misplaced {
16find.texi:53: misplaced }
17find.texi:1862: warning: node `Formatting Flags' is next for `Time Directives' in menu but not in sectioning
18find.texi:1975: warning: node `Formatting Flags' is next for `Combined Time Formats' in sectioning but not in menu
19find.texi:2004: warning: node prev `Formatting Flags' in menu `Time Directives' and in sectioning `Combined Time Formats' differ
20find.texi:2004: warning: node up `Formatting Flags' in menu `Format Directives' and in sectioning `Time Formats' differ
21find.texi:1893: node `Time Formats' lacks menu item for `Formatting Flags' despite being its Up target
22
23Upstream-Status: Backport
24Signed-off-by: Jonathan Liu <net147@gmail.com>
25
26--- a/doc/find-maint.texi
27+++ b/doc/find-maint.texi
28@@ -42,7 +42,7 @@ Free Documentation License''.
29
30 @page
31 @vskip 0pt plus 1filll
32-@insertcopying{}
33+@insertcopying
34 @end titlepage
35
36 @contents
37@@ -227,10 +227,10 @@ circumstances.
38
39 @menu
40 * Make the Compiler Find the Bugs::
41+* Factor Out Repeated Code::
42 * The File System Is Being Modified::
43 * Don't Trust the File System Contents::
44 * Debugging is For Users Too::
45-* Factor Out Repeated Code::
46 @end menu
47
48 @node Make the Compiler Find the Bugs
49--- a/doc/find.texi
50+++ b/doc/find.texi
51@@ -50,7 +50,7 @@ Texts. A copy of the license is included in the section entitled
52
53 @page
54 @vskip 0pt plus 1filll
55-@insertcopying{}
56+@insertcopying
57 @end titlepage
58
59 @contents
60@@ -1665,6 +1665,7 @@ no output is ever sent to it.
61 * Escapes::
62 * Format Directives::
63 * Time Formats::
64+* Formatting Flags::
65 @end menu
66
67 @node Escapes
68@@ -1733,7 +1734,6 @@ from the novel you are reading.
69 * Size Directives::
70 * Location Directives::
71 * Time Directives::
72-* Formatting Flags::
73 @end menu
74
75 @node Name Directives
76@@ -2002,7 +2002,7 @@ seconds field includes a fractional part.
77 @end table
78
79 @node Formatting Flags
80-@subsubsection Formatting Flags
81+@subsection Formatting Flags
82
83 The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
84 and @samp{+} flags, but the other directives do not, even if they
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_automake-1.12.patch b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000000..d4a7e95728
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_automake-1.12.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Pending
2
3This patch fixes following issue with automake 1.12
4
5| configure.ac:80: error: automatic de-ANSI-fication support has been removed
6
7Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
82012/05/03
9
10Index: findutils-4.4.2/configure.ac
11===================================================================
12--- findutils-4.4.2.orig/configure.ac
13+++ findutils-4.4.2/configure.ac
14@@ -77,8 +77,6 @@ AC_PROG_CPP
15 dnl for gnulib
16 gl_EARLY
17
18-AM_C_PROTOTYPES
19-
20 AC_PROG_INSTALL
21 AC_PROG_RANLIB
22 dnl AC_PROG_LIBTOOL
diff --git a/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_x32.patch b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_x32.patch
new file mode 100644
index 0000000000..b78cc7539c
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.4.2/findutils_fix_for_x32.patch
@@ -0,0 +1,40 @@
1Upstream-Status: Pending
2
3Author: H.J. Lu <hjl.tools@gmail.com>
4
5Work around gnulib time_t assumption in findutils for x32
6
7time_t is 64bit and long int is 32bit on x32. But gnulib used in
8findutils assumes time_t values fit into long int. Such assumption is
9invalid for x32 and should be removed.
10
11This patch is a workaround to compile gnulib for x32.
12
13Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/05
14
15
16Index: findutils-4.4.2/gnulib/lib/getdate.y
17===================================================================
18--- findutils-4.4.2.orig/gnulib/lib/getdate.y
19+++ findutils-4.4.2/gnulib/lib/getdate.y
20@@ -114,7 +114,6 @@
21 wraps around, but there's no portable way to check for that at
22 compile-time. */
23 verify (TYPE_IS_INTEGER (time_t));
24-verify (LONG_MIN <= TYPE_MINIMUM (time_t) && TYPE_MAXIMUM (time_t) <= LONG_MAX);
25
26 /* An integer value, and the number of digits in its textual
27 representation. */
28Index: findutils-4.4.2/gnulib/lib/mktime.c
29===================================================================
30--- findutils-4.4.2.orig/gnulib/lib/mktime.c
31+++ findutils-4.4.2/gnulib/lib/mktime.c
32@@ -166,7 +166,7 @@ ydhms_diff (long int year1, long int yda
33 {
34 verify (C99_integer_division, -1 / 2 == 0);
35 verify (long_int_year_and_yday_are_wide_enough,
36- INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX);
37+ INT_MAX <= TIME_T_MAX / 2 || TIME_T_MAX <= UINT_MAX);
38
39 /* Compute intervening leap days correctly even if year is negative.
40 Take care to avoid integer overflow here. */
diff --git a/meta/recipes-extended/findutils/findutils.inc b/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 0000000000..4f4068a091
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,24 @@
1SUMMARY = "find, locate, and xargs binaries"
2DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \
3These programs are typically used in conjunction with other programs to provide modular and powerful directory \
4search and file locating capabilities to other commands."
5HOMEPAGE = "http://www.gnu.org/software/findutils/"
6BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
7SECTION = "console/utils"
8
9
10SRC_URI = "${GNU_MIRROR}/findutils/findutils-${PV}.tar.gz"
11
12inherit autotools gettext texinfo update-alternatives
13
14ALTERNATIVE_${PN} = "find xargs"
15ALTERNATIVE_PRIORITY = "100"
16
17# diffutils assumes non-glibc compilation with uclibc and
18# this causes it to generate its own implementations of
19# standard functionality. regex.c actually breaks compilation
20# because it uses __mempcpy, there are other things (TBD:
21# see diffutils.mk in buildroot)
22EXTRA_OECONF_libc-uclibc = "--without-included-regex"
23
24BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/findutils/findutils_4.2.31.bb b/meta/recipes-extended/findutils/findutils_4.2.31.bb
new file mode 100644
index 0000000000..72b657a100
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.2.31.bb
@@ -0,0 +1,13 @@
1LICENSE = "GPLv2+"
2LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
3PR = "r4"
4
5require findutils.inc
6
7SRC_URI += "file://gnulib-extension.patch \
8 file://findutils_fix_for_automake-1.12.patch \
9 file://findutils-fix-doc-build-error.patch \
10 "
11
12SRC_URI[md5sum] = "a0e31a0f18a49709bf5a449867c8049a"
13SRC_URI[sha256sum] = "e0d34b8faca0b3cca0703f6c6b498afbe72f0ba16c35980c10ec9ef7724d6204"
diff --git a/meta/recipes-extended/findutils/findutils_4.4.2.bb b/meta/recipes-extended/findutils/findutils_4.4.2.bb
new file mode 100644
index 0000000000..faf2ebe462
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.4.2.bb
@@ -0,0 +1,25 @@
1require findutils.inc
2
3# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32)
4LICENSE = "GPLv3+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
6
7PR = "r6"
8
9SRC_URI += "file://01-27017.patch \
10 file://02-28824.patch \
11 file://03-28872.patch \
12 file://findutils_fix_for_x32.patch \
13 file://findutils_fix_for_automake-1.12.patch \
14 file://findutils_fix_doc.patch \
15 "
16
17SRC_URI[md5sum] = "351cc4adb07d54877fa15f75fb77d39f"
18SRC_URI[sha256sum] = "434f32d171cbc0a5e72cfc5372c6fc4cb0e681f8dce566a0de5b6fccd702b62a"
19
20DEPENDS = "bison-native"
21
22# http://savannah.gnu.org/bugs/?27299
23CACHED_CONFIGUREVARS += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', 'gl_cv_func_wcwidth_works=yes', '', d)}"
24
25EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"