add posttrans to rebuilddb

This commit is contained in:
rwx403335 2021-11-20 15:22:39 +08:00
parent b708f2c61a
commit a2c4e60a04

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.15.1
Release: 31
Release: 32
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -276,6 +276,19 @@ make check || (cat tests/rpmtests.log; exit 0)
%postun libs -p /sbin/ldconfig
%posttrans
{
dbpath=$(rpm -E %{_dbpath})
while [ -e ${dbpath}/Packages ]; do
date >> /var/log/rebuilddb.log 2>&1
rpmdb -vvv --rebuilddb >> /var/log/rebuilddb.log 2>&1
if [ $? -ne 0 ];then
echo "Automatic conversion db failed. Please run 'rpmdb --rebuilddb' manually." >> /var/log/rebuilddb.log
exit 1
fi
done
} &
%files -f %{name}.lang
%defattr(-,root,root)
%license COPYING
@ -372,6 +385,12 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Sat Nov 20 2021 renhongxun <renhongxun@huawei.com> - 4.15.1-32
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add posttrans to rebuilddb
* Thu Nov 18 2021 licunlong <licunlong1@huawei.com> - 4.15.1-31
- Type:bugfix
- ID:NA