Switch default database to sqlite (#1818910)

Newly created databases will be sqlite unless overridden in configuration.

If BDB database is detected at %posttrans of rpm itself, it's flagged
for rebuild in the next reboot. This will serve two purposes: the primary
objective is obviously to convert to configured (ie sqlite) format,
but as a secondary side-effect, any remaining BDB databases will get
a much needed maintenance rebuild from time to time.
This commit is contained in:
Panu Matilainen 2020-05-07 09:15:38 +03:00
parent 82d52d2b3a
commit d451552090

View File

@ -25,7 +25,7 @@
%global rpmver 4.15.90 %global rpmver 4.15.90
%global snapver git14971 %global snapver git14971
%global rel 10 %global rel 11
%global srcver %{rpmver}%{?snapver:-%{snapver}} %global srcver %{rpmver}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:rpm-%(echo %{rpmver} | cut -d'.' -f1-2).x} %global srcdir %{?snapver:testing}%{!?snapver:rpm-%(echo %{rpmver} | cut -d'.' -f1-2).x}
@ -307,6 +307,11 @@ Requires: rpm-libs%{_isa} = %{version}-%{release}
ln -s db-%{bdbver} db ln -s db-%{bdbver} db
%endif %endif
# switch to sqlite db by default, including during build-time tests
%if %{with sqlite}
sed -i -e "/_db_backend/ s/ bdb/ sqlite/g" macros.in
%endif
%build %build
%set_build_flags %set_build_flags
@ -459,6 +464,11 @@ if [ -x /usr/bin/systemctl ]; then
systemctl --no-reload preset rpmdb-rebuild ||: systemctl --no-reload preset rpmdb-rebuild ||:
fi fi
%posttrans
if [ -f /var/lib/rpm/Packages ]; then
touch /var/lib/rpm/.rebuilddb
fi
%files libs %files libs
%{_libdir}/librpmio.so.* %{_libdir}/librpmio.so.*
%{_libdir}/librpm.so.* %{_libdir}/librpm.so.*
@ -541,6 +551,10 @@ fi
%doc doc/librpm/html/* %doc doc/librpm/html/*
%changelog %changelog
* Thu May 7 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.11
- Flag BDB databases for rebuild on next reboot whenever rpm is updated
- Switch default database to sqlite (#1818910)
* Mon May 4 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.10 * Mon May 4 2020 Panu Matilainen <pmatilai@redhat.com> - 4.15.90-0.git14971.10
- Handle rpmdb-rebuild service enablement for upgrades - Handle rpmdb-rebuild service enablement for upgrades