action: implement readlink test operation

Dereference the symlink and evaluate the expression in the
context of the file pointed to by the symlink.
All attributes are updated to refer to the file that is pointed to.
Thus the inode attributes, pathname, name and depth all refer to
the dereferenced file, and not the symlink

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: fix uid() so it takes a name rather than just a number

The uid() test operation was added at the same time as all the other
inode attribute test operators, and all these operations were implemented
taking a [+-]number as an argument.

This is obviously wrong for UIDs.  UIDs should be able to be specified
as a name as well as a [+-]number.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: fix gid() so it takes a name rather than just a number

The gid() test operation was added at the same time as all the other
inode attribute test operators, and all these operations were implemented
taking a [+-]number as an argument.

This is obviously wrong for GIDs.  GIDs should be able to be specified
as a name as well as a [+-]number.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: parse_gid()

Name should be group in syntax error message.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: add comment describing generic TEST_VAR_FN macros

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
action: add dircount() test operation

Compare the number of items in the directory (in the output
filesystem as opposed to the source filesystem) against the supplied
value and return TRUE or FALSE.

The comparison can be less than ([<-]value), more than ([>+]value),
or equal (value).

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: fix dir_scan5() -- empty prune action

Dir_scan5() did not check for root entries (entries in the root
directory read from the original filesystem in append mode).

These entries are not "real" entries in that they cannot be evaluated
for emptiness.  The entries only exist in the original filesystem
amd must be skipped.

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