1 module("luci.lpk", package.seeall)
2 require("luci.lpk.util")
3 require("luci.lpk.core")
5 __appname__ = "LuCI »lpk« Package Manager"
7 __authors__ = "Steven Barth, Jo-Philipp Wich"
8 __cpyrght__ = string.format("Copyright (c) 2008 %s", __authors__)
11 options, arguments = luci.lpk.util.getopt(arg)
12 config = luci.util.dtable()
13 machine = luci.lpk.core.Machine()
15 local cfgdump = loadfile("/etc/lpk.conf")
17 setfenv(cfgdump, config)
21 if #arguments < 1 then
22 luci.lpk.util.splash()
24 local task, error = machine:task(table.remove(arguments, 1),
28 local stat, error = task:perform()
30 luci.util.perror(error or task.register.errstr or "Unknown Error")
31 os.exit(task.register.error or 1)
34 luci.util.perror((error or "Unknown Error") .. "\n")
35 luci.lpk.util.splash()