diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2014-09-12 00:31:56 +0100 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:36:46 -0800 |
commit | c89235426d8c338272f5ce9cf3e444d4dba6f9ea (patch) | |
tree | c6475a6be794c441727f0da421d25f885e3c12ed | |
parent | ae1914fababe0f41c2295097a15156aeedc3ae84 (diff) | |
download | squashfs-tools-c89235426d8c338272f5ce9cf3e444d4dba6f9ea.tar.gz |
actions: add new noop action
This action does exactly what it says, i.e. nothing.
It's designed to be used in conjunction with the verbose action
options to enable debugging of the test expression.
In otherwords, it allows you to check which files match on
your test expression but without doing anything to the filesystem.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
-rw-r--r-- | squashfs-tools/action.c | 9 | ||||
-rw-r--r-- | squashfs-tools/action.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c index 024456c..35889a4 100644 --- a/squashfs-tools/action.c +++ b/squashfs-tools/action.c @@ -2003,6 +2003,14 @@ int eval_prune_actions(struct dir_info *root, struct dir_ent *dir_ent) /* + * Noop specific action code + */ +static void noop_action(struct action *action, struct dir_ent *dir_ent) +{ +} + + +/* * General test evaluation code */ @@ -3253,5 +3261,6 @@ static struct action_entry action_table[] = { { "move", MOVE_ACTION, 1, ACTION_ALL_LNK, NULL, NULL}, { "prune", PRUNE_ACTION, 0, ACTION_ALL_LNK, NULL, NULL}, { "chmod", MODE_ACTION, -2, ACTION_ALL, parse_mode_args, mode_action }, + { "noop", NOOP_ACTION, 0, ACTION_ALL, NULL, noop_action }, { "", 0, -1, 0, NULL, NULL} }; diff --git a/squashfs-tools/action.h b/squashfs-tools/action.h index 7bfafb9..0a8de7c 100644 --- a/squashfs-tools/action.h +++ b/squashfs-tools/action.h @@ -176,6 +176,7 @@ struct type_entry { #define EMPTY_ACTION 12 #define MOVE_ACTION 13 #define PRUNE_ACTION 14 +#define NOOP_ACTION 15 /* * Define what file types each action operates over |