projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e068351
)
Publish luci.model.ipkg via JSON-RPC
author
Steven Barth
<steven@midlink.org>
Fri, 29 Aug 2008 15:54:13 +0000
(15:54 +0000)
committer
Steven Barth
<steven@midlink.org>
Fri, 29 Aug 2008 15:54:13 +0000
(15:54 +0000)
modules/rpc/luasrc/controller/rpc.lua
patch
|
blob
|
history
diff --git
a/modules/rpc/luasrc/controller/rpc.lua
b/modules/rpc/luasrc/controller/rpc.lua
index
0fcd263
..
fdfbdb3
100644
(file)
--- a/
modules/rpc/luasrc/controller/rpc.lua
+++ b/
modules/rpc/luasrc/controller/rpc.lua
@@
-45,6
+45,10
@@
function index()
fs.sysauth = "root"
fs.sysauth_authenticator = authenticator
fs.sysauth = "root"
fs.sysauth_authenticator = authenticator
+ fs = entry({"rpc", "ipkg"}, call("rpc_ipkg"))
+ fs.sysauth = "root"
+ fs.sysauth_authenticator = authenticator
+
uci = entry({"rpc", "auth"}, call("rpc_auth"))
end
uci = entry({"rpc", "auth"}, call("rpc_auth"))
end
@@
-135,3
+139,13
@@
function rpc_sys()
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
end
http.prepare_content("application/json")
ltn12.pump.all(jsonrpc.handle(sys, http.source()), http.write)
end
+
+function rpc_ipkg()
+ local ipkg = require "luci.model.ipkg"
+ local jsonrpc = require "luci.jsonrpc"
+ local http = require "luci.http"
+ local ltn12 = require "luci.ltn12"
+
+ http.prepare_content("application/json")
+ ltn12.pump.all(jsonrpc.handle(ipkg, http.source()), http.write)
+end