From d591daa884158cc3d24cc6dcdbe7c42ea3fda396 Mon Sep 17 00:00:00 2001 From: Nadja Reitzenstein Date: Fri, 13 May 2022 18:24:47 +0200 Subject: [PATCH] Start on improving a few version thingies --- bffhd/env.rs | 8 ++++++++ bffhd/lib.rs | 5 ++--- build.rs | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 bffhd/env.rs diff --git a/bffhd/env.rs b/bffhd/env.rs new file mode 100644 index 0000000..5411026 --- /dev/null +++ b/bffhd/env.rs @@ -0,0 +1,8 @@ +//! Information extracted from the (build) environment +//! + +/// The BFFH version, as an UTF-8 string +/// +/// This is of the format ".." if build as a normal release +/// or " ..-" if built from source +pub const VERSION: &'static str = env!("BFFHD_VERSION_STRING"); diff --git a/bffhd/lib.rs b/bffhd/lib.rs index 359a181..45a8466 100644 --- a/bffhd/lib.rs +++ b/bffhd/lib.rs @@ -31,6 +31,8 @@ pub mod capnp; pub mod utils; +pub mod env; + mod audit; mod keylog; mod logging; @@ -60,9 +62,6 @@ use crate::users::Users; use executor::pool::Executor; use signal_hook::consts::signal::*; -pub const VERSION_STRING: &'static str = env!("BFFHD_VERSION_STRING"); -pub const RELEASE_STRING: &'static str = env!("BFFHD_RELEASE_STRING"); - pub struct Diflouroborane { config: Config, executor: Executor<'static>, diff --git a/build.rs b/build.rs index 122be31..8fbf65c 100644 --- a/build.rs +++ b/build.rs @@ -32,7 +32,7 @@ fn main() { String::from_utf8(out.stdout).expect("git rev-list output was not valid UTF8"); let gitrev = owned_gitrev.trim(); let abbrev = match gitrev.len() { - 0 => "unknown", + 0 => "badsource", _ => &gitrev[0..9], };