Skip to content

Commit

Permalink
origin: Switch baserefspec → refspec when de-layering
Browse files Browse the repository at this point in the history
The idea originally was that we'd switch to `baserefspec` when
performing changes such that `ostree admin upgrade` would no longer
work.  But that has long since been buggy since the introduction
of things like `rpm-ostree initramfs --enable` etc.

The only goal of this PR is to avoid "leaking state" across
origin switches, so that the work to map origin ⇔ treefile
can also (correctly) be stateless.
  • Loading branch information
cgwalters committed Jun 7, 2021
1 parent df9d9f3 commit 3f3348f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/libpriv/rpmostree-origin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,15 @@ update_keyfile_pkgs_from_cache (RpmOstreeOrigin *origin,

if (g_hash_table_size (pkgs) > 0)
{
switch (origin->refspec_type)
{
case RPMOSTREE_REFSPEC_TYPE_OSTREE:
case RPMOSTREE_REFSPEC_TYPE_CHECKSUM:
{
g_key_file_set_value (origin->kf, "origin", "baserefspec",
origin->cached_refspec);
g_key_file_remove_key (origin->kf, "origin", "refspec", NULL);
break;
}
}
g_key_file_set_value (origin->kf, "origin", "baserefspec",
origin->cached_refspec);
g_key_file_remove_key (origin->kf, "origin", "refspec", NULL);
}
else
{
g_key_file_set_value (origin->kf, "origin", "refspec",
origin->cached_refspec);
g_key_file_remove_key (origin->kf, "origin", "baserefspec", NULL);
}
}

Expand Down

0 comments on commit 3f3348f

Please sign in to comment.