Cambio logica codice per trovare file buildati.

This commit is contained in:
Emiliano Vavassori 2022-03-26 02:42:53 +01:00
parent da8adc785f
commit db419bb825
1 changed files with 16 additions and 13 deletions

View File

@ -49,12 +49,12 @@ class Build(object):
# If the build was called by queried name, build from latest release available but build with the most generic name # If the build was called by queried name, build from latest release available but build with the most generic name
myver = str.join('.', self.version.split('.')[0:2]) myver = str.join('.', self.version.split('.')[0:2])
self.genappversion = myver + self.languagepart + self.helppart self.genappversion = myver + self.languagepart + self.helppart
self.genappimagefilename[u'x86'] = self.appname + '-' + self.genappversion + self.languagepart + self.helppart + '-x86.AppImage' self.genappimagefilename[u'x86'] = self.appname + '-' + self.genappversion + '-x86.AppImage'
self.genappimagefilename[u'x86_64'] = self.appname + '-' + self.genappversion + self.languagepart + self.helppart + '-x86_64.AppImage' self.genappimagefilename[u'x86_64'] = self.appname + '-' + self.genappversion + '-x86_64.AppImage'
self.appversion = self.version + self.languagepart + self.helppart self.appversion = self.version + self.languagepart + self.helppart
self.appimagefilename[u'x86'] = self.appname + '-' + self.version + self.languagepart + self.helppart + '-x86.AppImage' self.appimagefilename[u'x86'] = self.appname + '-' + self.appversion + '-x86.AppImage'
self.appimagefilename[u'x86_64'] = self.appname + '-' + self.version + self.languagepart + self.helppart + '-x86_64.AppImage' self.appimagefilename[u'x86_64'] = self.appname + '-' + self.appversion + '-x86_64.AppImage'
def check(self, storage_path): def check(self, storage_path):
@ -77,19 +77,22 @@ class Build(object):
for arch in self.arch: for arch in self.arch:
# For generalized builds, we need to check if there are .ver file # For generalized builds, we need to check if there are .ver file
# and it contains the specific version found. # and it contains the specific version found.
res = subprocess.check_output("find {path} -name {appimage}'".format( res = subprocess.run("find {path} -name {appimage}'".format(
path = self.storage_path, path = self.storage_path,
appimage = self.genappimagefilename[arch] + '.ver' appimage = self.genappimagefilename[arch] + '.ver'
), shell=True).decode('utf-8').strip('\n') ), shell=True, capture_output=True)
for file in res: if res.stdout:
# All good, the command was executed fine.
for file in res.stdout.decode('utf-8').strip('\n').split('\n'):
if self.version in open(file, 'r').read(): if self.version in open(file, 'r').read():
self.built = True self.built = True
res = subprocess.check_output("find {path} -name '{appimage}'".format( res = subprocess.run("find {path} -name '{appimage}'".format(
path = self.storage_path, path = self.storage_path,
appimage = self.appimagefilename[arch] appimage = self.appimagefilename[arch]
), shell=True).decode('utf-8').strip('\n') ), shell=True, capture_output=True)
if len(res) > 1: if res.stdout:
if len(res.stdout.decode('utf-8').strip('\n')) > 1:
self.built = True self.built = True
if self.built: if self.built: