Move pretrans scripts because RPM cannot handle their end properly otherwise

This commit is contained in:
Andrey Bondrov 2017-01-17 13:26:00 +10:00
parent bd4eea1ac8
commit 17ffbd1e0f

View file

@ -34,21 +34,6 @@ similar vein.
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py_puresitedir}/*
%pretrans -p <lua>
path = "%{py_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
#----------------------------------------------------------------------------
%package -n python3-%{module}
@ -80,21 +65,6 @@ similar vein.
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py3_puresitedir}/*
%pretrans -p <lua> -n python3-%{module}
path = "%{py3_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
#----------------------------------------------------------------------------
%prep
@ -143,3 +113,34 @@ cp %{SOURCE1} %{buildroot}/%{py3_puresitedir}/urllib3/packages/ssl_match_hostnam
popd
%pretrans -p <lua>
path = "%{py_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%pretrans -p <lua> -n python3-%{module}
path = "%{py3_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end