summaryrefslogtreecommitdiff
path: root/unpack/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-19 15:43:15 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-19 15:58:39 +0200
commit076c1cdb95c12e2b5bf8de33c9d53d93f35ae1c6 (patch)
tree817c3d4c1a3f1bdee88d5f5831a79cf8d5c1049b /unpack/options.c
parent4943dd85a9190f4477bd5e98a83be1f5e2790d8d (diff)
Add rdsquashfs flag to restore file timestamps
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/options.c')
-rw-r--r--unpack/options.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/unpack/options.c b/unpack/options.c
index 594b610..e880656 100644
--- a/unpack/options.c
+++ b/unpack/options.c
@@ -21,6 +21,7 @@ static struct option long_opts[] = {
#ifdef HAVE_SYS_XATTR_H
{ "set-xattr", no_argument, NULL, 'X' },
#endif
+ { "set-times", no_argument, NULL, 'T' },
{ "jobs", required_argument, NULL, 'j' },
{ "describe", no_argument, NULL, 'd' },
{ "chmod", no_argument, NULL, 'C' },
@@ -31,7 +32,7 @@ static struct option long_opts[] = {
};
static const char *short_opts =
- "l:c:u:p:x:DSFLCOEZj:dqhV"
+ "l:c:u:p:x:DSFLCOEZTj:dqhV"
#ifdef HAVE_SYS_XATTR_H
"X"
#endif
@@ -71,6 +72,8 @@ static const char *help_string =
" --set-xattr, -X When unpacking files to disk, set the extended\n"
" attributes from the squashfs image.\n"
#endif
+" --set-times, -T When unpacking files to disk, set the create\n"
+" and modify timestamps from the squashfs image.\n"
" --jobs, -j <count> Number of parallel unpacking jobs to start.\n"
" --chmod, -C Change permission flags of unpacked files to\n"
" those store in the squashfs image.\n"
@@ -153,6 +156,9 @@ void process_command_line(options_t *opt, int argc, char **argv)
opt->rdtree_flags |= RDTREE_READ_XATTR;
break;
#endif
+ case 'T':
+ opt->flags |= UNPACK_SET_TIMES;
+ break;
case 'j':
for (j = 0; optarg[j] != '\0'; ++j) {
if (j > 6 || !isdigit(optarg[j]))