Cambiata parte finale di implementazione per creazione file generalizzati.
This commit is contained in:
parent
be02b5076c
commit
e51b55b41e
|
@ -50,6 +50,7 @@ class Build(object):
|
|||
# understood the storage_path can be changed before that phase.
|
||||
self.relative_path = []
|
||||
self.full_path = ''
|
||||
self.baseurl = ''
|
||||
|
||||
|
||||
def calculate(self):
|
||||
|
@ -321,6 +322,7 @@ class Build(object):
|
|||
# Creating versions for short version and query text
|
||||
versions = [ self.short_version, self.branch_version ]
|
||||
for arch in Build.ARCHSTD:
|
||||
os.chdir(self.full_path)
|
||||
# if the appimage for the reported arch is not found, skip to next
|
||||
# arch
|
||||
if not os.path.exists(self.appimagefilename[arch]):
|
||||
|
@ -331,16 +333,17 @@ class Build(object):
|
|||
appimagefilename[arch] = self.appname + '-' + version + self.languagepart + self.helppart + f'-{arch}.AppImage'
|
||||
zsyncfilename[arch] = appimagefilename[arch] + '.zsync'
|
||||
|
||||
os.chdir(self.full_path)
|
||||
# Create the symlink
|
||||
print(f"Creating {appimagefilename[arch]} and checksums.")
|
||||
os.symlink(self.appimagefilename[arch], appimagefilename[arch])
|
||||
# Create the checksum for the AppImage
|
||||
subprocess.run(shlex.split("md5sum {item} > {item}.md5".format(item=appimagefilename[arch])))
|
||||
subprocess.run(shlex.split(f"md5sum {appimagefilename[arch]} > {appimagefilename[arch]}.md5"))
|
||||
# Do not continue if no zsync file is provided.
|
||||
if not self.updatable:
|
||||
continue
|
||||
|
||||
os.copy(self.zsyncfilename[arch], zsyncfilename[arch])
|
||||
print(f"Creating zsync file for version {version}.")
|
||||
shutil.copyfile(self.zsyncfilename[arch], zsyncfilename[arch])
|
||||
# Editing the zsyncfile
|
||||
subprocess.run(shlex.split(f"sed -i'' -e 's/^Filename:.*$/Filename: {appimagefilename[arch]}/' {zsyncfilename[arch]}"))
|
||||
|
||||
|
|
Loading…
Reference in New Issue