Sophie

Sophie

distrib > Mageia > 4 > i586 > media > core-release > by-pkgid > 923cd204f71080a5daddc21965a01d80 > scriptlet

filesystem-2.1.9-21.mga4.i586.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", "/lib", "/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")