posix = require "posix" command_consume=1 for _,pkg in ipairs(pkglist()) do verlist = pkgverlist(pkg) installed = nil nver = 0 for _,ver in ipairs(verlist) do if pkgvercur(pkg) == ver then -- print("already installed: " .. pkgname(pkg) .. "#" ..verstr(ver)) installed = 1 end nver = nver + 1 end if not installed and nver > 0 then pid = posix.fork() assert(pid >= 0) if pid == 0 then markinstall(pkg) if statinstbroken(pkg) then print("cannot install: " .. pkgname(pkg)) end os.exit(0) else posix.wait(pid) end end end