aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2014-08-22 06:13:06 +0100
committerPhillip Lougher <phillip@squashfs.org.uk>2014-08-22 06:16:42 +0100
commit9c883949d7c34d7ccd646f6035e1e81e1bbf3a50 (patch)
tree279f2cc52f257c768030fca9a5758401b47f68cb
parent878174f982ec5ae6e14675bfeb3f4dee19377294 (diff)
downloadsquashfs-tools-9c883949d7c34d7ccd646f6035e1e81e1bbf3a50.tar.gz
actions: implement verbose_action for eval_fn test operator
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
-rw-r--r--squashfs-tools/action.c26
-rw-r--r--squashfs-tools/mksquashfs.c2
2 files changed, 23 insertions, 5 deletions
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
index cce2766..1e5dbe4 100644
--- a/squashfs-tools/action.c
+++ b/squashfs-tools/action.c
@@ -677,7 +677,7 @@ void expr_log_atom(struct atom *atom)
}
-void expr_log_match(struct atom *atom, int match)
+void expr_log_match(int match)
{
if(match)
expr_log("=True");
@@ -694,7 +694,7 @@ static int eval_expr_log(struct expr *expr, struct action_data *action_data)
case ATOM_TYPE:
expr_log_atom(&expr->atom);
match = expr->atom.test->fn(&expr->atom, action_data);
- expr_log_match(&expr->atom, match);
+ expr_log_match(match);
break;
case UNARY_TYPE:
expr_log("!");
@@ -2901,8 +2901,18 @@ static int eval_fn(struct atom *atom, struct action_data *action_data)
dir_ent = follow_path(dir_ent->dir, path);
}
- if(dir_ent == NULL)
+ if(dir_ent == NULL) {
+ if(expr_log_cmnd(LOG_ENABLED)) {
+ expr_log(atom->test->name);
+ expr_log("(");
+ expr_log(atom->argv[0]);
+ expr_log(",");
+ expr_log_match(0);
+ expr_log(")");
+ }
+
return 0;
+ }
eval_action.name = dir_ent->name;
eval_action.pathname = strdup(pathname(dir_ent));
@@ -2912,7 +2922,15 @@ static int eval_fn(struct atom *atom, struct action_data *action_data)
eval_action.dir_ent = dir_ent;
eval_action.root = action_data->root;
- match = eval_expr(atom->data, &eval_action);
+ if(expr_log_cmnd(LOG_ENABLED)) {
+ expr_log(atom->test->name);
+ expr_log("(");
+ expr_log(eval_action.subpath);
+ expr_log(",");
+ match = eval_expr_log(atom->data, &eval_action);
+ expr_log(")");
+ } else
+ match = eval_expr(atom->data, &eval_action);
free(eval_action.pathname);
free(eval_action.subpath);
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 346ab83..7b80858 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -5089,7 +5089,7 @@ void calculate_queue_sizes(int mem, int *readq, int *fragq, int *bwriteq,
#define VERSION() \
- printf("mksquashfs version 4.3-git (2014/08/17)\n");\
+ printf("mksquashfs version 4.3-git (2014/08/21)\n");\
printf("copyright (C) 2014 Phillip Lougher "\
"<phillip@squashfs.org.uk>\n\n"); \
printf("This program is free software; you can redistribute it and/or"\