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:
parent
7ea074a84c
commit
5b11e9cbf8
17
exim.spec
17
exim.spec
@ -386,19 +386,16 @@ 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
|
||||||
moved_index = 0
|
suffix = 0
|
||||||
moved_path = path .. '.rpmmoved.' .. moved_index
|
|
||||||
status = os.rename(path, moved_path)
|
|
||||||
while not status do
|
while not status do
|
||||||
moved_index = moved_index + 1
|
suffix = suffix + 1
|
||||||
moved_path = path .. '.rpmmoved.' .. moved_index
|
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
|
||||||
status = os.rename(path, moved_path)
|
|
||||||
end
|
end
|
||||||
|
os.rename(path, path .. ".rpmmoved")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user