]> err.no Git - gant/commitdiff
Only download new files master
authorTollef Fog Heen <tfheen@err.no>
Sun, 22 Apr 2012 13:16:03 +0000 (15:16 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sun, 22 Apr 2012 13:16:03 +0000 (15:16 +0200)
fr60.c

diff --git a/fr60.c b/fr60.c
index 5c6374883d03d173af91f309db5d509e48ab1b0d..ead430e3053815a66cc9c8397a3216dfc0f55160 100644 (file)
--- 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();