From Fedora Project Wiki
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.
Why not just remove *.rpmmoved in a %post?
Rather than the business of %ghost-ing the .rpmmoved dir, why not just remove it in a %post so that at the end of the package installation, it's gone and the old dir is replaced by the symlink?