Implement describe
This commit is contained in:
parent
4139b4f3c0
commit
3d1d3b622c
@ -1 +1 @@
|
|||||||
0.3.7
|
0.4.0
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{application,zx,
|
{application,zx,
|
||||||
[{description,[]},
|
[{description,[]},
|
||||||
{vsn,"0.3.7"},
|
{vsn,"0.4.0"},
|
||||||
{applications,[stdlib,kernel]},
|
{applications,[stdlib,kernel]},
|
||||||
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
|
||||||
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,
|
||||||
@ -24,7 +24,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx).
|
-module(zx).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(application).
|
-behavior(application).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_auth).
|
-module(zx_auth).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -7,7 +7,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_conn).
|
-module(zx_conn).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -285,7 +285,6 @@ dispatch(Socket, ID, Action) ->
|
|||||||
{list, R, N, V} -> send_query(Socket, 4, {R, N, V});
|
{list, R, N, V} -> send_query(Socket, 4, {R, N, V});
|
||||||
{latest, R, N} -> send_query(Socket, 5, {R, N});
|
{latest, R, N} -> send_query(Socket, 5, {R, N});
|
||||||
{latest, R, N, V} -> send_query(Socket, 5, {R, N, V});
|
{latest, R, N, V} -> send_query(Socket, 5, {R, N, V});
|
||||||
{describe, R, N} -> send_query(Socket, 6, {R, N});
|
|
||||||
{describe, R, N, V} -> send_query(Socket, 6, {R, N, V});
|
{describe, R, N, V} -> send_query(Socket, 6, {R, N, V});
|
||||||
{tags, R, N} -> send_query(Socket, 7, {R, N});
|
{tags, R, N} -> send_query(Socket, 7, {R, N});
|
||||||
{tags, R, N, V} -> send_query(Socket, 7, {R, N, V});
|
{tags, R, N, V} -> send_query(Socket, 7, {R, N, V});
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_conn_sup).
|
-module(zx_conn_sup).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -138,7 +138,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_daemon).
|
-module(zx_daemon).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(gen_server).
|
-behavior(gen_server).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -470,12 +470,14 @@ latest({Realm, Name, Version}) ->
|
|||||||
request({latest, Realm, Name, Version}).
|
request({latest, Realm, Name, Version}).
|
||||||
|
|
||||||
|
|
||||||
-spec describe(Package) -> {ok, RequestID}
|
-spec describe(PackageID) -> {ok, RequestID}
|
||||||
when Package :: zx:package(),
|
when PackageID :: zx:package_id(),
|
||||||
RequestID :: integer().
|
RequestID :: integer().
|
||||||
|
|
||||||
describe({Realm, Name}) ->
|
describe({Realm, Name}) ->
|
||||||
request({describe, Realm, Name}).
|
request({describe, Realm, Name, {z, z, z}});
|
||||||
|
describe({Realm, Name, Version}) ->
|
||||||
|
request({describe, Realm, Name, Version}).
|
||||||
|
|
||||||
|
|
||||||
-spec provides(Realm, Module) -> {ok, RequestID}
|
-spec provides(Realm, Module) -> {ok, RequestID}
|
||||||
@ -1362,7 +1364,7 @@ local_request(R, {list, N}) -> zomp_realm:list(R, N);
|
|||||||
local_request(R, {list, N, V}) -> zomp_realm:list(R, {N, V});
|
local_request(R, {list, N, V}) -> zomp_realm:list(R, {N, V});
|
||||||
local_request(R, {latest, N}) -> zomp_realm:latest(R, N);
|
local_request(R, {latest, N}) -> zomp_realm:latest(R, N);
|
||||||
local_request(R, {latest, N, V}) -> zomp_realm:latest(R, {N, V});
|
local_request(R, {latest, N, V}) -> zomp_realm:latest(R, {N, V});
|
||||||
local_request(R, {describe, N}) -> zomp_realm:describe(R, N);
|
local_request(R, {describe, N, V}) -> zomp_realm:describe(R, {N, V});
|
||||||
local_request(R, {provides, M}) -> zomp_realm:provides(R, M);
|
local_request(R, {provides, M}) -> zomp_realm:provides(R, M);
|
||||||
local_request(R, {list_deps, N, V}) -> zomp_realm:list_deps(R, {N, V});
|
local_request(R, {list_deps, N, V}) -> zomp_realm:list_deps(R, {N, V});
|
||||||
local_request(R, {list_sysops}) -> zomp_realm:list_sysops(R).
|
local_request(R, {list_sysops}) -> zomp_realm:list_sysops(R).
|
||||||
@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_key).
|
-module(zx_key).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -10,7 +10,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_lib).
|
-module(zx_lib).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_local).
|
-module(zx_local).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -778,12 +778,12 @@ latest2(PackageID) ->
|
|||||||
|
|
||||||
describe(PackageString) ->
|
describe(PackageString) ->
|
||||||
case zx_lib:package_id(PackageString) of
|
case zx_lib:package_id(PackageString) of
|
||||||
{ok, {Realm, Name, _}} -> describe2({Realm, Name});
|
{ok, PackageID} -> describe2(PackageID);
|
||||||
{error, invalid_package_string} -> {error, "Invalid package name.", 22}
|
{error, invalid_package_string} -> {error, "Invalid package name.", 22}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
describe2(Package) ->
|
describe2(PackageID) ->
|
||||||
{ok, ID} = zx_daemon:describe(Package),
|
{ok, ID} = zx_daemon:describe(PackageID),
|
||||||
case zx_daemon:wait_result(ID) of
|
case zx_daemon:wait_result(ID) of
|
||||||
{ok, Description} -> describe3(Description);
|
{ok, Description} -> describe3(Description);
|
||||||
{error, bad_realm} -> {error, "Unconfigured realm or bad realm name.", 22};
|
{error, bad_realm} -> {error, "Unconfigured realm or bad realm name.", 22};
|
||||||
@ -800,7 +800,6 @@ describe3({description,
|
|||||||
_ -> copyright_holder(Author, AEmail)
|
_ -> copyright_holder(Author, AEmail)
|
||||||
end,
|
end,
|
||||||
Format =
|
Format =
|
||||||
"~n"
|
|
||||||
"Package : ~ts~n"
|
"Package : ~ts~n"
|
||||||
"Name : ~ts~n"
|
"Name : ~ts~n"
|
||||||
"Type : ~tp~n"
|
"Type : ~tp~n"
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_net).
|
-module(zx_net).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -8,7 +8,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer).
|
-module(zx_peer).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -9,7 +9,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer_man).
|
-module(zx_peer_man).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(gen_server).
|
-behavior(gen_server).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peer_sup).
|
-module(zx_peer_sup).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -10,7 +10,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_peers).
|
-module(zx_peers).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_proxy).
|
-module(zx_proxy).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_sup).
|
-module(zx_sup).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-behavior(supervisor).
|
-behavior(supervisor).
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
@ -6,7 +6,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_tty).
|
-module(zx_tty).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -5,7 +5,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_userconf).
|
-module(zx_userconf).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -7,7 +7,7 @@
|
|||||||
%%% @end
|
%%% @end
|
||||||
|
|
||||||
-module(zx_zsp).
|
-module(zx_zsp).
|
||||||
-vsn("0.3.7").
|
-vsn("0.4.0").
|
||||||
-author("Craig Everett <zxq9@zxq9.com>").
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
-copyright("Craig Everett <zxq9@zxq9.com>").
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
-license("GPL-3.0").
|
-license("GPL-3.0").
|
||||||
@ -8,7 +8,7 @@
|
|||||||
{license,[]}.
|
{license,[]}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{name,[]}.
|
{name,[]}.
|
||||||
{package_id,{"otpr","zx",{0,3,7}}}.
|
{package_id,{"otpr","zx",{0,4,0}}}.
|
||||||
{prefix,"zx_"}.
|
{prefix,"zx_"}.
|
||||||
{repo_url,[]}.
|
{repo_url,[]}.
|
||||||
{tags,[]}.
|
{tags,[]}.
|
||||||
Loading…
x
Reference in New Issue
Block a user