[recipes] Avoid downloading the same data over and over



commit 76d877cc978a55eb65007032bb2dc8aba0232d7d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 16 09:46:33 2017 -0400

    Avoid downloading the same data over and over
    
    We are downloading the data as an archive, but we check the
    timestamp of an extracted file. So we have to tell tar not
    to extract the timestamps of files, so that they get the
    timestamp from when the archive was extracted. Otherwise,
    the newly extracted file will appear old, causing us to
    download the same data again, next time.

 src/gr-recipe-store.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index 1a5db9f..2bc77c0 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -1072,7 +1072,7 @@ save_file (SoupSession *session,
         GrRecipeStore *self = data;
         const char *cache_dir;
         g_autofree char *filename = NULL;
-        const char *argv[5];
+        const char *argv[6];
         g_autofree char *cmdline = NULL;
         g_autoptr(GSubprocess) subprocess = NULL;
         g_autoptr(GSubprocessLauncher) launcher = NULL;
@@ -1109,7 +1109,8 @@ save_file (SoupSession *session,
         argv[1] = "-xf";
         argv[2] = "data.tar.gz";
         argv[3] = "--overwrite";
-        argv[4] = NULL;
+        argv[4] = "--touch";
+        argv[5] = NULL;
 
         // FIXME use libarchive instead
         g_debug ("Running %s", cmdline = g_strjoinv (" ", (char **)argv));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]