SHA256
1
0
forked from pool/exim

Accepting request 807311 from home:pwcau:branches:server:mail

- switch pretrans to use lua
  (fixes bsc#1171877)

OBS-URL: https://build.opensuse.org/request/show/807311
OBS-URL: https://build.opensuse.org/package/show/server:mail/exim?expand=0&rev=237
This commit is contained in:
Peter Wullinger 2020-05-19 12:51:17 +00:00 committed by Git OBS Bridge
parent 0590ab6476
commit 7ea074a84c
2 changed files with 22 additions and 16 deletions

View File

@ -1,5 +1,7 @@
Tue May 19 13:47:05 CEST 2020 - wullinger@rz.uni-kiel.de
- pre-require bash for pretrans
- switch pretrans to use lua
(fixes bsc#1171877)
-------------------------------------------------------------------
Tue May 12 08:19:17 UTC 2020 - wullinger@rz.uni-kiel.de
- bring changes from current in +fixes branch

View File

@ -71,7 +71,6 @@ Requires(pre): user(mail)
Requires(pre): group(mail)
%endif
Requires(pre): fileutils textutils
Requires(pre): bash
%endif
Version: 4.93.0.4
Release: 4
@ -383,20 +382,25 @@ install -m 0755 $RPM_SOURCE_DIR/eximstats-html-update.py $RPM_BUILD_ROOT/%{_sbin
# apparmor profile
install -D -m 0644 $RPM_SOURCE_DIR/apparmor.usr.sbin.exim $RPM_BUILD_ROOT/usr/share/apparmor/extra-profiles/usr.sbin.exim
%pretrans
if [ -d "%{_docdir}/%{name}/doc/cve-2019-13917" ]; then
moved_suffix=""
moved_index=""
while [ -d "%{_docdir}/%{name}/doc/cve-2019-13917.rpmmoved${moved_suffix}${moved_index}" ]; do
if [ -z "${moved_suffix}" ]; then
moved_suffix="."
moved_index="0"
else
moved_index=$((${moved_index} + 1))
fi
done
mv "%{_docdir}/%{name}/doc/cve-2019-13917" "%{_docdir}/%{name}/doc/cve-2019-13917.rpmmoved${moved_suffix}${moved_index}"
fi
%pretrans -p <lua>
docdir = rpm.expand('%{_docdir}')
pkgname = rpm.expand('%{name}')
path = docdir .. '/' .. pkgname .. '/doc/cve-2019-13917'
st_path = posix.stat(path)
if st_path then
moved_path = path .. '.rpmmoved'
status = os.rename(path, moved_path)
if not status then
moved_index = 0
moved_path = path .. '.rpmmoved.' .. moved_index
status = os.rename(path, moved_path)
while not status do
moved_index = moved_index + 1
moved_path = path .. '.rpmmoved.' .. moved_index
status = os.rename(path, moved_path)
end
end
end
%pre
%if 0%{?suse_version} > 1220