Skip to content

Commit

Permalink
fix update version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-p committed Apr 19, 2022
1 parent ca698e9 commit ef79e8e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Update.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Crypto=None

onlineTimeout=5
FORCE_UPDATECHECK=False # used while developing
FORCE_UPDATECHECK=hasattr(admVersion, 'FORCE_UPDATECHECK') and admVersion.FORCE_UPDATECHECK # used while developing

class UpdateThread(threading.Thread):

Expand Down Expand Up @@ -74,14 +74,20 @@ def IsValid(self):
def UpdateAvailable(self):
if self.info:
localVersion=admVersion.version
localMainVersion=localVersion[:localVersion.find('rc')]
try:
localMainVersion=localVersion[:localVersion.index('rc')]
except:
localMainVersion=localVersion
localRC=(localVersion!=localMainVersion)
for release in self.info:
if not adm.allowPrereleases and release.get('prerelease'):
continue
if True:
upstreamVersion=release['tag_name']
upstreamMainVersion=upstreamVersion[:upstreamVersion.find(('rc'))]
try:
upstreamMainVersion=upstreamVersion[:upstreamVersion.index('rc')]
except:
upstreamMainVersion=upstreamVersion
upstreamRC=(upstreamVersion!=upstreamMainVersion)

if localMainVersion > upstreamMainVersion: # strange: local version is newer
Expand Down

0 comments on commit ef79e8e

Please sign in to comment.