[PATCH] now with patch attached

Kai Schwenzfeier niteblade at gmx.net
Wed Apr 4 10:20:45 PDT 2007


:)

-------------- next part --------------
--- ./findutils/find.c~	2007-03-22 21:21:37.000000000 +0100
+++ ./findutils/find.c	2007-04-04 16:24:00.000000000 +0200
@@ -72,9 +72,9 @@
 USE_FEATURE_FIND_INUM(  ACTS(inum,  ino_t inode_num;))
 USE_FEATURE_FIND_EXEC(  ACTS(exec,  char **exec_argv; unsigned int *subst_count; int exec_argc;))
 USE_FEATURE_FIND_USER(  ACTS(user,  int uid;))
-USE_DESKTOP(            ACTS(paren, action ***subexpr;))
-USE_DESKTOP(            ACTS(size,  off_t size;))
-USE_DESKTOP(            ACTS(prune))
+USE_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;))
+USE_FEATURE_FIND_SIZE(  ACTS(size,  off_t size;))
+USE_FEATURE_FIND_PRUNE( ACTS(prune))
 
 static action ***actions;
 static smalluint need_print = 1;
@@ -245,12 +245,14 @@
 	return TRUE;
 }
 
-#if ENABLE_DESKTOP
+#if ENABLE_FEATURE_FIND_PAREN
 ACTF(paren)
 {
 	return exec_actions(ap->subexpr, fileName, statbuf);
 }
+#endif
 
+#if ENABLE_FEATURE_FIND_SIZE
 /*
  * -prune: if -depth is not given, return true and do not descend
  * current dir; if -depth is given, return false with no effect.
@@ -261,7 +263,9 @@
 {
 	return SKIP;
 }
+#endif
 
+#if ENABLE_FEATURE_FIND_PRUNE
 ACTF(size)
 {
 	return statbuf->st_size == ap->size;
@@ -527,7 +531,7 @@
 				ap->uid = xuname2uid(arg1);
 		}
 #endif
-#if ENABLE_DESKTOP
+#if ENABLE_FEATURE_FIND_PAREN
 		else if (LONE_CHAR(arg, '(')) {
 			action_paren *ap;
 			char **endarg;
@@ -549,10 +553,14 @@
 			*endarg = (char*) ")"; /* restore NULLed parameter */
 			argv = endarg;
 		}
+#endif
+#if ENABLE_FEATURE_FIND_PRUNE
 		else if (strcmp(arg, "-prune") == 0) {
 			USE_FEATURE_FIND_NOT( invert_flag = 0; )
 			(void) ALLOC_ACTION(prune);
 		}
+#endif
+#if ENABLE_FEATURE_FIND_SIZE
 		else if (strcmp(arg, "-size") == 0) {
 			action_size *ap;
 			if (!*++argv)
@@ -584,7 +592,7 @@
 			break;
 		if (ENABLE_FEATURE_FIND_NOT && LONE_CHAR(argv[firstopt], '!'))
 			break;
-#if ENABLE_DESKTOP
+#if ENABLE_FEATURE_FIND_PAREN
 		if (LONE_CHAR(argv[firstopt], '('))
 			break;
 #endif
--- ./findutils/Config.in~	2007-03-22 21:21:37.000000000 +0100
+++ ./findutils/Config.in	2007-04-04 16:39:10.000000000 +0200
@@ -99,6 +99,28 @@
 	  full-blown desktop' is enabled, then will also support the
 	  non-POSIX notation '-not'.
 
+config FEATURE_FIND_PAREN
+	bool "Enable parens in options"
+	default y
+	depends on FIND
+	help
+	  Enable usage of parens '(' to specify logical order of arguments.
+
+config FEATURE_FIND_SIZE
+	bool "Enable (-size) option allowing matching for file size"
+	default y
+	depends on FIND
+	help
+	  Support the 'find -size' option for searching by file size.
+
+config FEATURE_FIND_PRUNE
+	bool "Enable (-prune) option allowing to exclude subdirectories"
+	default y
+	depends on FIND
+	help
+	  If the file is a directory, dont descend into it. Useful for
+	  exclusion .svn and CVS directories.
+
 config GREP
 	bool "grep"
 	default n
--- ./include/usage.h~	2007-03-22 21:21:35.000000000 +0100
+++ ./include/usage.h	2007-04-04 17:03:16.000000000 +0200
@@ -958,9 +958,11 @@
 	) USE_FEATURE_FIND_EXEC( \
        "\n	-exec CMD	Execute CMD with all instances of {} replaced by the" \
        "\n			files matching EXPRESSION" \
-	) USE_DESKTOP( \
+	) USE_FEATURE_FIND_SIZE( \
        "\n	-size N		File size is N" \
+	) USE_FEATURE_FIND_PRUNE( \
        "\n	-prune		Stop traversing current subtree" \
+	) USE_FEATURE_FIND_PAREN( \
        "\n	(expr)		Group" \
 	)
 


More information about the busybox mailing list