diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-05 15:00:08 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-07 10:41:49 +0200 |
commit | 73b4ec8392541a27815bccbaeccbdf1cdd5e19dd (patch) | |
tree | 670e0b3f6e64ba7e957e29454e1f17261faf2ffe /difftool/util.c | |
parent | 1fff8f3a1326bd82f8140a61d969994e635834fe (diff) |
Add a helper utility to compare filesystem trees
The intended use case is to compare two mounted or unpacke squashfs
images, so a repacked test image can be compared against its original
or an image unpacked with unsquashfs can be compared with an image
unpacked by rdsquashfs or sqfs2tar.
Since the tool is only intended to aid development (specifically
automated testing), it is not installed by `make install`.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'difftool/util.c')
-rw-r--r-- | difftool/util.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/difftool/util.c b/difftool/util.c new file mode 100644 index 0000000..64ee7d4 --- /dev/null +++ b/difftool/util.c @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * util.c + * + * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at> + */ +#include "difftool.h" + +char *node_path(tree_node_t *n) +{ + char *path = fstree_get_path(n); + + if (path == NULL) { + perror("get path"); + return NULL; + } + + if (canonicalize_name(path)) { + fputs("[BUG] canonicalization of fstree_get_path failed!!\n", + stderr); + free(path); + return NULL; + } + + return path; +} |