* Fri Sep 26 2025 Brian Read <brianr@koozali.org> 11.1-11.sme
- Fix version number extraction fro supplied string [SME: 13121]
This commit is contained in:
@@ -93,6 +93,14 @@ import json
|
|||||||
from systemd import journal
|
from systemd import journal
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
def extract_version(text):
|
||||||
|
# Regular expression to match version numbers with the format X.Y.Z (e.g., 11.1.10)
|
||||||
|
match = re.search(r'\b\d+\.\d+\.\d+\b', text)
|
||||||
|
if match:
|
||||||
|
return match.group(0)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
log_dir_path = "/var/log/mailstats"
|
log_dir_path = "/var/log/mailstats"
|
||||||
# Check if the directory exists, and create it if it doesn't
|
# Check if the directory exists, and create it if it doesn't
|
||||||
@@ -111,11 +119,11 @@ except ImportError:
|
|||||||
logging.warning("Matplotlib is not installed - no graphs")
|
logging.warning("Matplotlib is not installed - no graphs")
|
||||||
enable_graphs = False;
|
enable_graphs = False;
|
||||||
|
|
||||||
Mailstats_version = '1.3'
|
Mailstats_version = '11.1.10.el8.sme)'
|
||||||
build_date_time = "2024-06-18 12:03:40OURCE"
|
build_date_time = "2025-09-13 10:10:12OURCE"
|
||||||
#Take out the crap that sneaks in...
|
#Take out the crap that sneaks in...
|
||||||
build_date_time = build_date_time[:19]
|
build_date_time = build_date_time[:19]
|
||||||
Mailstats_version = Mailstats_version[:6]
|
Mailstats_version = extract_version(Mailstats_version)
|
||||||
|
|
||||||
#if build_date_time == "2024-06-18 12:03:40OURCE":
|
#if build_date_time == "2024-06-18 12:03:40OURCE":
|
||||||
# build_date_time = "Unknown"
|
# build_date_time = "Unknown"
|
||||||
|
@@ -6,7 +6,7 @@ Summary: Daily mail statistics for SME Server
|
|||||||
%define name smeserver-mailstats
|
%define name smeserver-mailstats
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.1
|
%define version 11.1
|
||||||
%define release 10
|
%define release 11
|
||||||
%define full_version %{version}.%{release})
|
%define full_version %{version}.%{release})
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
@@ -88,6 +88,9 @@ chmod u+s /usr/bin/journalwrap
|
|||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 26 2025 Brian Read <brianr@koozali.org> 11.1-11.sme
|
||||||
|
- Fix version number extraction fro supplied string [SME: 13121]
|
||||||
|
|
||||||
* Fri Sep 12 2025 Brian Read <brianr@koozali.org> 11.1-10.sme
|
* Fri Sep 12 2025 Brian Read <brianr@koozali.org> 11.1-10.sme
|
||||||
- Fix version and build date from spec file [SME: 13121]
|
- Fix version and build date from spec file [SME: 13121]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user