misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-20 20:46:18 +02:00
parent 2a450e64ef
commit 999b130224
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E

View File

@ -82,7 +82,7 @@ def install(display, update):
display.update(force=True, new_data={'status': 'Extracting %s ...' % name}) display.update(force=True, new_data={'status': 'Extracting %s ...' % name})
os.system('unzip "%s" -d "%s"' % (target_path, path)) os.system('unzip "%s" -q -d "%s"' % (target_path, path))
source_path = os.path.join(path, name) source_path = os.path.join(path, name)
checksums = glob.glob("%s/*.sha256" % path) checksums = glob.glob("%s/*.sha256" % path)
@ -120,6 +120,9 @@ def install(display, update):
logging.info("[update] service %s start" % update['service']) logging.info("[update] service %s start" % update['service'])
else: else:
if not os.path.exists(source_path):
source_path = "%s-%s" % (source_path, update['available'])
logging.info("[update] cd %s && pip3 install ." % source_path) logging.info("[update] cd %s && pip3 install ." % source_path)
return True return True