From 90a551467a661758372f36c6e841f9b70d71fd20 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Thu, 2 Apr 2020 14:58:16 +0200 Subject: [PATCH] Rename greet_proto to greetd_ipc, Cargo.toml updates --- Cargo.lock | 28 +++++++++++++------------- Cargo.toml | 2 +- agreety/Cargo.toml | 7 +++++-- agreety/src/main.rs | 2 +- greetd/Cargo.toml | 9 ++++++--- greetd/src/context.rs | 2 +- greetd/src/error.rs | 10 ++++----- greetd/src/server.rs | 2 +- {greet_proto => greetd_ipc}/Cargo.toml | 9 +++++++-- {greet_proto => greetd_ipc}/src/lib.rs | 4 ++-- 10 files changed, 43 insertions(+), 32 deletions(-) rename {greet_proto => greetd_ipc}/Cargo.toml (62%) rename {greet_proto => greetd_ipc}/src/lib.rs (98%) diff --git a/Cargo.lock b/Cargo.lock index 14bdf57..da0e8a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ name = "agreety" version = "0.5.0" dependencies = [ "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "greet_proto 0.5.0", + "greetd_ipc 0.5.0", "nix 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "rust-ini 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -160,18 +160,6 @@ dependencies = [ "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "greet_proto" -version = "0.5.0" -dependencies = [ - "async-trait 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "greetd" version = "0.5.0" @@ -179,7 +167,7 @@ dependencies = [ "async-trait 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "greet_proto 0.5.0", + "greetd_ipc 0.5.0", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", "pam-sys 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -191,6 +179,18 @@ dependencies = [ "users 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "greetd_ipc" +version = "0.5.0" +dependencies = [ + "async-trait 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "iovec" version = "0.1.4" diff --git a/Cargo.toml b/Cargo.toml index 17a37fd..e1a07c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,4 @@ panic = "abort" opt-level = 'z' [workspace] -members = ["greet_proto", "greetd", "agreety"] +members = ["greetd_ipc", "greetd", "agreety"] diff --git a/agreety/Cargo.toml b/agreety/Cargo.toml index e2356fe..96688a5 100644 --- a/agreety/Cargo.toml +++ b/agreety/Cargo.toml @@ -1,11 +1,14 @@ [package] name = "agreety" version = "0.5.0" -authors = ["Kenny Levinsen "] +authors = ["Kenny Levinsen"] edition = "2018" +license = "GPL-3.0" +homepage = "https://kl.wtf/projects/agreety" +repository = "https://git.sr.ht/~kennylevinsen/greetd/" [dependencies] -greet_proto = { path = "../greet_proto", features = ["sync-codec"]} +greetd_ipc = { path = "../greetd_ipc", features = ["sync-codec"]} rust-ini = "0.14" rpassword = "4.0" getopts = "0.2" diff --git a/agreety/src/main.rs b/agreety/src/main.rs index a0be64d..78ae0fd 100644 --- a/agreety/src/main.rs +++ b/agreety/src/main.rs @@ -9,7 +9,7 @@ use ini::Ini; use nix::sys::utsname::uname; use rpassword::prompt_password_stderr; -use greet_proto::{codec::SyncCodec, AuthMessageType, ErrorType, Request, Response}; +use greetd_ipc::{codec::SyncCodec, AuthMessageType, ErrorType, Request, Response}; fn prompt_stderr(prompt: &str) -> Result> { let stdin = io::stdin(); diff --git a/greetd/Cargo.toml b/greetd/Cargo.toml index 7fb72e9..344d6dd 100644 --- a/greetd/Cargo.toml +++ b/greetd/Cargo.toml @@ -1,8 +1,11 @@ [package] name = "greetd" version = "0.5.0" -authors = ["Kenny Levinsen "] +authors = ["Kenny Levinsen"] edition = "2018" +license = "GPL-3.0" +homepage = "https://kl.wtf/projects/greetd" +repository = "https://git.sr.ht/~kennylevinsen/greetd/" [dependencies] nix = "0.16" @@ -11,10 +14,10 @@ users = "0.9.1" toml = "0.5" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -greet_proto = { path = "../greet_proto", features = ["tokio-codec"] } +greetd_ipc = { path = "../greetd_ipc", features = ["tokio-codec"] } libc = "0.2" futures = "0.3" tokio = { version = "0.2", features = ["net", "sync", "macros", "signal", "rt-util", "io-util", "time"] } getopts = "0.2" thiserror = "1.0" -async-trait = "0.1" \ No newline at end of file +async-trait = "0.1" diff --git a/greetd/src/context.rs b/greetd/src/context.rs index 4eb91a2..f052574 100644 --- a/greetd/src/context.rs +++ b/greetd/src/context.rs @@ -13,7 +13,7 @@ use crate::{ worker::AuthMessageType as SessAuthMessageType, }, }; -use greet_proto::AuthMessageType; +use greetd_ipc::AuthMessageType; struct SessionChildSet { child: SessionChild, diff --git a/greetd/src/error.rs b/greetd/src/error.rs index 497a5aa..68aa07c 100644 --- a/greetd/src/error.rs +++ b/greetd/src/error.rs @@ -39,12 +39,12 @@ impl From for Error { } } -impl From for Error { - fn from(error: greet_proto::codec::Error) -> Self { +impl From for Error { + fn from(error: greetd_ipc::codec::Error) -> Self { match error { - greet_proto::codec::Error::Serialization(s) => Error::ProtocolError(s), - greet_proto::codec::Error::Io(s) => Error::Io(s), - greet_proto::codec::Error::Eof => Error::Io("EOF".to_string()), + greetd_ipc::codec::Error::Serialization(s) => Error::ProtocolError(s), + greetd_ipc::codec::Error::Io(s) => Error::Io(s), + greetd_ipc::codec::Error::Eof => Error::Io("EOF".to_string()), } } } diff --git a/greetd/src/server.rs b/greetd/src/server.rs index 22101ff..c193e82 100644 --- a/greetd/src/server.rs +++ b/greetd/src/server.rs @@ -13,7 +13,7 @@ use crate::{ error::Error, terminal::{self, Terminal}, }; -use greet_proto::{ +use greetd_ipc::{ codec::{Error as CodecError, TokioCodec}, ErrorType, Request, Response, }; diff --git a/greet_proto/Cargo.toml b/greetd_ipc/Cargo.toml similarity index 62% rename from greet_proto/Cargo.toml rename to greetd_ipc/Cargo.toml index c4d38ad..f6c21f5 100644 --- a/greet_proto/Cargo.toml +++ b/greetd_ipc/Cargo.toml @@ -1,8 +1,13 @@ [package] -name = "greet_proto" +name = "greetd_ipc" version = "0.5.0" -authors = ["Kenny Levinsen "] +authors = ["Kenny Levinsen"] edition = "2018" +license = "GPL-3.0" +homepage = "https://kl.wtf/projects/greetd" +repository = "https://git.sr.ht/~kennylevinsen/greetd/" +description = "An implementation of the greetd IPC protocol" +keywords = ["greetd"] [features] codec = ["thiserror"] diff --git a/greet_proto/src/lib.rs b/greetd_ipc/src/lib.rs similarity index 98% rename from greet_proto/src/lib.rs rename to greetd_ipc/src/lib.rs index d7b7dfe..bcbaff5 100644 --- a/greet_proto/src/lib.rs +++ b/greetd_ipc/src/lib.rs @@ -1,6 +1,6 @@ -//! # `greetd` protocol library +//! # `greetd` IPC protocol library //! -//! This library implements the greetd wire protocol. +//! This library implements the [greetd](https://git.sr.ht/~kennylevinsen/greetd) IPC protocol. //! //! The library exposes a [Request](enum.Request.html) and a //! [Response](enum.Response.html) enum, representing the valid protocol