diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2014-08-27 05:36:27 +0100 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2014-08-27 05:36:27 +0100 |
commit | daa1bcbeb8b9aa3d572caba1fbd3d19cf345824a (patch) | |
tree | 9ed89ee4feedb4d0dedbaecc1b9ae0cdc5ed5d4c | |
parent | 4995ac5e470068c276c3604c04982185d111ee08 (diff) | |
download | squashfs-tools-daa1bcbeb8b9aa3d572caba1fbd3d19cf345824a.tar.gz |
action: extend logging to handle log if action TRUE and log if action FALSE
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
-rw-r--r-- | squashfs-tools/action.c | 9 | ||||
-rw-r--r-- | squashfs-tools/action.h | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c index faf3566..6feb616 100644 --- a/squashfs-tools/action.c +++ b/squashfs-tools/action.c @@ -768,8 +768,13 @@ static int eval_expr_top(struct action *action, struct action_data *action_data) match = eval_expr_log(action->expr, action_data); - /* Print the evaluated expression log */ - progressbar_info("%s\n", expr_log("")); + /* + * Print the evaluated expression log, if the + * result matches the logging specified + */ + if((match && (action->verbose & ACTION_LOG_TRUE)) || (!match + && (action->verbose & ACTION_LOG_FALSE))) + progressbar_info("%s\n", expr_log("")); expr_log_cmnd(LOG_DISABLE); diff --git a/squashfs-tools/action.h b/squashfs-tools/action.h index 4b6e1f8..1ca2df1 100644 --- a/squashfs-tools/action.h +++ b/squashfs-tools/action.h @@ -185,6 +185,17 @@ struct type_entry { #define ACTION_ALL 4 #define ACTION_LNK 5 + +/* + * Action logging requested, specified by the various + * -action, -true_action, -false_action and -verbose_action + * options + */ +#define ACTION_LOG_NONE 0 +#define ACTION_LOG_TRUE 1 +#define ACTION_LOG_FALSE 2 +#define ACTION_LOG_VERBOSE ACTION_LOG_TRUE | ACTION_LOG_FALSE + struct action_entry { char *name; int type; |