From da68672501193c43a894db878fcfb874190841a7 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Thu, 30 Jul 2015 14:14:48 -0700 Subject: [PATCH] Add --creationtime --- tar/bsdtar.c | 9 +++++++++ tar/bsdtar.h | 1 + tar/cmdline.c | 1 + 3 files changed, 11 insertions(+) diff --git a/tar/bsdtar.c b/tar/bsdtar.c index 6986bfd0..9ffb1978 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -292,6 +292,15 @@ main(int argc, char **argv) bsdtar->configfiles[bsdtar->nconfigfiles++] = bsdtar->optarg; break; + case OPTION_CREATIONTIME: /* tarsnap */ + errno = 0; + bsdtar->creationtime = strtol(bsdtar->optarg, + NULL, 0); + if ((errno) || (bsdtar->creationtime == 0)) + bsdtar_errc(bsdtar, 1, 0, + "Invalid --creationtime argument: %s", + bsdtar->optarg); + break; case 'd': /* multitar */ set_mode(bsdtar, opt, "-d"); break; diff --git a/tar/bsdtar.h b/tar/bsdtar.h index fe02a34f..82cd7e86 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -164,6 +164,7 @@ enum { OPTION_CHECKPOINT_BYTES, OPTION_CHROOT, OPTION_CONFIGFILE, + OPTION_CREATIONTIME, OPTION_DISK_PAUSE, OPTION_DRYRUN, OPTION_EXCLUDE, diff --git a/tar/cmdline.c b/tar/cmdline.c index f44a7fe9..0441dbee 100644 --- a/tar/cmdline.c +++ b/tar/cmdline.c @@ -77,6 +77,7 @@ static struct option { { "configfile", 1, OPTION_CONFIGFILE }, { "confirmation", 0, 'w' }, { "create", 0, 'c' }, + { "creationtime", 1, OPTION_CREATIONTIME }, { "dereference", 0, 'L' }, { "directory", 1, 'C' }, { "disk-pause", 1, OPTION_DISK_PAUSE },