!9 revert Solution to the failure of SUT full upgrade

From: @tong_1001
Reviewed-by: @openeuler-basic
Signed-off-by: @openeuler-basic
This commit is contained in:
openeuler-ci-bot 2021-06-11 07:31:56 +00:00 committed by Gitee
commit 82107936f2

View File

@ -2,7 +2,7 @@
Name: logrotate
Version: 3.16.0
Release: 2
Release: 3
Summary: simplify the administration of log files
License: GPLv2+
Url: https://github.com/logrotate/logrotate
@ -42,21 +42,6 @@ install -p -m 755 examples/logrotate.cron %{buildroot}%{_sysconfdir}/cron.daily/
%make_build -C build check
%pre
# Delete file and package upgrades concurrently, Cause the upgrade to fail.
# so, empty file instead of deleting file
if [ -f /etc/cron.hourly/logrotate ];then
sed -i s/'^if[[:blank:]]*\[[[:blank:]]*-f[[:blank:]]*\/etc\/logrotate.d\/wtmp[[:blank:]]*\];then$'/'if \[ -s \/etc\/logrotate.d\/wtmp \];then'/g /etc/cron.hourly/logrotate
sed -i s/'^[[:blank:]]*rm[[:blank:]]*-f[[:blank:]]*\/etc\/logrotate.d\/wtmp$'/' > \/etc\/logrotate.d\/wtmp'/g /etc/cron.hourly/logrotate
sed -i s/'^if[[:blank:]]*\[[[:blank:]]*-f[[:blank:]]*\/etc\/logrotate.d\/btmp[[:blank:]]*\];then$'/'if \[ -s \/etc\/logrotate.d\/btmp \];then'/g /etc/cron.hourly/logrotate
sed -i s/'^[[:blank:]]*rm[[:blank:]]*-f[[:blank:]]*\/etc\/logrotate.d\/btmp$'/' > \/etc\/logrotate.d\/btmp'/g /etc/cron.hourly/logrotate
# Delay 2s, wait for /etc/cron.hourly/logrotate delete file execution to complete
sleep 2
touch /etc/logrotate.d/wtmp
chmod 644 /etc/logrotate.d/wtmp
touch /etc/logrotate.d/btmp
chmod 644 /etc/logrotate.d/btmp
fi
# create it and copy the /var/lib/logrotate.status in it.
if [ ! -d %{_localstatedir}/lib/logrotate/ -a -f %{_localstatedir}/lib/logrotate.status ]; then
mkdir -p %{_localstatedir}/lib/logrotate
@ -88,6 +73,12 @@ fi
%{_mandir}/man5/logrotate.conf.5*
%changelog
* Fri Jun 11 2021 shixuantong <shixuantong@huawei.com> - 3.16.0-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:revert Solution to the failure of SUT full upgrade
* Fri Jun 11 2021 shixuantong <shixuantong@huawei.com> - 3.16.0-2
- Type:bugfix
- CVE:NA