From ff4db8533f824ab80afeaaf4f51e545e78c57596 Mon Sep 17 00:00:00 2001 From: Damian Wrobel Date: Mon, 11 Dec 2023 11:05:39 +0100 Subject: [PATCH] Be more tolerant to string in VERSION file When the string in VERSION file contains date and git sha like the following: 2.10.0-0.96.20231128git2217582.fc38.src.rpm then qtplasma refuses to work as it is unnable to properly find 'major' and 'minor' components from the version string. So let's parse the string from left where we always expect 'major' and 'minor' to be located. Signed-off-by: Damian Wrobel --- share/qtvcp/screens/qtplasmac/qtplasmac_handler.py | 6 +++--- share/qtvcp/screens/qtplasmac/versions.html | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py index ef24ca21ccc..42a2552dbcf 100644 --- a/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py +++ b/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py @@ -1,4 +1,4 @@ -VERSION = '001.012' +VERSION = '001.013' LCNCVER = '2.10' DOCSVER = LCNCVER @@ -327,10 +327,10 @@ def __init__(self, halcomp, widgets, paths): # called by qtvcp.py def initialized__(self): - if linuxcnc.version.rsplit('.', 1)[0] != LCNCVER: + if '.'.join(linuxcnc.version.split('.')[:2]) != LCNCVER: msg0 = _translate('HandlerClass', 'LinuxCNC version should be') msg1 = _translate('HandlerClass', 'The detected version is') - STATUS.emit('error', linuxcnc.OPERATOR_ERROR, f'{msg0} {LCNCVER}\n{msg1} {linuxcnc.version.rsplit(".", 1)[0]}') + STATUS.emit('error', linuxcnc.OPERATOR_ERROR, f'{msg0} {LCNCVER}\n{msg1} {linuxcnc.version.split(".")[:2]}') quit() ucFile = os.path.join(self.PATHS.CONFIGPATH, 'qtplasmac_custom.py') if os.path.isfile(ucFile): diff --git a/share/qtvcp/screens/qtplasmac/versions.html b/share/qtvcp/screens/qtplasmac/versions.html index 09af6394cbe..b23868ebebd 100644 --- a/share/qtvcp/screens/qtplasmac/versions.html +++ b/share/qtvcp/screens/qtplasmac/versions.html @@ -26,6 +26,11 @@

QtPlasmaC Version History - LinuxCNC 2.10


+
001.013 2023 Dec 13 + +
001.012 2023 Dec 12