diff options
author | Colin Walters <walters@verbum.org> | 2014-03-31 14:41:13 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-03-31 14:41:13 -0400 |
commit | 913337c557d0be9a3b7b7f5251a5d12a33a5a937 (patch) | |
tree | d91f8c5f67fd8aef0c057312ea72e1d117134920 /src/libostree/ostree-sysroot-upgrader.c | |
parent | 1fd01077a5d29736e2d98e49a1664db251efd8ce (diff) | |
download | ostree-913337c557d0be9a3b7b7f5251a5d12a33a5a937.tar.gz |
sysroot-upgrader: Check merge deployment, not ref for differences
Otherwise this broke atomicity; we could fetch/store the ref, then
crash, and then not upgrade the next time we tried upgrading.
The correct model is: the tree has changed if the new ref is different
from the merge deployment.
Diffstat (limited to 'src/libostree/ostree-sysroot-upgrader.c')
-rw-r--r-- | src/libostree/ostree-sysroot-upgrader.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libostree/ostree-sysroot-upgrader.c b/src/libostree/ostree-sysroot-upgrader.c index b95c448d..c262f2b8 100644 --- a/src/libostree/ostree-sysroot-upgrader.c +++ b/src/libostree/ostree-sysroot-upgrader.c @@ -431,7 +431,7 @@ ostree_sysroot_upgrader_pull (OstreeSysrootUpgrader *self, gboolean ret = FALSE; gs_unref_object OstreeRepo *repo = NULL; char *refs_to_fetch[] = { self->origin_ref, NULL }; - gs_free char *from_revision = NULL; + const char *from_revision = NULL; gs_free char *new_revision = NULL; gs_free char *origin_refspec = NULL; @@ -443,9 +443,8 @@ ostree_sysroot_upgrader_pull (OstreeSysrootUpgrader *self, else origin_refspec = g_strdup (self->origin_ref); - if (!ostree_repo_resolve_rev (repo, origin_refspec, TRUE, &from_revision, - error)) - goto out; + g_assert (self->merge_deployment); + from_revision = ostree_deployment_get_csum (self->merge_deployment); if (self->origin_remote) { |