SHA256
1
0
forked from pool/exim

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

cleanup pretrans lua. Instead of re-inventing the wheel, use the suggested pretrans from fedora: https://fedoraproject.org/wiki/Packaging:Directory_Replacement#Scriptlet_to_replace_a_directory

OBS-URL: https://build.opensuse.org/request/show/807582
OBS-URL: https://build.opensuse.org/package/show/server:mail/exim?expand=0&rev=238
This commit is contained in:
Peter Wullinger 2020-05-20 11:08:36 +00:00 committed by Git OBS Bridge
parent 7ea074a84c
commit 5b11e9cbf8

View File

@ -386,20 +386,17 @@ install -D -m 0644 $RPM_SOURCE_DIR/apparmor.usr.sbin.exim $RPM_BUILD_ROOT/usr/sh
docdir = rpm.expand('%{_docdir}') docdir = rpm.expand('%{_docdir}')
pkgname = rpm.expand('%{name}') pkgname = rpm.expand('%{name}')
path = docdir .. '/' .. pkgname .. '/doc/cve-2019-13917' path = docdir .. '/' .. pkgname .. '/doc/cve-2019-13917'
st_path = posix.stat(path) st = posix.stat(path)
if st_path then if st and st.type == "directory" then
moved_path = path .. '.rpmmoved' status = os.rename(path, path .. ".rpmmoved")
status = os.rename(path, moved_path) if not status then
if not status then suffix = 0
moved_index = 0 while not status do
moved_path = path .. '.rpmmoved.' .. moved_index suffix = suffix + 1
status = os.rename(path, moved_path) status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
while not status do
moved_index = moved_index + 1
moved_path = path .. '.rpmmoved.' .. moved_index
status = os.rename(path, moved_path)
end
end end
os.rename(path, path .. ".rpmmoved")
end
end end
%pre %pre