56f62f0ca74607fb867ff5d6cb5b0f932265d6d1
[project/luci.git] / libs / lpk / luasrc / lpk.lua
1 module("luci.lpk", package.seeall)
2 require("luci.lpk.util")
3 require("luci.lpk.core")
4
5 __appname__ = "LuCI »lpk« Package Manager"
6 __version__ = "0.1"
7 __authors__ = "Steven Barth, Jo-Philipp Wich"
8 __cpyrght__ = string.format("Copyright (c) 2008 %s", __authors__)
9 __welcome__ = string.format("%s v%s\n%s",
10  __appname__, __version__, __cpyrght__)
11  
12
13 options, arguments = luci.lpk.util.getopt(arg)
14 config = luci.util.dtable()
15
16 local cfgdump = loadfile("/etc/lpk.conf")
17 if cfgdump then
18         setfenv(cfgdump, config)
19         pcall(cfgdump)
20 end
21
22 if #arguments < 1 then
23         print(__welcome__)
24         print([[
25         
26 Usage:
27  lpk [options] <command> [arguments]
28  lpk [options] install|remove pkg1 [pkg2] [...] [pkgn]
29
30 Commands:
31  install        -       Install packages
32  remove         -       Remove packages
33  purge          -       Remove packages and their configuration files
34  
35 Options:
36  --force-depends        -       Ignore unresolvable dependencies
37 ]])
38 else
39         -- Start machine
40 end
41
42
43