Skip to content

Commit

Permalink
core: Set _dbpath back to /usr/share/rpm after writing rpmdb
Browse files Browse the repository at this point in the history
We temporarily set the rpmdb path to be an absolute path pointing under
the tmprootfs when writing the rpmdb. This throws off libsolv 0.7.17,
which learned to give the `_dbpath` macro precedence on where the rpmdb
is located:

openSUSE/libsolv@04d4d03

So then the rpmdb sanity-check we do when exiting
`rpmostree_context_assemble()` breaks because it can't find the expected
packages.

Because RPM macros are in global state, there's no elegant way of
setting it just for the rpmdb write operation (short of forking), so
just fix this by setting `_dbpath` back to the correct value after we're
done writing the rpmdb.

Closes: coreos/fedora-coreos-tracker#723
  • Loading branch information
jlebon authored and openshift-merge-robot committed Jan 25, 2021
1 parent 49318cd commit bc5a788
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libpriv/rpmostree-core.cxx
Expand Up @@ -4668,6 +4668,10 @@ rpmostree_context_assemble (RpmOstreeContext *self,

rpmostree_output_progress_end (&task);

/* And finally revert the _dbpath setting because libsolv relies on it as well
* to find the rpmdb and RPM macros are global state. */
set_rpm_macro_define ("_dbpath", "/" RPMOSTREE_RPMDB_LOCATION);

/* And now also sanity check the rpmdb */
if (!skip_sanity_check)
{
Expand Down

0 comments on commit bc5a788

Please sign in to comment.