2012-01-18 06:03:10 +01:00
|
|
|
diff -aur findutils-4.5.10.orig/doc/find.texi findutils-4.5.10/doc/find.texi
|
|
|
|
--- findutils-4.5.10.orig/doc/find.texi 2012-01-16 15:29:59.649039029 -0500
|
|
|
|
+++ findutils-4.5.10/doc/find.texi 2012-01-16 15:54:30.683648566 -0500
|
|
|
|
@@ -1440,6 +1440,10 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
There are two ways to avoid searching certain filesystems. One way is
|
|
|
|
to tell @code{find} to only search one filesystem:
|
|
|
|
|
|
|
|
+@deffn Option -xautofs
|
|
|
|
+Don't descend directories on autofs filesystems.
|
|
|
|
+@end deffn
|
|
|
|
+
|
|
|
|
@deffn Option -xdev
|
|
|
|
@deffnx Option -mount
|
|
|
|
Don't descend directories on other filesystems. These options are
|
2012-01-18 06:03:10 +01:00
|
|
|
diff -aur findutils-4.5.10.orig/find/defs.h findutils-4.5.10/find/defs.h
|
|
|
|
--- findutils-4.5.10.orig/find/defs.h 2011-04-03 18:53:11.000000000 -0400
|
|
|
|
+++ findutils-4.5.10/find/defs.h 2012-01-16 15:56:13.473363517 -0500
|
|
|
|
@@ -561,6 +561,9 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
/* If true, don't cross filesystem boundaries. */
|
2012-01-18 06:03:10 +01:00
|
|
|
bool stay_on_filesystem;
|
|
|
|
|
|
|
|
+ /* If true, don't descend directores on autofs filesystems */
|
|
|
|
+ bool bypass_autofs;
|
2010-03-12 16:45:17 +01:00
|
|
|
+
|
2012-01-18 06:03:10 +01:00
|
|
|
/* If true, we ignore the problem where we find that a directory entry
|
2010-03-12 16:45:17 +01:00
|
|
|
* no longer exists by the time we get around to processing it.
|
|
|
|
*/
|
2012-01-18 06:03:10 +01:00
|
|
|
diff -aur findutils-4.5.10.orig/find/find.1 findutils-4.5.10/find/find.1
|
|
|
|
--- findutils-4.5.10.orig/find/find.1 2011-04-03 18:53:11.000000000 -0400
|
|
|
|
+++ findutils-4.5.10/find/find.1 2012-01-16 15:57:07.003694295 -0500
|
|
|
|
@@ -460,6 +460,9 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
.B \-nowarn
|
|
|
|
otherwise.
|
|
|
|
|
|
|
|
+.IP \-xautofs
|
|
|
|
+Don't descend directories on autofs filesystems.
|
|
|
|
+
|
|
|
|
.IP \-xdev
|
|
|
|
Don't descend directories on other filesystems.
|
|
|
|
|
2012-01-18 06:03:10 +01:00
|
|
|
diff -aur findutils-4.5.10.orig/find/ftsfind.c findutils-4.5.10/find/ftsfind.c
|
|
|
|
--- findutils-4.5.10.orig/find/ftsfind.c 2011-04-03 18:53:11.000000000 -0400
|
|
|
|
+++ findutils-4.5.10/find/ftsfind.c 2012-01-16 16:00:05.103467741 -0500
|
|
|
|
@@ -485,6 +485,12 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (options.bypass_autofs &&
|
|
|
|
+ 0 == strcmp ("autofs", filesystem_type (&statbuf, ent->fts_name)))
|
|
|
|
+ {
|
|
|
|
+ fts_set(p, ent, FTS_SKIP); /* descend no further */
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if ( (ent->fts_info == FTS_D) && !options.do_dir_first )
|
|
|
|
{
|
2012-01-18 06:03:10 +01:00
|
|
|
/* this is the preorder visit, but user said -depth */
|
|
|
|
diff -aur findutils-4.5.10.orig/find/parser.c findutils-4.5.10/find/parser.c
|
|
|
|
--- findutils-4.5.10.orig/find/parser.c 2011-04-03 18:53:11.000000000 -0400
|
|
|
|
+++ findutils-4.5.10/find/parser.c 2012-01-16 16:05:32.208378367 -0500
|
|
|
|
@@ -151,6 +151,7 @@
|
|
|
|
static bool parse_version (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_wholename (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_xdev (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
+static bool parse_xautofs (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_ignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_noignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
static bool parse_warn (const struct parser_table*, char *argv[], int *arg_ptr);
|
|
|
|
@@ -325,6 +326,7 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */
|
|
|
|
{ARG_TEST, "writable", parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */
|
|
|
|
PARSE_OPTION ("xdev", xdev), /* POSIX */
|
|
|
|
+ PARSE_OPTION ("xautofs", xautofs),
|
|
|
|
PARSE_TEST ("xtype", xtype), /* GNU */
|
|
|
|
#ifdef UNIMPLEMENTED_UNIX
|
|
|
|
/* It's pretty ugly for find to know about archive formats.
|
2012-01-18 06:03:10 +01:00
|
|
|
@@ -2800,6 +2802,16 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
}
|
|
|
|
|
2012-01-18 06:03:10 +01:00
|
|
|
static bool
|
|
|
|
+parse_xautofs(const struct parser_table* entry, char **argv, int *arg_ptr)
|
2010-03-12 16:45:17 +01:00
|
|
|
+{
|
|
|
|
+ (void) argv;
|
|
|
|
+ (void) arg_ptr;
|
|
|
|
+ (void) entry;
|
|
|
|
+ options.bypass_autofs = true;
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
2012-01-18 06:03:10 +01:00
|
|
|
+static bool
|
2010-03-12 16:45:17 +01:00
|
|
|
parse_ignore_race (const struct parser_table* entry, char **argv, int *arg_ptr)
|
|
|
|
{
|
|
|
|
options.ignore_readdir_race = true;
|
2012-01-18 06:03:10 +01:00
|
|
|
diff -aur findutils-4.5.10.orig/find/util.c findutils-4.5.10/find/util.c
|
|
|
|
--- findutils-4.5.10.orig/find/util.c 2011-04-03 18:53:11.000000000 -0400
|
|
|
|
+++ findutils-4.5.10/find/util.c 2012-01-16 16:06:17.309814520 -0500
|
|
|
|
@@ -1006,6 +1006,7 @@
|
2010-03-12 16:45:17 +01:00
|
|
|
|
|
|
|
p->full_days = false;
|
|
|
|
p->stay_on_filesystem = false;
|
|
|
|
+ p->bypass_autofs = false;
|
|
|
|
p->ignore_readdir_race = false;
|
|
|
|
|
|
|
|
if (p->posixly_correct)
|