Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 037e67bf19fd519618d9b4da349b9828 > scriptlet

filesystem-2.1.9-25.1.mga5.x86_64.rpm

PRETRANS

<lua>
--#
--# If we are running in pretrans in a fresh root, there is no /usr and symlinks.
--# We cannot be sure, to be the very first rpm in the transaction list,
--# so, let's create the toplevel symlinks here and the directories they point to.
--# When our rpm is unpacked by cpio, it will set all permissions and modes later.
--#

if posix.stat("/usr") == nil then
    posix.mkdir("/usr")
end

for i,dir in ipairs({"/lib", "/lib64", "/sbin", "/bin"}) do
    if posix.stat("/usr"..dir) == nil then
        posix.mkdir("/usr"..dir)
        if posix.stat(dir, "mode") == nil then
            posix.symlink("usr"..dir, dir)
        end
    end
end

return 0

POSTIN

<lua>
posix.symlink("../run", "/var/run")
posix.symlink("../run/lock", "/var/lock")