Solution to the failure of SUT full upgrade
This commit is contained in:
parent
c54d1bf36f
commit
a85c20b5e5
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: logrotate
|
Name: logrotate
|
||||||
Version: 3.16.0
|
Version: 3.16.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: simplify the administration of log files
|
Summary: simplify the administration of log files
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Url: https://github.com/logrotate/logrotate
|
Url: https://github.com/logrotate/logrotate
|
||||||
@ -42,6 +42,21 @@ install -p -m 755 examples/logrotate.cron %{buildroot}%{_sysconfdir}/cron.daily/
|
|||||||
%make_build -C build check
|
%make_build -C build check
|
||||||
|
|
||||||
%pre
|
%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.
|
# create it and copy the /var/lib/logrotate.status in it.
|
||||||
if [ ! -d %{_localstatedir}/lib/logrotate/ -a -f %{_localstatedir}/lib/logrotate.status ]; then
|
if [ ! -d %{_localstatedir}/lib/logrotate/ -a -f %{_localstatedir}/lib/logrotate.status ]; then
|
||||||
mkdir -p %{_localstatedir}/lib/logrotate
|
mkdir -p %{_localstatedir}/lib/logrotate
|
||||||
@ -73,6 +88,12 @@ fi
|
|||||||
%{_mandir}/man5/logrotate.conf.5*
|
%{_mandir}/man5/logrotate.conf.5*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jun 11 2021 shixuantong <shixuantong@huawei.com> - 3.16.0-2
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:Solution to the failure of SUT full upgrade
|
||||||
|
|
||||||
* Fri Apr 24 2020 BruceGW <gyl93216@163.com> - 3.16.0-1
|
* Fri Apr 24 2020 BruceGW <gyl93216@163.com> - 3.16.0-1
|
||||||
- update upstream to 3.16.0
|
- update upstream to 3.16.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user