diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-06 16:55:41 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-07 11:24:36 +0200 |
commit | 55914564db1ce7a4fc71e9dc34156aa144661d0d (patch) | |
tree | 2b981d86df104906c9c9b2bad5434d105a4cff5c /difftool/sqfsdiff.c | |
parent | d6149732b67fbedc7ac2d2ba984c07ab466392f1 (diff) |
Add flag to sqfsdiff to skip comparing filesystem contents
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'difftool/sqfsdiff.c')
-rw-r--r-- | difftool/sqfsdiff.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/difftool/sqfsdiff.c b/difftool/sqfsdiff.c index 2fc10a1..02de33a 100644 --- a/difftool/sqfsdiff.c +++ b/difftool/sqfsdiff.c @@ -9,31 +9,32 @@ static struct option long_opts[] = { { "no-owner", no_argument, NULL, 'O' }, { "no-permissions", no_argument, NULL, 'P' }, + { "no-contents", no_argument, NULL, 'C' }, { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, }; -static const char *short_opts = "OPhV"; +static const char *short_opts = "OPChV"; static const char *usagestr = "Usage: sqfsdiff [OPTIONS...] <first> <second>\n" "\n" -"Compare the contents of two squashfs images. In contrast to doing a direct\n" -"diff of the images, this actually recovers the file system trees and\n" -"recursively compares them against each other.\n" +"Compare two squashfs images. In contrast to doing a direct diff of the\n" +"images, this actually parses the filesystems and generates a more\n" +"meaningful difference report.\n" "\n" -"Any differences in packed file layout, ordering, compression, inode\n" -"allocation and so on is ignored, only the contents are compared.\n" -"\n" -"The two images are considered equal if each directory contains the same\n" -"entries, symlink with the same paths have the same targets, device nodes\n" -"the same device number and files the same size and contents.\n" +"If only contents are compared, any differences in packed file layout,\n" +"ordering, compression, inode allocation and so on is ignored and the two\n" +"images are considered equal if each directory contains the same entries,\n" +"symlink with the same paths have the same targets, device nodes the same\n" +"device number and files the same size and contents.\n" "\n" "A report of any difference is printed to stdout. The exit status is similar\n" "that of diff(1): 0 means equal, 1 means different, 2 means problem.\n" "\n" "Possible options:\n" "\n" +" --no-contents, -C Do not compare file contents.\n" " --no-owner, -O Do not compare file owners.\n" " --no-permissions, -P Do not compare permission bits.\n" "\n" @@ -63,6 +64,9 @@ static void process_options(int argc, char **argv) case 'P': compare_flags |= COMPARE_NO_PERM; break; + case 'C': + compare_flags |= COMPARE_NO_CONTENTS; + break; case 'h': fputs(usagestr, stdout); exit(EXIT_SUCCESS); |