!274 [sync] PR-271: support _disable_auto_rebuilddb macro in posttrans

From: @openeuler-sync-bot 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
This commit is contained in:
openeuler-ci-bot 2023-09-11 02:12:22 +00:00 committed by Gitee
commit a12d66f74d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.17.0
Release: 29
Release: 30
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -301,12 +301,15 @@ make check || (cat tests/rpmtests.log; exit 0)
%posttrans
{
set -e
dbpath=$(rpm -E %{_dbpath})
while [ -e ${dbpath}/Packages ]
do
date >> /var/log/rebuilddb.log 2>&1
rpm -vvv --rebuilddb >> /var/log/rebuilddb.log 2>&1
done
disable_auto_rebuilddb=$(rpm -E 0%%{?_disable_auto_rebuilddb})
if [ ${disable_auto_rebuilddb} -eq 0 ]; then
dbpath=$(rpm -E %{_dbpath})
while [ -e ${dbpath}/Packages ]
do
date >> /var/log/rebuilddb.log 2>&1
rpm -vvv --rebuilddb >> /var/log/rebuilddb.log 2>&1
done
fi
} &
%files -f %{name}.lang
@ -400,6 +403,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Fri Sep 08 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-30
- support _disable_auto_rebuilddb macro in posttrans
* Tue Sep 05 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-29
- Fix the coredump which may occur during upgrading of rpm