actions: implement -verbose_action option

Add an action option that prints the result of evaluating
the associated expression, annotating the result of evaluating each
atom (test operation) with =True or =False.

This can be used (especially in debugging action statements) to
show which action statements triggered, and why, and which
action statements didn't trigger and again why.

For instance given the action

-verbose_action 'uid(root)@type(d)||name(file*)'

This could produce the following output

test2/empty=uid(root)@(type(d)=True)
test2/file9=uid(root)@(type(d)=False||name(file*)=True)
test2/file4=uid(root)@(type(d)=False||name(file*)=True)
test2/a=uid(root)@(type(d)=False||name(file*)=False)
test2/sym=uid(root)@(type(d)=False||name(file*)=False)
test2/dir=uid(root)@(type(d)=True)
test2/dir/fred=uid(root)@(type(d)=False||name(file*)=False)
test2/file8=uid(root)@(type(d)=False||name(file*)=True)
test2=uid(root)@(type(d)=True)

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: implement verbose_action for eval_fn test operator

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: implement verbose_action for readlink_fn test operator

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: implement verbose_action for stat_fn test operator

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: implement -vaf (verbose action file) option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: extend logging to handle log if action TRUE and log if action FALSE

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: update action option parsing to use ACTION_LOG_{NONE|VERBOSE}

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: make action_read_file use ACTION_LOG_{NONE|VERBOSE}

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -true_action option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -false_action option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -action_file as synonym for -af

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -verbose_action_file as synonym for -vaf

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: fix read_action_file to use ACTION_LOG_{NONE|VERBOSE}

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -true_action_file option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -true-action-file option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: fix usage of "_" in new options

Gah, I like using "_" as the separator between words in
options.  But, a long time ago I noticed I'd ended up with "-"
as the separator in the majority case, and so I'm stuck with
"-" as the separator.

Fix verbose_option, true_option, false_option, action_file
and verbse_action_file.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add -false-action-file option

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: eval_expr_top() should be using subpath and not pathname

Subpath is the path rooted at the root of the destination filesystem.
It includes renames (due to name conflicts), and moves.

Pathname is the original source pathname rooted at whatever pathname(s)
were given on the command line.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: fix those underscores

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: fix symbolic mode parsing in the mode() action

When I implemented symbolic modes in the mode() action (i.e.
u+r-w) I made an oversight.  I didn't realise the specification
allowed multiple =-+ sequences after the ownership specification.
In otherwords if you wanted to add r (+r) and remove w (-w)
from user, I assumed you would do u+r,u-w.  After revisiting
the symbolic mode specification it turns out you should be able
to do u+r-w as a short cut to the previous specification.  It
also should be obvious I don't tend to use the symbolic mode but
directly use the octal specification!

So fix the parser to allow multiple =-+ sequences.

So the syntax of the symbolic mode support goes from

[ugoa]+[+-=]PERMS
PERMS = [rwxXst]+ or [ugo]

to

[ugoa]*[[+-=]PERMS]+
PERMS = [rwxXst]+ or [ugo]

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>