Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/rpm-ostree.git#4eb0bf4df25e85d9ec274638a9cf20f2521659ed
This commit is contained in:
DistroBaker 2021-01-26 16:02:39 +00:00
parent 577512d0e1
commit c0e31c2678
2 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,44 @@
From bc5a7883668dd3e1c9bc36858ffc47b9bca2e7ca Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Mon, 25 Jan 2021 15:35:18 -0500
Subject: [PATCH] core: Set _dbpath back to /usr/share/rpm after writing rpmdb
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:
https://github.com/openSUSE/libsolv/commit/04d4d036b275693a23eef75fba634e7cea2f1a6d
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: https://github.com/coreos/fedora-coreos-tracker/issues/723
---
src/libpriv/rpmostree-core.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/libpriv/rpmostree-core.cxx b/src/libpriv/rpmostree-core.cxx
index 4931390f..59483d4e 100644
--- a/src/libpriv/rpmostree-core.cxx
+++ b/src/libpriv/rpmostree-core.cxx
@@ -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)
{
--
2.29.2

View File

@ -4,12 +4,13 @@
Summary: Hybrid image/package system
Name: rpm-ostree
Version: 2021.1
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+
URL: https://github.com/coreos/rpm-ostree
# This tarball is generated via "cd packaging && make -f Makefile.dist-packaging dist-snapshot"
# in the upstream git. It also contains vendored Rust sources.
Source0: https://github.com/coreos/rpm-ostree/releases/download/v%{version}/rpm-ostree-%{version}.tar.xz
Patch0: 0001-core-Set-_dbpath-back-to-usr-share-rpm-after-writing.patch
ExclusiveArch: %{rust_arches}
@ -136,7 +137,8 @@ env NOCONFIGURE=1 ./autogen.sh
# Since we're hybrid C++/Rust we need to propagate this manually;
# the %%configure macro today assumes (reasonably) that one is building
# C/C++ and sets C{,XX}FLAGS
export RUSTFLAGS="%{build_rustflags}"
# FIXME: Disable this for now
#export RUSTFLAGS="%{build_rustflags}"
%configure --disable-silent-rules --enable-gtk-doc %{?sqlite_rpmdb_default}
%make_build
@ -201,6 +203,9 @@ $PYTHON autofiles.py > files.devel \
%files devel -f files.devel
%changelog
* Tue Jan 26 2021 Jonathan Lebon <jonathan@jlebon.com> - 2021.1-3
- Backport https://github.com/coreos/rpm-ostree/pull/2490 for rawhide
* Tue Jan 19 15:08:59 UTC 2021 Colin Walters <walters@verbum.org> - 2021.1-2
- https://github.com/coreos/rpm-ostree/releases/tag/v2021.1