Fix the coredump which may occur during upgrading of rpm

(cherry picked from commit af35335a9d654b4a664434ead2b622f4ef1fd23b)
This commit is contained in:
renxichen 2023-09-05 16:45:45 +08:00 committed by openeuler-sync-bot
parent 6ff98ed528
commit c1aea29ce4

View File

@ -1,6 +1,6 @@
Name: rpm
Version: 4.17.0
Release: 28
Release: 29
Summary: RPM Package Manager
License: GPLv2+
URL: http://www.rpm.org/
@ -247,6 +247,19 @@ popd
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
# During the upgrade of the major rpm version, the dynamic library may not be compatible.
# Therefore, ensure that no other rpm command is executed during the upgrade. A judgment
# is added to the RPM script of the scheduled task. If the dynamic library is not the
# dynamic library of the current version, exits directly.
pushd ${RPM_BUILD_ROOT}%{_libdir}
export SONAME=`ls librpm.so.*.*.*`
popd
sed -i "/bin\/sh/a \
if [ ! -e %{_libdir}\/${SONAME} ]; then\n\
exit 0\n\
fi" ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
cp ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm ${RPM_BUILD_ROOT}%{_rpmconfigdir}/rpm.daily
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/rpm
@ -387,6 +400,9 @@ make check || (cat tests/rpmtests.log; exit 0)
%{_mandir}/man1/gendiff.1*
%changelog
* Tue Sep 05 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-29
- Fix the coredump which may occur during upgrading of rpm
* Tue Aug 29 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-28
- Check inside --root when querying for files