From 83e305a948a194deef95d2963f1e7c1de0996b36 Mon Sep 17 00:00:00 2001 From: renxichen Date: Tue, 5 Sep 2023 16:54:22 +0800 Subject: [PATCH] Fix the coredump which may occur during upgrading of rpm --- rpm.spec | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rpm.spec b/rpm.spec index 0771e72..02108cb 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.15.1 -Release: 52 +Release: 53 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -352,6 +352,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 @@ -492,6 +505,9 @@ make check || (cat tests/rpmtests.log; exit 0) %{_mandir}/man1/gendiff.1* %changelog +* Tue Sep 05 2023 renhongxun - 4.15.1-53 +- Fix the coredump which may occur during upgrading of rpm + * Tue Aug 29 2023 renhongxun - 4.15.1-52 - Check inside --root when querying for files