Implement describe

This commit is contained in:
Craig Everett 2019-12-20 22:44:57 +09:00
parent 4139b4f3c0
commit 3d1d3b622c
53 changed files with 30 additions and 30 deletions

View File

@ -1 +1 @@
0.3.7
0.4.0

View File

@ -1,6 +1,6 @@
{application,zx,
[{description,[]},
{vsn,"0.3.7"},
{vsn,"0.4.0"},
{applications,[stdlib,kernel]},
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,

View File

@ -24,7 +24,7 @@
%%% @end
-module(zx).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(application).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -9,7 +9,7 @@
%%% @end
-module(zx_auth).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -7,7 +7,7 @@
%%% @end
-module(zx_conn).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").
@ -285,7 +285,6 @@ dispatch(Socket, ID, Action) ->
{list, R, N, V} -> send_query(Socket, 4, {R, N, V});
{latest, R, N} -> send_query(Socket, 5, {R, N});
{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});
{tags, R, N} -> send_query(Socket, 7, {R, N});
{tags, R, N, V} -> send_query(Socket, 7, {R, N, V});

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_conn_sup).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -138,7 +138,7 @@
%%% @end
-module(zx_daemon).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(gen_server).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
@ -470,12 +470,14 @@ latest({Realm, Name, Version}) ->
request({latest, Realm, Name, Version}).
-spec describe(Package) -> {ok, RequestID}
when Package :: zx:package(),
-spec describe(PackageID) -> {ok, RequestID}
when PackageID :: zx:package_id(),
RequestID :: integer().
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}
@ -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, {latest, N}) -> zomp_realm:latest(R, N);
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, {list_deps, N, V}) -> zomp_realm:list_deps(R, {N, V});
local_request(R, {list_sysops}) -> zomp_realm:list_sysops(R).

View File

@ -8,7 +8,7 @@
%%% @end
-module(zx_key).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -10,7 +10,7 @@
%%% @end
-module(zx_lib).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_local).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").
@ -778,12 +778,12 @@ latest2(PackageID) ->
describe(PackageString) ->
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}
end.
describe2(Package) ->
{ok, ID} = zx_daemon:describe(Package),
describe2(PackageID) ->
{ok, ID} = zx_daemon:describe(PackageID),
case zx_daemon:wait_result(ID) of
{ok, Description} -> describe3(Description);
{error, bad_realm} -> {error, "Unconfigured realm or bad realm name.", 22};
@ -800,7 +800,6 @@ describe3({description,
_ -> copyright_holder(Author, AEmail)
end,
Format =
"~n"
"Package : ~ts~n"
"Name : ~ts~n"
"Type : ~tp~n"

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_net).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -8,7 +8,7 @@
%%% @end
-module(zx_peer).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -9,7 +9,7 @@
%%% @end
-module(zx_peer_man).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(gen_server).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_peer_sup).
-vsn("0.3.7").
-vsn("0.4.0").
-behaviour(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -10,7 +10,7 @@
%%% @end
-module(zx_peers).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_proxy).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_sup).
-vsn("0.3.7").
-vsn("0.4.0").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_tty).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_userconf).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -7,7 +7,7 @@
%%% @end
-module(zx_zsp).
-vsn("0.3.7").
-vsn("0.4.0").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -8,7 +8,7 @@
{license,[]}.
{modules,[]}.
{name,[]}.
{package_id,{"otpr","zx",{0,3,7}}}.
{package_id,{"otpr","zx",{0,4,0}}}.
{prefix,"zx_"}.
{repo_url,[]}.
{tags,[]}.