[ostree] summary: delete summary.sig on an update



commit 70d9599246e640c011ddf0cf0e38e2a76671e722
Author: Giuseppe Scrivano <gscrivan redhat com>
Date:   Mon May 4 11:05:23 2015 +0200

    summary: delete summary.sig on an update
    
    Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>

 src/libostree/ostree-repo.c |    9 +++++++++
 tests/test-auto-summary.sh  |    5 +++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index c0313fe..4d8a733 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -3704,6 +3704,15 @@ ostree_repo_regenerate_summary (OstreeRepo     *self,
                                            error))
     goto out;
 
+  if (unlinkat (self->repo_dir_fd, "summary.sig", 0) < 0)
+    {
+      if (errno != ENOENT)
+        {
+          gs_set_error_from_errno (error, errno);
+          goto out;
+        }
+    }
+
   ret = TRUE;
  out:
   if (ordered_keys)
diff --git a/tests/test-auto-summary.sh b/tests/test-auto-summary.sh
index 0998b1e..2452e55 100755
--- a/tests/test-auto-summary.sh
+++ b/tests/test-auto-summary.sh
@@ -53,3 +53,8 @@ ${CMD_PREFIX} $OSTREE commit -b test -s "Another commit..." test
 echo "ok commit 3"
 
 assert_not_streq "$OLD_MD5" "$(md5sum repo/summary)"
+
+# Check that summary --update deletes the .sig file
+touch repo/summary.sig
+${CMD_PREFIX} $OSTREE summary --update
+assert_not_has_file repo/summary.sig


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