diff --git a/rpm.spec b/rpm.spec index 39a233c4434029336caf3892ffedde62f760f0d6..966a8856a46136e20928a25cb424e82942196d5d 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 %define _legacy_common_support 1 # build against xz? %bcond_without xz @@ -24,7 +24,7 @@ %bcond_without sqlite # build with bdb_ro support? # if enabled, rpmdb is switched to sqlite -%bcond_with bdb_ro +%bcond_without bdb_ro %if 0%{?rhel} > 7 || 0%{?anolis} # Disable python2 build by default @@ -600,15 +600,26 @@ make check || cat tests/rpmtests.log %if %{with bdb_ro} %pre # Only update -if [ $1 == 2 ] -then - [ -e /var/lib/rpm/.rpm.lock ] && rm -f /var/lib/rpm/.rpm.lock - [ `rpm --eval "%_db_backend"` == "bdb" ] && rpmdb --exportdb > /var/lib/rpm_bdb_bak +if [ $1 == 2 ]; then + if [ -e /var/lib/rpm/.rpm.lock ]; then + rm -f /var/lib/rpm/.rpm.lock + fi + current_db=`rpm --eval "%_db_backend"` + if [ "$current_db" == "bdb" ]; then + rpmdb --exportdb > /var/lib/rpm_bdb_bak || : + fi fi %posttrans -[ -e /var/lib/rpm/.rpm.lock ] && rm -f /var/lib/rpm/.rpm.lock -rpm -q rpm 2>&1 | grep bdb && rpmdb --rebuilddb +if [ -e /var/lib/rpm/.rpm.lock ]; then + rm -f /var/lib/rpm/.rpm.lock +fi + +rpm -q rpm 2>&1 | grep bdb +if [ $? -eq 0 ]; then + rpmdb --rebuilddb +fi + %endif %post libs -p /sbin/ldconfig @@ -756,6 +767,9 @@ rpm -q rpm 2>&1 | grep bdb && rpmdb --rebuilddb %doc doc/librpm/html/* %changelog +* Tue May 27 2025 happy_orange - 4.14.4-32.0.2 +- switch rpmdb to sqlite + * Tue Dec 24 2024 Liwei Ge - 4.14.4-32.0.1 - Rebrand for Anolis OS - Fix gcc10 -fno-common compile issue for compatible with gcc10 build