pull: Don't save into cache passed in GByte summaries
authorAlexander Larsson <alexl@redhat.com>
Tue, 3 Nov 2020 10:48:33 +0000 (11:48 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 3 Nov 2020 10:48:33 +0000 (11:48 +0100)
The cache shouldn't be affected by the user passing in some other
summary as it may not be the "official one".

I ran into this in flatpak where the passed summary was correct, but
the re-saving of the cache updated the mtime of the cached file which
led to later http If-Modified-Since calls failing to update.

src/libostree/ostree-repo-pull.c

index da421db3833aed5ba30293d40425ac3007faef22..758c5054dee259923ef9b87047ba6ba1d22dfa7f 100644 (file)
@@ -4545,7 +4545,7 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
             }
         }
 
-      if (!summary_from_cache && bytes_summary && bytes_sig)
+      if (!summary_from_cache && bytes_summary && bytes_sig && summary_sig_bytes_v == NULL)
         {
           if (!pull_data->remote_repo_local &&
               !_ostree_repo_cache_summary (self,