Skip to content

Commit

Permalink
Implement basic check for container updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarmtemp committed Jun 28, 2023
1 parent 7ad41b6 commit b20963b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/daemon/rpmostree-sysroot-upgrader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,28 @@ rpmostree_sysroot_upgrader_pull_base (RpmOstreeSysrootUpgrader *self, const char
if (override_commit)
return glnx_throw (error, "Specifying commit overrides for container-image-reference "
"type refspecs is not supported");
if (check)
return glnx_throw (error, "Cannot currently check for updates without downloading");

CXX_TRY_VAR (import,
rpmostreecxx::pull_container (*self->repo, *cancellable, r.refspec.c_str ()),
error);
new_base_rev = g_strdup (import->merge_commit.c_str ());

if (check)
{
// return glnx_throw (error, "Cannot currently check for updates without downloading");
gboolean changed = !g_str_equal (new_base_rev, self->base_revision);
if (changed)
{
rpmostree_output_message ("Difference in commits detected");
}
else
{
rpmostree_output_message ("No updates available. Commits are the same");
}

*out_changed = changed;
return TRUE;
}
break;
}
case rpmostreecxx::RefspecType::Checksum:
Expand Down

0 comments on commit b20963b

Please sign in to comment.