From d17be39302cd0f4cf30b2e51d989bd4730e64125 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 22 Dec 2022 08:34:30 +0100 Subject: [PATCH] added git version in code at build --- Cargo.toml | 2 +- src/config/mod.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bb04e3b..9a81c5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,4 +38,4 @@ zmq = "0.9" [profile.release] debug = false -opt-level = 3 \ No newline at end of file +opt-level = "z" \ No newline at end of file diff --git a/src/config/mod.rs b/src/config/mod.rs index 6372910..ea9a97a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -4,6 +4,7 @@ use crate::utils::*; use chrono::prelude::*; use chrono::Duration; use clap::{Arg, ArgMatches, Command}; +use git_version::git_version; use ipnet::IpNet; use nix::sys::inotify::{AddWatchFlags, InitFlags, Inotify, WatchDescriptor}; use regex::Regex; @@ -13,6 +14,7 @@ use std::collections::HashMap; use std::hash::{Hash, Hasher}; use std::path::Path; +pub const GIT_VERSION: &str = git_version!(); const MASTERSERVER: &str = "ipbl.paulbsd.com"; const ZMQSUBSCRIPTION: &str = "ipbl"; const CONFIG_RETRY: u64 = 10;