From Fedora Project Wiki

Revision as of 07:35, 7 October 2015 by Luhliarik (talk | contribs) (Created page with "Hi, I'm suggesting to change scriptlet on the page, to more universal sriptlet: %pretrans -p <lua> -- Due to a bug #447156 paths = {"/usr/share/squid/errors/zh-cn", "/usr/sh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Hi,

I'm suggesting to change scriptlet on the page, to more universal sriptlet:

%pretrans -p <lua> -- Due to a bug #447156 paths = {"/usr/share/squid/errors/zh-cn", "/usr/share/squid/errors/zh-tw"} for key,path in ipairs(paths) do

 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

end

This scriptlet fixes 2 and more symlinks, because array is used, but if you leave just 1 member in array, then the same result as with variable is done.