aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2014-08-27 05:36:27 +0100
committerPhillip Lougher <phillip@squashfs.org.uk>2014-08-27 05:36:27 +0100
commitdaa1bcbeb8b9aa3d572caba1fbd3d19cf345824a (patch)
tree9ed89ee4feedb4d0dedbaecc1b9ae0cdc5ed5d4c
parent4995ac5e470068c276c3604c04982185d111ee08 (diff)
downloadsquashfs-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.c9
-rw-r--r--squashfs-tools/action.h11
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;