From 0c6fb98d013e4ffc664935a51adce94254d10f83 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 27 Nov 2009 19:33:20 +0100 Subject: update busybox and default config --- package/busybox/patches/002-find-empty.patch | 105 --------------------------- 1 file changed, 105 deletions(-) delete mode 100644 package/busybox/patches/002-find-empty.patch (limited to 'package/busybox/patches/002-find-empty.patch') diff --git a/package/busybox/patches/002-find-empty.patch b/package/busybox/patches/002-find-empty.patch deleted file mode 100644 index 4e0cc67fa..000000000 --- a/package/busybox/patches/002-find-empty.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff -Nur busybox-1.12.3/findutils/Config.in busybox-1.12.3-find/findutils/Config.in ---- busybox-1.12.3/findutils/Config.in 2008-09-28 20:04:28.000000000 +0200 -+++ busybox-1.12.3-find/findutils/Config.in 2009-01-06 22:24:46.086215240 +0100 -@@ -81,6 +81,14 @@ - help - Support the 'find -inum' option for searching by inode number. - -+config FEATURE_FIND_EMPTY -+ bool "Enable -empty option matching empty files and directories" -+ default y -+ depends on FIND -+ help -+ Support the 'find -empty' option for searching empty files -+ and directories. -+ - config FEATURE_FIND_EXEC - bool "Enable -exec option allowing execution of commands" - default y -diff -Nur busybox-1.12.3/findutils/find.c busybox-1.12.3-find/findutils/find.c ---- busybox-1.12.3/findutils/find.c 2008-09-28 20:04:28.000000000 +0200 -+++ busybox-1.12.3-find/findutils/find.c 2009-01-06 23:33:53.201386585 +0100 -@@ -93,6 +93,7 @@ - USE_FEATURE_FIND_CONTEXT(ACTS(context, security_context_t context;)) - USE_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;)) - USE_FEATURE_FIND_PRUNE( ACTS(prune)) -+USE_FEATURE_FIND_EMPTY( ACTS(empty)) - USE_FEATURE_FIND_DELETE( ACTS(delete)) - USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned *subst_count; int exec_argc;)) - USE_FEATURE_FIND_GROUP( ACTS(group, gid_t gid;)) -@@ -318,6 +319,34 @@ - return exec_actions(ap->subexpr, fileName, statbuf); - } - #endif -+#if ENABLE_FEATURE_FIND_EMPTY -+ACTF(empty) -+{ -+ DIR *d; -+ struct dirent *dp; -+ bool empty = TRUE; -+ -+ if (S_ISDIR(statbuf->st_mode)) { -+ d = opendir(fileName); -+ if (d == NULL) -+ bb_simple_perror_msg(fileName); -+ for (dp = readdir(d); dp; dp = readdir(d)) { -+ if (dp->d_name[0] != '.' || -+ (dp->d_name[1] != '\0' && -+ (dp->d_name[1] != '.' || -+ dp->d_name[2] != '\0'))) { -+ empty = FALSE; -+ break; -+ } -+ } -+ closedir(d); -+ return(empty); -+ } else if (S_ISREG(statbuf->st_mode)) -+ return (statbuf->st_size == 0); -+ else -+ return FALSE; -+} -+#endif - #if ENABLE_FEATURE_FIND_SIZE - ACTF(size) - { -@@ -459,6 +488,7 @@ - USE_FEATURE_FIND_PRINT0( PARM_print0 ,) - USE_FEATURE_FIND_DEPTH( PARM_depth ,) - USE_FEATURE_FIND_PRUNE( PARM_prune ,) -+ USE_FEATURE_FIND_EMPTY( PARM_empty ,) - USE_FEATURE_FIND_DELETE( PARM_delete ,) - USE_FEATURE_FIND_EXEC( PARM_exec ,) - USE_FEATURE_FIND_PAREN( PARM_char_brace,) -@@ -492,6 +522,7 @@ - USE_FEATURE_FIND_PRINT0( "-print0\0" ) - USE_FEATURE_FIND_DEPTH( "-depth\0" ) - USE_FEATURE_FIND_PRUNE( "-prune\0" ) -+ USE_FEATURE_FIND_EMPTY( "-empty\0" ) - USE_FEATURE_FIND_DELETE( "-delete\0" ) - USE_FEATURE_FIND_EXEC( "-exec\0" ) - USE_FEATURE_FIND_PAREN( "(\0" ) -@@ -610,6 +641,12 @@ - (void) ALLOC_ACTION(prune); - } - #endif -+#if ENABLE_FEATURE_FIND_EMPTY -+ else if (parm == PARM_empty) { -+ USE_FEATURE_FIND_NOT( invert_flag = 0; ) -+ (void) ALLOC_ACTION(empty); -+ } -+#endif - #if ENABLE_FEATURE_FIND_DELETE - else if (parm == PARM_delete) { - need_print = 0; -diff -Nur busybox-1.12.3/include/usage.h busybox-1.12.3-find/include/usage.h ---- busybox-1.12.3/include/usage.h 2008-09-28 20:04:26.000000000 +0200 -+++ busybox-1.12.3-find/include/usage.h 2009-01-07 00:07:49.832669156 +0100 -@@ -1140,6 +1140,8 @@ - "\n -group NAME File belongs to group NAME (numeric group ID allowed)") \ - USE_FEATURE_FIND_DEPTH( \ - "\n -depth Process directory name after traversing it") \ -+ USE_FEATURE_FIND_EMPTY( \ -+ "\n -empty File or directory is empty") \ - USE_FEATURE_FIND_SIZE( \ - "\n -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.))." \ - "\n +/-N: file size is bigger/smaller than N") \ -- cgit v1.2.3 From 0ba71fe6deb9d028d305483071ca47b85081b672 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 28 Nov 2009 12:50:01 +0100 Subject: update TODO, readd find -empty feature in busybox --- TODO | 3 +- package/busybox/patches/002-find-empty.patch | 105 +++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 package/busybox/patches/002-find-empty.patch (limited to 'package/busybox/patches/002-find-empty.patch') diff --git a/TODO b/TODO index d2bc511c9..fa99e3e1e 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ -- busybox update to latest version -- rpm package backend - fix init scripts pidof? vs. killall +- rpm package backend - freebsd build - win cygwin build - netbsd build diff --git a/package/busybox/patches/002-find-empty.patch b/package/busybox/patches/002-find-empty.patch new file mode 100644 index 000000000..776196ce4 --- /dev/null +++ b/package/busybox/patches/002-find-empty.patch @@ -0,0 +1,105 @@ +diff -Nur busybox-1.15.2.orig/findutils/Config.in busybox-1.15.2/findutils/Config.in +--- busybox-1.15.2.orig/findutils/Config.in 2009-09-26 15:14:57.000000000 +0200 ++++ busybox-1.15.2/findutils/Config.in 2009-11-28 12:41:31.000000000 +0100 +@@ -81,6 +81,14 @@ + help + Support the 'find -inum' option for searching by inode number. + ++config FEATURE_FIND_EMPTY ++ bool "Enable -empty option matching empty files and directories" ++ default y ++ depends on FIND ++ help ++ Support the 'find -empty' option for searching empty files ++ and directories. ++ + config FEATURE_FIND_EXEC + bool "Enable -exec: execute commands" + default y +diff -Nur busybox-1.15.2.orig/findutils/find.c busybox-1.15.2/findutils/find.c +--- busybox-1.15.2.orig/findutils/find.c 2009-10-08 03:04:40.000000000 +0200 ++++ busybox-1.15.2/findutils/find.c 2009-11-28 12:48:36.000000000 +0100 +@@ -93,6 +93,7 @@ + IF_FEATURE_FIND_CONTEXT(ACTS(context, security_context_t context;)) + IF_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;)) + IF_FEATURE_FIND_PRUNE( ACTS(prune)) ++IF_FEATURE_FIND_EMPTY( ACTS(empty)) + IF_FEATURE_FIND_DELETE( ACTS(delete)) + IF_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned *subst_count; int exec_argc;)) + IF_FEATURE_FIND_GROUP( ACTS(group, gid_t gid;)) +@@ -333,6 +334,34 @@ + return exec_actions(ap->subexpr, fileName, statbuf); + } + #endif ++#if ENABLE_FEATURE_FIND_EMPTY ++ACTF(empty) ++{ ++ DIR *d; ++ struct dirent *dp; ++ bool empty = TRUE; ++ ++ if (S_ISDIR(statbuf->st_mode)) { ++ d = opendir(fileName); ++ if (d == NULL) ++ bb_simple_perror_msg(fileName); ++ for (dp = readdir(d); dp; dp = readdir(d)) { ++ if (dp->d_name[0] != '.' || ++ (dp->d_name[1] != '\0' && ++ (dp->d_name[1] != '.' || ++ dp->d_name[2] != '\0'))) { ++ empty = FALSE; ++ break; ++ } ++ } ++ closedir(d); ++ return(empty); ++ } else if (S_ISREG(statbuf->st_mode)) ++ return (statbuf->st_size == 0); ++ else ++ return FALSE; ++} ++#endif + #if ENABLE_FEATURE_FIND_SIZE + ACTF(size) + { +@@ -476,6 +505,7 @@ + IF_FEATURE_FIND_PRINT0( PARM_print0 ,) + IF_FEATURE_FIND_DEPTH( PARM_depth ,) + IF_FEATURE_FIND_PRUNE( PARM_prune ,) ++ IF_FEATURE_FIND_EMPTY( PARM_empty ,) + IF_FEATURE_FIND_DELETE( PARM_delete ,) + IF_FEATURE_FIND_EXEC( PARM_exec ,) + IF_FEATURE_FIND_PAREN( PARM_char_brace,) +@@ -509,6 +539,7 @@ + IF_FEATURE_FIND_PRINT0( "-print0\0" ) + IF_FEATURE_FIND_DEPTH( "-depth\0" ) + IF_FEATURE_FIND_PRUNE( "-prune\0" ) ++ IF_FEATURE_FIND_EMPTY( "-empty\0" ) + IF_FEATURE_FIND_DELETE( "-delete\0" ) + IF_FEATURE_FIND_EXEC( "-exec\0" ) + IF_FEATURE_FIND_PAREN( "(\0" ) +@@ -627,6 +658,12 @@ + (void) ALLOC_ACTION(prune); + } + #endif ++#if ENABLE_FEATURE_FIND_EMPTY ++ else if (parm == PARM_empty) { ++ IF_FEATURE_FIND_NOT( invert_flag = 0; ) ++ (void) ALLOC_ACTION(empty); ++ } ++#endif + #if ENABLE_FEATURE_FIND_DELETE + else if (parm == PARM_delete) { + G.need_print = 0; +diff -Nur busybox-1.15.2.orig/include/usage.h busybox-1.15.2/include/usage.h +--- busybox-1.15.2.orig/include/usage.h 2009-10-08 02:59:09.000000000 +0200 ++++ busybox-1.15.2/include/usage.h 2009-11-28 12:42:43.000000000 +0100 +@@ -1239,6 +1239,8 @@ + "\n -group NAME File belongs to group NAME (numeric group ID allowed)") \ + IF_FEATURE_FIND_DEPTH( \ + "\n -depth Process directory name after traversing it") \ ++ IF_FEATURE_FIND_EMPTY( \ ++ "\n -empty File or directory is empty") \ + IF_FEATURE_FIND_SIZE( \ + "\n -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.))." \ + "\n +/-N: file size is bigger/smaller than N") \ -- cgit v1.2.3