Dockerfile, mod_update_check: Update version string format

This commit is contained in:
Matthew Wild 2021-05-31 12:23:52 +01:00
parent bf2fccf585
commit e8dd2408b8
2 changed files with 6 additions and 5 deletions

View File

@ -38,6 +38,6 @@ RUN apt-get update \
&& apt-get autoremove -y \
&& rm -rf /var/cache/*
RUN echo "Snikket $BUILD_SERIES.$BUILD_ID" > /usr/lib/prosody/prosody.version
RUN echo "Snikket $BUILD_SERIES $BUILD_ID" > /usr/lib/prosody/prosody.version
VOLUME ["/snikket"]

View File

@ -12,10 +12,11 @@ local check_interval = module:get_option_number("update_check_interval", 86400);
local version_info = {};
do
local version = prosody.version;
local branch, bugfix = version:match("(%S+)%.(%d+)$");
if branch then
version_info.branch, version_info.level = branch, bugfix;
local version_string = prosody.version;
-- "dev 128-00000", "release v2021.05r2"
local series, version = version_string:match("(%w+) (%S+)$");
if series then
version_info.branch, version_info.level = series, version;
end
end