From: Tollef Fog Heen Date: Sun, 22 Apr 2012 13:16:03 +0000 (+0200) Subject: Only download new files X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ee105a0f38c714e25fa04f27951bbc2992bdbe;p=gant Only download new files --- diff --git a/fr60.c b/fr60.c index 5c63748..ead430e 100644 --- a/fr60.c +++ b/fr60.c @@ -55,6 +55,7 @@ static int dl_s_fn = -1; static int dl_s_offset = -1; static int dl_s_crc = -1; static int sentid = 0; +static int dl_all = 0; static uint mydev = 0; static uint peerdev; @@ -417,6 +418,10 @@ static int interesting_file(struct antfs_dir_entry *e) { e->subfiletype == SF_FIT_WORKOUT ))) return 0; + if (e->flags & FFLAG_ARCHIVE && dl_all == 0) { + return 0; + } + format_time(ts, FIT_TIMESTAMP_PATTERN, 256, e->last_modified); sprintf(filename, FIT_FILE_NAME_PATTERN, ts); if (stat(filename, &statbuf) == 0 && @@ -917,7 +922,7 @@ main(int ac, char *av[]) sprintf(authfile, "%s/.gant", getenv("HOME")); } progname = av[0]; - while ((c = getopt(ac, av, "l:a:d:i:m:PpvDrnzf:")) != -1) { + while ((c = getopt(ac, av, "l:a:d:i:m:PpvDrnzf:E")) != -1) { switch(c) { case 'a': authfile = optarg; @@ -958,6 +963,9 @@ main(int ac, char *av[]) case 'z': nopairing = 1; break; + case 'E': + dl_all = 1; + break; default: fprintf(stderr, "unknown option %s\n", optarg); usage();