1
0

Ancora cambio logica build nominali.

This commit is contained in:
Emiliano Vavassori 2022-03-26 02:10:25 +01:00
parent 17fb8bb2b2
commit 8c298e85de

View File

@ -21,6 +21,7 @@ class Build(object):
self.updatable = True self.updatable = True
self.storage_path = '/srv/http/appimage.sys42.eu' self.storage_path = '/srv/http/appimage.sys42.eu'
self.download_path = '/var/tmp/downloads' self.download_path = '/var/tmp/downloads'
self.appversion = ''
self.appimagefilename = {} self.appimagefilename = {}
# Getting versions and so on # Getting versions and so on
@ -46,15 +47,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
if self.queried_name: if self.queried_name:
myver = str.join('.', self.version.split('.')[0:2]) myver = str.join('.', self.version.split('.')[0:2])
self.appversion = myver + self.languagepart + self.helppart
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: else:
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.version + self.languagepart + self.helppart + '-x86.AppImage'
self.appimagefilename[u'x86_64'] = self.appname + '-' + v.version + self.languagepart + self.helppart + '-x86_64.AppImage' self.appimagefilename[u'x86_64'] = self.appname + '-' + self.version + self.languagepart + self.helppart + '-x86_64.AppImage'
def check(self, storage_path): def check(self, storage_path):
@ -212,23 +210,18 @@ class Build(object):
urllib.request.urlretrieve(apprunurl, dest) urllib.request.urlretrieve(apprunurl, dest)
os.chmod(dest, 0o755) os.chmod(dest, 0o755)
# Setting app version
appversion = self.version + '.' + (self.language if not ',' in self.language else self.language.replace(',', '-'))
if self.offline_help:
appversion += '.help'
# Building app # Building app
if self.updatable and self.queried_name: if self.updatable and self.queried_name:
# Updatable make sense only for generic images for fresh, still, # Updatable make sense only for generic images for fresh, still,
# daily. If a request was for a specific version, I'd not build an # daily. If a request was for a specific version, I'd not build an
# updatable version. # updatable version.
# zsync name was generated already # zsync name was generated already
subprocess.run("VERSION={version} ./appimagetool -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = appversion, zsync = self.appimagefilename[arch] + '.zsync', appname = self.appname), shell=True) subprocess.run("VERSION={version} ./appimagetool -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = self.appversion, zsync = self.appimagefilename[arch] + '.zsync', appname = self.appname), shell=True)
else: else:
subprocess.run("VERSION={version} ./appimagetool -v ./{appname}.AppDir/".format(version = appversion, appname = self.appname), shell=True) subprocess.run("VERSION={version} ./appimagetool -v ./{appname}.AppDir/".format(version = self.appversion, appname = self.appname), shell=True)
print("Built AppImage version {version}".format(version = appversion)) print("Built AppImage version {version}".format(version = self.appversion))
# Cleanup phase, before new run. # Cleanup phase, before new run.
for deb in glob.glob(self.appnamedir + '/*.deb'): for deb in glob.glob(self.appnamedir + '/*.deb'):