build system: add "release" target

find: support -size N (needed for above)
This commit is contained in:
Denis Vlasenko
2006-12-12 22:31:15 +00:00
parent 16c2c700fd
commit 5fa7148761
4 changed files with 63 additions and 23 deletions

View File

@@ -69,6 +69,7 @@ USE_FEATURE_FIND_NEWER( ACTS(newer, time_t newer_mtime;))
USE_FEATURE_FIND_INUM( ACTS(inum, ino_t inode_num;))
USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; int *subst_count; int exec_argc;))
USE_DESKTOP( ACTS(paren, action ***subexpr;))
USE_DESKTOP( ACTS(size, off_t size;))
USE_DESKTOP( ACTS(prune))
static action ***actions;
@@ -225,6 +226,7 @@ ACTF(paren)
{
return exec_actions(ap->subexpr, fileName, statbuf);
}
/*
* -prune: if -depth is not given, return true and do not descend
* current dir; if -depth is given, return false with no effect.
@@ -235,6 +237,11 @@ ACTF(prune)
{
return SKIP;
}
ACTF(size)
{
return statbuf->st_size == ap->size;
}
#endif
@@ -487,6 +494,13 @@ action*** parse_params(char **argv)
else if (strcmp(arg, "-prune") == 0) {
(void) ALLOC_ACTION(prune);
}
else if (strcmp(arg, "-size") == 0) {
action_size *ap;
if (!*++argv)
bb_error_msg_and_die(bb_msg_requires_arg, arg);
ap = ALLOC_ACTION(size);
ap->size = XATOOFF(arg1);
}
#endif
else
bb_show_usage();