Start on improving a few version thingies

This commit is contained in:
Nadja Reitzenstein 2022-05-13 18:24:47 +02:00
parent 67ff33ba79
commit d591daa884
3 changed files with 11 additions and 4 deletions

8
bffhd/env.rs Normal file
View File

@ -0,0 +1,8 @@
//! Information extracted from the (build) environment
//!
/// The BFFH version, as an UTF-8 string
///
/// This is of the format "<major>.<minor>.<patch>" if build as a normal release
/// or "<major> .<minor>.<patch>-<commit hash>" if built from source
pub const VERSION: &'static str = env!("BFFHD_VERSION_STRING");

View File

@ -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>,

View File

@ -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],
};