From 17fb8bb2b2534465a7b4cd072d293159eb59d6a3 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 26 Mar 2022 02:04:02 +0100 Subject: [PATCH] Rivista logica di build per query nominali. --- loaih/__init__.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index b055959..725e47d 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -22,7 +22,6 @@ class Build(object): self.storage_path = '/srv/http/appimage.sys42.eu' self.download_path = '/var/tmp/downloads' self.appimagefilename = {} - self.zsyncfilename = {} # Getting versions and so on v = versions.BuildVersion(self.query) @@ -44,12 +43,18 @@ class Build(object): self.helppart = '.help' if self.offline_help else '' - self.appimagefilename[u'x86'] = self.appname + '-' + self.version + self.languagepart + self.helppart + '-x86.AppImage' - self.appimagefilename[u'x86_64'] = self.appname + '-' + v.version + self.languagepart + self.helppart + '-x86_64.AppImage' + # If the build was called by queried name, build from latest release available but build with the most generic name + if self.queried_name: + myver = str.join('.', self.version.split('.')[0:2]) + + self.appimagefilename[u'x86'] = self.appname + '-' + myver + self.languagepart + self.helppart + '-x86.AppImage' + self.appimagefilename[u'x86_64'] = self.appname + '-' + myver + self.languagepart + self.helppart + '-x86_64.AppImage' + + else: + self.appimagefilename[u'x86'] = self.appname + '-' + self.version + self.languagepart + self.helppart + '-x86.AppImage' + self.appimagefilename[u'x86_64'] = self.appname + '-' + v.version + self.languagepart + self.helppart + '-x86_64.AppImage' + - myver = str.join('.', self.version.split('.')[0:2]) - self.zsyncfilename[u'x86'] = self.appname + '-' + myver + self.languagepart + self.helppart + '-x86.AppImage.zsync' - self.zsyncfilename[u'x86_64'] = self.appname + '-' + myver + self.languagepart + self.helppart + '-x86_64.AppImage.zsync' def check(self, storage_path): @@ -218,7 +223,7 @@ class Build(object): # daily. If a request was for a specific version, I'd not build an # updatable version. # zsync name was generated already - subprocess.run("VERSION={version} ./appimagetool -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = appversion, zsync = self.zsyncfilename[arch], appname = self.appname), shell=True) + subprocess.run("VERSION={version} ./appimagetool -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = appversion, zsync = self.appimagefilename[arch] + '.zsync', appname = self.appname), shell=True) else: subprocess.run("VERSION={version} ./appimagetool -v ./{appname}.AppDir/".format(version = appversion, appname = self.appname), shell=True)