Skip to content

Commit

Permalink
Be more tolerant to string in VERSION file
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dwrobel committed Dec 13, 2023
1 parent 7d9b5e5 commit ff4db85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share/qtvcp/screens/qtplasmac/qtplasmac_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = '001.012'
VERSION = '001.013'
LCNCVER = '2.10'
DOCSVER = LCNCVER

Expand Down Expand Up @@ -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):
Expand Down
5 changes: 5 additions & 0 deletions share/qtvcp/screens/qtplasmac/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ <h2>QtPlasmaC Version History - LinuxCNC 2.10</h2>
</table>
<br>
<!--- ****** ADD NEXT VERSION BELOW THIS LINE ****** --->
<br><b><u>001.013 2023 Dec 13</u></b>
<ul style="margin:0;">
<li>fix parsing linuxcnc version</li>
</ul>

<br><b><u>001.012 2023 Dec 12</u></b>
<ul style="margin:0;">
<li>fix invalid escape sequences</li>
Expand Down

0 comments on commit ff4db85

Please sign in to comment.