From 413b84a1c322e3675143e1ffc648c335c0877318 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 00:56:28 +0200 Subject: [PATCH 01/24] Fix tentativo per creazione di link corretti e zsync truccati. --- loaih/__init__.py | 276 +++++++++++++++++++++----------------------- scripts/loaih-build | 3 +- 2 files changed, 134 insertions(+), 145 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index a754aff..3c20115 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -3,7 +3,7 @@ import urllib.request import loaih.versions as versions from lxml import etree -import tempfile, os, sys, glob, subprocess, shutil, re +import tempfile, os, sys, glob, subprocess, shutil, re, shlex class Build(object): LANGSTD = [ 'ar', 'de', 'en-GB', 'es', 'fr', 'it', 'ja', 'ko', 'pt', 'pt-BR', 'ru', 'zh-CN', 'zh-TW' ] @@ -13,32 +13,34 @@ class Build(object): def __init__(self, query, arch): """Build all versions that can be found in the indicated repo.""" self.query = query - self.queried_name = False if '.' in self.query else True self.arch = arch - self.url = {} + + # Getting versions and so on + v = versions.BuildVersion(self.query) + self.version = v.version + self.short_version = str.join('.', self.version.split('.')[0:2]) + self.branch_version = None + if not '.' in self.query: + self.branch_version = self.query + self.url = v.basedirurl + + # Other default values self.language = 'basic' self.offline_help = False self.portable = False self.updatable = True - self.sign = False - self.storage_path = '/srv/http/appimage.sys42.eu' + self.sign = True + self.storage_path = '/mnt/appimage' self.download_path = '/var/tmp/downloads' # Specific build version self.appversion = '' - self.genappversion = '' self.appimagefilename = {} - self.genappimagefilename = {} - - # Getting versions and so on - v = versions.BuildVersion(self.query) + self.zsyncfilename = {} # Creating a tempfile self.builddir = tempfile.mkdtemp() self.tarballs = {} - self.appname = 'LibreOffice' if not self.query == 'daily' and not self.query == 'prerelease' else 'LibreOfficeDev' - self.version = v.version - self.url = v.basedirurl self.built = { u'x86': False, u'x86_64': False } # Preparing the default for the relative path on the storage for @@ -51,73 +53,32 @@ class Build(object): def calculate(self): """Calculate exclusions and other variables.""" - # Incompatibilities - if portable and updatable are asked together, - # only portable will be built. - if self.portable and self.updatable: - print("Upgradable and portable options were required together. Building only portable.") - self.updatable = False + # AppName + self.appname = 'LibreOffice' if not self.query == 'daily' and not self.query == 'prerelease' else 'LibreOfficeDev' - if self.updatable and not self.queried_name: - # If the queried version was a numbered version, doesn't make sense - # to build an updatable version. - self.updatable = False - - # Mandate to the private function to calculate the full_path available - # for the storage and the checks. - self.__calculate_full_path__() - - # Building expected AppImageName + # Calculating languagepart self.languagepart = "." if ',' in self.language: self.languagepart += self.language.replace(',', '-') else: self.languagepart += self.language + # Calculating help part self.helppart = '.help' if self.offline_help else '' - # If the build was called by queried name, build from latest release available but build with the most generic name - self.appversion = self.version + self.languagepart + self.helppart - myver = str.join('.', self.version.split('.')[0:2]) - self.genappversion = myver + self.languagepart + self.helppart + # Building the required names for arch in Build.ARCHSTD: - self.appimagefilename[arch] = self.appname + '-' + self.appversion + f'-{arch}.AppImage' - self.genappimagefilename[arch] = self.appname + '-' + self.genappversion + f'-{arch}.AppImage' + self.appimagefilename[arch] = __genappimagefilename__(self.version, arch) + self.zsyncfilename[arch] = self.appimagefilename[arch] + '.zsync' + + # Mandate to the private function to calculate the full_path available + # for the storage and the checks. + self.__calculate_full_path__() - def check(self): - """Checking if the requested AppImage has been already built.""" - - for arch in self.arch: - # For generalized builds, we need to check if there are .ver file - # and it contains the specific version found. - print("Debug: searching for {file}".format(file = self.genappimagefilename[arch] + '.ver')) - res = subprocess.run("find {path} -name {appimage}'".format( - path = self.full_path, - appimage = self.genappimagefilename[arch] + '.ver' - ), shell=True, capture_output=True, env={ "LC_ALL": "C" }) - - if "No such file or directory" in res.stderr.decode('utf-8'): - # Folder is not existent: so the version was not built - # Build stays false, and we go to the next arch - continue - - 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(): - self.built[arch] = True - - print("Debug: searching for {file}".format(file = self.appimagefilename[arch])) - res = subprocess.run("find {path} -name '{appimage}'".format( - path = self.full_path, - appimage = self.appimagefilename[arch] - ), shell=True, capture_output=True) - if res.stdout: - if len(res.stdout.decode('utf-8').strip('\n')) > 1: - self.built[arch] = True - - if self.built[arch]: - print("The requested AppImage already exists on storage for {arch}. I'll skip downloading, building and moving the results.".format(arch=arch)) + def __gen_appimagefilename__(self, version, arch): + """Generalize the construction of the name of the app.""" + return self.appname + f'-{version}' + self.languagepart + self.helppart + f'-{arch}.AppImage' def __calculate_full_path__(self): @@ -139,49 +100,70 @@ class Build(object): self.full_path = re.sub(r"/+", '/', str.join('/', fullpath_arr)) + def check(self): + """Checking if the requested AppImage has been already built.""" + if not len(self.appimagefilename) == 2: + self.calculate() + + for arch in self.arch: + print(f"Searching for {self.appimagefilename[arch]}") + res = subprocess.run(shlex.split(f"find {self.full_path} -name {self.appimagefilename[arch]}'"), capture_output=True, env={ "LC_ALL": "C" }, text=True, encoding='utf-8') + + if "No such file or directory" in res.stderr: + # Folder is not existent: so the version was not built + # Build stays false, and we go to the next arch + continue + + if res.stdout: + # All good, the command was executed fine. + for file in res.stdout.strip('\n').split('\n'): + if self.version in open(file, 'r').read(): + print(f"Build for {self.version} found.") + self.built[arch] = True + + if self.built[arch]: + print(f"The requested AppImage already exists on storage for {arch}. I'll skip downloading, building and moving the results.") + + def download(self): """Downloads the contents of the URL as it was a folder.""" + print(f"Started downloads for {self.version}. Please wait.") for arch in self.arch: # Checking if a valid path has been provided if self.url[arch] == '-': - print("No build has been provided for the requested AppImage for {arch}. Continue with other options.".format(arch = arch)) + print(f"No build has been provided for the requested AppImage for {arch}. Continue with other options.") # Faking already built it so to skip other checks. self.built[arch] = True continue if self.built[arch]: - print("A build for {arch} was already found. Skipping specific packages.".format(arch = arch)) + print(f"A build for {arch} was already found. Skipping specific packages.") continue + # Identifying downloads contents = etree.HTML(urllib.request.urlopen(self.url[arch]).read()).xpath("//td/a") self.tarballs[arch] = [ x.text for x in contents if x.text.endswith('tar.gz') and 'deb' in x.text ] tarballs = self.tarballs[arch] maintarball = tarballs[0] + # Create and change directory to the download location os.makedirs(self.download_path, exist_ok = True) os.chdir(self.download_path) for archive in tarballs: # If the archive is already there, do not do anything. - if os.path.exists(os.path.join(self.download_path, archive)): - print("Archive %s is already there! Sweet" % archive) + if os.path.exists(archive): continue # Download the archive try: urllib.request.urlretrieve(self.url[arch] + archive, archive) except: - print("Failed to download {archive}.".format(archive = archive)) - - print("Got %s." % archive) + print(f"Failed to download {archive}.") + print(f"Finished downloads for {self.version}.") def build(self): """Building all the versions.""" - # We have 4 builds to do: - # * standard languages, no help - # * standard languages + offline help - # * all languages, no help - # * all languages + offline help for arch in self.arch: if self.built[arch]: @@ -190,28 +172,18 @@ class Build(object): # Preparation tasks self.appnamedir = os.path.join(self.builddir, self.appname) - self.appimagedir = os.path.join(self.builddir, self.appname, self.appname + '.AppDir') - os.makedirs(self.appimagedir, exist_ok = True) # And then cd to the appname folder. os.chdir(self.appnamedir) # Download appimagetool from github - appimagetoolurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-{arch}.AppImage".format(arch = arch) + appimagetoolurl = f"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-{arch}.AppImage" urllib.request.urlretrieve(appimagetoolurl, 'appimagetool') os.chmod('appimagetool', 0o755) # Build the requested version. - if self.queried_name and not self.portable: - # If it is portable, do not generate a generalized version - self.__unpackbuild__(arch, True) self.__unpackbuild__(arch) - def __unpackbuild__(self, arch, generalize = False): - if generalize and self.portable: - # Doesn't particularly make sense to build a generic portable - # version. Just skipping the specific generic build - return - + def __unpackbuild__(self, arch): # We start by filtering out tarballs from the list buildtarballs = [ self.tarballs[arch][0] ] @@ -243,35 +215,38 @@ class Build(object): else: buildtarballs.extend([ x for x in self.tarballs[arch] if ('langpack' + lang) in x ]) - # Unpacking the tarballs - for archive in buildtarballs: - subprocess.run("tar xzf {folder}/{archive}".format(folder = self.download_path, archive = archive), shell=True) - os.chdir(self.appnamedir) + # Unpacking the tarballs + for archive in buildtarballs: + subprocess.run(shlex.split(f"tar xzf {self.download_path}/{archive}")) + + # create appimagedir + self.appimagedir = os.path.join(self.builddir, self.appname, self.appname + '.AppDir') os.makedirs(self.appimagedir, exist_ok = True) + # At this point, let's decompress the deb packages - subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True, cwd=self.appimagedir) + subprocess.run(shlex.split("find .. -iname '*.deb' -exec dpkg -x {} . \;"), cwd=self.appimagedir) if self.portable: - shortversion = str.join('.', self.version.split('.')[:3]) - subprocess.run("find . -type f -iname 'bootstraprc' -exec sed -i 's|^UserInstallation=.*|UserInstallation=\$SYSUSERCONFIG/libreoffice/%s|g' {} \+" % shortversion, shell=True, cwd=self.appimagedir) + subprocess.run(shlex.split("find . -type f -iname 'bootstraprc' -exec sed -i 's|^UserInstallation=.*|UserInstallation=\$SYSUSERCONFIG/libreoffice/%s|g' {} \+" % self.short_version), cwd=self.appimagedir) # Changing desktop file - subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True, cwd=self.appimagedir) - subprocess.run("sed -i -e 's:^Name=.*$:Name=%s:' startcenter.desktop" % self.appname, shell=True, cwd=self.appimagedir) + subprocess.run(shlex.split("find . -iname startcenter.desktop -exec cp {} . \;"), cwd=self.appimagedir) + subprocess.run(shlex.split("sed -i -e 's:^Name=.*$:Name=%s:' startcenter.desktop" % self.appname), cwd=self.appimagedir) - subprocess.run("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;", shell=True, cwd=self.appimagedir) + subprocess.run(shlex.split("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;"), cwd=self.appimagedir) # Find the name of the binary called in the desktop file. - binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True, cwd=self.appimagedir).decode('utf-8').strip('\n') + binary_exec = subprocess.run(shlex.split("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'"), cwd=self.appimagedir, text=True, encoding='utf-8') + binaryname = binary_exec.stdout.strip("\n") bindir=os.path.join(self.appimagedir, 'usr', 'bin') os.makedirs(bindir, exist_ok = True) - subprocess.run("find ../../opt -iname soffice -path '*program*' -exec ln -sf {} ./%s \;" % binaryname, shell=True, cwd=bindir) + subprocess.run(shlex.split("find ../../opt -iname soffice -path '*program*' -exec ln -sf {} ./%s \;" % binaryname), cwd=bindir) # Download AppRun from github - apprunurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}".format(arch = arch) + apprunurl = f"https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}" dest = os.path.join(self.appimagedir, 'AppRun') urllib.request.urlretrieve(apprunurl, dest) os.chmod(dest, 0o755) @@ -280,57 +255,36 @@ class Build(object): buildopts = [] if self.sign: buildopts.append('--sign') - - # Building app + + # adding zsync build if updatable if self.updatable: - # Updatable make sense only for generic images for fresh, still, - # daily. If a request was for a specific version, I'd not build an - # updatable version. - # zsync name was generated already + buildopts.append(f"-u 'zsync|{self.zsyncfilename[arch]}'") - # If asked to do a generalized build: - if generalize: - subprocess.run("VERSION={version} ./appimagetool {buildopts} -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = self.genappversion, buildopts = str.join(' ', buildopts), zsync = self.genappimagefilename[arch] + '.zsync', appname = self.appname), shell=True) - # Build version file management - with open(self.genappimagefilename[arch] + '.ver', 'w') as v: - v.write(self.version) - else: - subprocess.run("VERSION={version} ./appimagetool {buildopts} -u 'zsync|{zsync}' -v ./{appname}.AppDir/".format(version = self.appversion, buildopts = str.join(' ', buildopts), zsync = self.appimagefilename[arch] + '.zsync', appname = self.appname), shell=True) - - else: - if generalize: - subprocess.run("VERSION={version} ./appimagetool {buildopts} -v ./{appname}.AppDir/".format(version = self.genappversion, buildopts = str.join(' ', buildopts), appname = self.appname), shell=True) - with open(self.genappimagefilename[arch] + '.ver', 'w') as v: - v.write(self.version) - else: - subprocess.run("VERSION={version} ./appimagetool {buildopts} -v ./{appname}.AppDir/".format(version = self.appversion, buildopts = str.join(' ', buildopts), appname = self.appname), shell=True) - - print("Built AppImage version {version}".format(version = self.appversion)) + buildopts_str = str.join(' ', buildopts) + # Build the number-specific build + subprocess.run(shlex.split(f"VERSION={self.appversion} ./appimagetool {buildopts_str} -v ./{self.appname}.AppDir/")) + + print(f"Built AppImage version {self.appversion}") # Cleanup phase, before new run. for deb in glob.glob(self.appnamedir + '/*.deb'): os.remove(deb) - subprocess.run("find . -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \+", shell=True) + subprocess.run(shlex.split("find . -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \+")) def checksums(self): """Create checksums of the built versions.""" + # Skip checksum if initally the build was already found in the storage directory if all(self.built.values()): - # All checksums are already created. - return - - # On the contrary, checksums will be in any case overwritten if - # existent, but generated only for built packages anyways + return os.chdir(self.appnamedir) - for appimage in glob.glob('*.AppImage*'): - if appimage.endswith('.ver'): - # Skipping checksums for .ver files. - continue - - # See if a checksum already exist - if not os.path.exists(appimage + '.md5'): - subprocess.run("md5sum {appimage} > {appimage}.md5".format(appimage = appimage), shell=True) + for arch in self.arch: + for item in [ self.appimagefilename[arch], self.zsyncfilename[arch] ]: + # For any built arch, find out if a file exist. + if len(glob.glob(self.appimagefilename[arch] + '.md5')) == 0: + # Build checksum + subprocess.run(shlex.split(f"md5sum {item} > {item}.md5")) def publish(self): @@ -342,7 +296,41 @@ class Build(object): os.chdir(self.appnamedir) # Forcing creation of subfolders, in case there is a new build os.makedirs(self.full_path, exist_ok = True) - subprocess.run("find . -iname '*.AppImage*' -exec cp -f {} %s \;" % self.full_path, shell=True) + for file in glob.glob("*.AppImage*"): + subprocess.run(shlex.split(f"cp -f {file} {self.fullpath}")) + + + def generalize_and_link(self): + """Creates the needed generalized files if needed.""" + # If called with a pointed version, no generalize and link necessary. + if not self.branch_version: + return + + # Creating versions for short version and query text + versions = [ self.short_version, self.branch_version ] + for arch in Build.ARCHSTD: + # if the appimage for the reported arch is not found, skip to next + # arch + if not os.path.exists(self.appimagefilename[arch]): + continue + + # Doing it both for short_name and for branchname + for version in versions: + 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 + 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]))) + # Do not continue if no zsync file is provided. + if not self.updatable: + continue + + os.copy(self.zsyncfilename[arch], zsyncfilename[arch]) + # Editing the zsyncfile + subprocess.run(shlex.split(f"sed -i'' -e 's/^Filename:.*$/Filename: {appimagefilename[arch]}/' {zsyncfilename[arch]}")) def __del__(self): diff --git a/scripts/loaih-build b/scripts/loaih-build index 7a1ead4..08c3892 100644 --- a/scripts/loaih-build +++ b/scripts/loaih-build @@ -12,7 +12,7 @@ import loaih @click.option('-l', '--language', 'language', default = 'basic', type=str, help="Languages to be included. Options: basic, standard, full, a language string (e.g. 'it') or a list of languages comma separated (e.g.: 'en-US,en-GB,it'). Default: basic") @click.option('-o/-O', '--offline-help/--no-offline-help', 'offline', default = False, help="Include or not the offline help for the chosen languages. Default: no offline help") @click.option('-p/-P', '--portable/--no-portable', 'portable', default = False, help="Create a portable version of the AppImage or not. Default: no portable") -@click.option('-r', '--repo-path', 'repo_path', default = '/srv/http/appimage.sys42.eu', type=str, help="Path to the final storage of the AppImage. Default: /srv/http/appimage.sys42.eu") +@click.option('-r', '--repo-path', 'repo_path', default = '/mnt/appimage', type=str, help="Path to the final storage of the AppImage. Default: /mnt/appimage") @click.option('-s/-S', '--sign/--no-sign', 'sign', default=False, help="Wether to sign the build. Default: no-sign") @click.option('-u/-U', '--updatable/--no-updatable', 'updatable', default = True, help="Create an updatable version of the AppImage or not. Default: updatable") @click.argument('query') @@ -57,6 +57,7 @@ def build(arch, language, offline, portable, updatable, download_path, repo_path obj.build() obj.checksums() obj.publish() + obj.generalize_and_link() del obj else: From c5fac68a0106f8f273642ae401baad7da4ecf1b5 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:01:21 +0200 Subject: [PATCH 02/24] Correzione chiamata funzione privata per generazione nome file appimage. --- loaih/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 3c20115..f498f9e 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -68,7 +68,7 @@ class Build(object): # Building the required names for arch in Build.ARCHSTD: - self.appimagefilename[arch] = __genappimagefilename__(self.version, arch) + self.appimagefilename[arch] = __gen_appimagefilename__(self.version, arch) self.zsyncfilename[arch] = self.appimagefilename[arch] + '.zsync' # Mandate to the private function to calculate the full_path available From 648883d514f565b28bf8744eda5ca457886b4310 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:02:39 +0200 Subject: [PATCH 03/24] Ancora correzione sul richiamo funzione privata. --- loaih/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index f498f9e..7213a08 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -68,7 +68,7 @@ class Build(object): # Building the required names for arch in Build.ARCHSTD: - self.appimagefilename[arch] = __gen_appimagefilename__(self.version, arch) + self.appimagefilename[arch] = self.__gen_appimagefilename__(self.version, arch) self.zsyncfilename[arch] = self.appimagefilename[arch] + '.zsync' # Mandate to the private function to calculate the full_path available From dc620f4b09e384433cf19e5fdfda5ec5efacc349 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:05:14 +0200 Subject: [PATCH 04/24] Mancata creazione directory di build. --- loaih/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/loaih/__init__.py b/loaih/__init__.py index 7213a08..65ecdef 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -172,6 +172,7 @@ class Build(object): # Preparation tasks self.appnamedir = os.path.join(self.builddir, self.appname) + os.makedirs(self.appnamedir, exist_ok=True) # And then cd to the appname folder. os.chdir(self.appnamedir) # Download appimagetool from github From ff51cf8e51d60bfe5c3b00457b4eccfac7bf822a Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:28:18 +0200 Subject: [PATCH 05/24] Cambio logica per trovare il binaryname. --- loaih/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 65ecdef..e3fe8e7 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -239,8 +239,16 @@ class Build(object): subprocess.run(shlex.split("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;"), cwd=self.appimagedir) # Find the name of the binary called in the desktop file. - binary_exec = subprocess.run(shlex.split("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'"), cwd=self.appimagedir, text=True, encoding='utf-8') - binaryname = binary_exec.stdout.strip("\n") + binaryname = '' + with open(os.path.join(self.appimagedir, 'startcenter.desktop'), 'r') as d: + a = d.readlines() + for line in a: + if re.match(r'^Exec', line): + binaryname = line.split('=')[-1].split(' ')[0] + # Esci al primo match + break + #binary_exec = subprocess.run(shlex.split(r"awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'"), cwd=self.appimagedir, text=True, encoding='utf-8') + #binaryname = binary_exec.stdout.strip("\n") bindir=os.path.join(self.appimagedir, 'usr', 'bin') os.makedirs(bindir, exist_ok = True) From 94be1e6ac9ee339612ad5078541df152fae372a6 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:32:10 +0200 Subject: [PATCH 06/24] Chiamata build con variabile d'ambiente. --- loaih/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index e3fe8e7..249a32d 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -271,7 +271,7 @@ class Build(object): buildopts_str = str.join(' ', buildopts) # Build the number-specific build - subprocess.run(shlex.split(f"VERSION={self.appversion} ./appimagetool {buildopts_str} -v ./{self.appname}.AppDir/")) + subprocess.run(shlex.split(f"{self.appnamedir}/appimagetool {buildopts_str} -v ./{self.appname}.AppDir/"), env={ 'VERSION': self.appversion }) print(f"Built AppImage version {self.appversion}") From b97939ede698a21e4bcdee49cb877b212c08285a Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:36:47 +0200 Subject: [PATCH 07/24] Ancora sostituzione stringhe. --- loaih/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 249a32d..caca32d 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -78,7 +78,7 @@ class Build(object): def __gen_appimagefilename__(self, version, arch): """Generalize the construction of the name of the app.""" - return self.appname + f'-{version}' + self.languagepart + self.helppart + f'-{arch}.AppImage' + return self.appname + f"-{version}" + self.languagepart + self.helppart + f'-{arch}.AppImage' def __calculate_full_path__(self): From bf1d9e044694a75145e54f3b8faf037dacb7dc3e Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:41:17 +0200 Subject: [PATCH 08/24] Ancora su versione lanciata in ambiente. --- loaih/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index caca32d..63dc18a 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -86,7 +86,7 @@ class Build(object): if len(self.relative_path) == 0: if self.query == 'daily': self.relative_path.append('daily') - elif self.query == 'prerelease': + elif self.query == 'primageerelease': self.relative_path.append('prerelease') # Not the same check, an additional one @@ -271,7 +271,7 @@ class Build(object): buildopts_str = str.join(' ', buildopts) # Build the number-specific build - subprocess.run(shlex.split(f"{self.appnamedir}/appimagetool {buildopts_str} -v ./{self.appname}.AppDir/"), env={ 'VERSION': self.appversion }) + subprocess.run(shlex.split(f"{self.appnamedir}/appimagetool {buildopts_str} -v ./{self.appname}.AppDir/"), env={ "VERSION": self.appversion }) print(f"Built AppImage version {self.appversion}") @@ -291,7 +291,7 @@ class Build(object): for arch in self.arch: for item in [ self.appimagefilename[arch], self.zsyncfilename[arch] ]: # For any built arch, find out if a file exist. - if len(glob.glob(self.appimagefilename[arch] + '.md5')) == 0: + if not os.path.exists(f"{item}.md5"): # Build checksum subprocess.run(shlex.split(f"md5sum {item} > {item}.md5")) @@ -306,7 +306,7 @@ class Build(object): # Forcing creation of subfolders, in case there is a new build os.makedirs(self.full_path, exist_ok = True) for file in glob.glob("*.AppImage*"): - subprocess.run(shlex.split(f"cp -f {file} {self.fullpath}")) + subprocess.run(shlex.split(f"cp -f {file} {self.full_path}")) def generalize_and_link(self): From 076d5389d6284ad238b950aea98221200d122843 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:45:42 +0200 Subject: [PATCH 09/24] Aggiunta variabile di debug. --- loaih/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 63dc18a..62b4c32 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -18,6 +18,7 @@ class Build(object): # Getting versions and so on v = versions.BuildVersion(self.query) self.version = v.version + print(f"Debug {self.version}") self.short_version = str.join('.', self.version.split('.')[0:2]) self.branch_version = None if not '.' in self.query: @@ -78,7 +79,7 @@ class Build(object): def __gen_appimagefilename__(self, version, arch): """Generalize the construction of the name of the app.""" - return self.appname + f"-{version}" + self.languagepart + self.helppart + f'-{arch}.AppImage' + return self.appname + "-" + version + self.languagepart + self.helppart + f'-{arch}.AppImage' def __calculate_full_path__(self): From b5edfce8abbdd98f8631256feed557117e669b5b Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:56:04 +0200 Subject: [PATCH 10/24] =?UTF-8?q?Scrittura=20md5=20pi=C3=B9=20pythonica.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- loaih/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 62b4c32..e49ff35 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -115,12 +115,10 @@ class Build(object): # Build stays false, and we go to the next arch continue - if res.stdout: + if res.stdout and len(res.stdout.strip("\n")) > 0: # All good, the command was executed fine. - for file in res.stdout.strip('\n').split('\n'): - if self.version in open(file, 'r').read(): - print(f"Build for {self.version} found.") - self.built[arch] = True + print(f"Build for {self.version} found.") + self.built[arch] = True if self.built[arch]: print(f"The requested AppImage already exists on storage for {arch}. I'll skip downloading, building and moving the results.") @@ -294,7 +292,10 @@ class Build(object): # For any built arch, find out if a file exist. if not os.path.exists(f"{item}.md5"): # Build checksum - subprocess.run(shlex.split(f"md5sum {item} > {item}.md5")) + checksum = subprocess.run(shlex.split(f"md5sum {item}"), capture_output=True, text=True, encoding='utf-8') + if checksum.stdout: + with open(f"{item}.md5", 'w+') as f: + f.write(checksum.stdout) def publish(self): From 8ded57a1548ec717a2fc7e2c45b44e5292e5bfdf Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 01:59:23 +0200 Subject: [PATCH 11/24] Forse sistemata versione appimage. --- loaih/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index e49ff35..ba132fd 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -79,7 +79,8 @@ class Build(object): def __gen_appimagefilename__(self, version, arch): """Generalize the construction of the name of the app.""" - return self.appname + "-" + version + self.languagepart + self.helppart + f'-{arch}.AppImage' + self.appversion = self.appname + f'-{version}' + self.languagepart + self.helppart + return self.appversion + f'-{arch}.AppImage' def __calculate_full_path__(self): From be02b5076c1494f5fe2bf26257114ab16acbb1df Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 02:01:39 +0200 Subject: [PATCH 12/24] Ancora microfix a versione. --- loaih/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index ba132fd..0c57bc9 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -79,8 +79,8 @@ class Build(object): def __gen_appimagefilename__(self, version, arch): """Generalize the construction of the name of the app.""" - self.appversion = self.appname + f'-{version}' + self.languagepart + self.helppart - return self.appversion + f'-{arch}.AppImage' + self.appversion = version + self.languagepart + self.helppart + return self.appname + f'-{self.appversion}-{arch}.AppImage' def __calculate_full_path__(self): From e51b55b41eeea6b7d33204f0f38b97bccc74bb96 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 22:59:59 +0200 Subject: [PATCH 13/24] Cambiata parte finale di implementazione per creazione file generalizzati. --- loaih/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 0c57bc9..5c08954 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -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]}")) From dbad601df9c33261ad3c3e210609d0936efc51c5 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 23:06:49 +0200 Subject: [PATCH 14/24] Chiamo la generalizzazione. --- scripts/loaih-build | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/loaih-build b/scripts/loaih-build index 08c3892..2f830de 100644 --- a/scripts/loaih-build +++ b/scripts/loaih-build @@ -84,6 +84,7 @@ def build(arch, language, offline, portable, updatable, download_path, repo_path obj.build() obj.checksums() obj.publish() + obj.generalize_and_link() del obj if __name__ == '__main__': From b21c06038da3dd58c7580f45b9fd41f9a942d912 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 23:14:47 +0200 Subject: [PATCH 15/24] Correzione al codice per generalize. --- loaih/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loaih/__init__.py b/loaih/__init__.py index 5c08954..caa40e2 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -318,6 +318,8 @@ class Build(object): # If called with a pointed version, no generalize and link necessary. if not self.branch_version: return + appimagefilename = {} + zsyncfilename = {} # Creating versions for short version and query text versions = [ self.short_version, self.branch_version ] From f2d0630c157f9681e5a79ac37848f8488e2020cc Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 8 Apr 2022 23:26:50 +0200 Subject: [PATCH 16/24] Rimossi file di destinazione in caso di esistenza. --- loaih/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loaih/__init__.py b/loaih/__init__.py index caa40e2..a2fdd52 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -337,6 +337,8 @@ class Build(object): # Create the symlink print(f"Creating {appimagefilename[arch]} and checksums.") + if os.path.exists(appimagefilename[arch]): + os.unlink(appimagefilename[arch]) os.symlink(self.appimagefilename[arch], appimagefilename[arch]) # Create the checksum for the AppImage subprocess.run(shlex.split(f"md5sum {appimagefilename[arch]} > {appimagefilename[arch]}.md5")) @@ -345,6 +347,8 @@ class Build(object): continue print(f"Creating zsync file for version {version}.") + if os.path.exists(zsyncfilename[arch]): + os.unlink(zsyncfilename[arch]) 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]}")) From ca1ab61e0c0303566692819885a080d886912349 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 00:06:29 +0200 Subject: [PATCH 17/24] Sistemata modifica in place con sed. --- loaih/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index a2fdd52..7aae124 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -235,7 +235,7 @@ class Build(object): # Changing desktop file subprocess.run(shlex.split("find . -iname startcenter.desktop -exec cp {} . \;"), cwd=self.appimagedir) - subprocess.run(shlex.split("sed -i -e 's:^Name=.*$:Name=%s:' startcenter.desktop" % self.appname), cwd=self.appimagedir) + subprocess.run(shlex.split("sed --in-place 's:^Name=.*$:Name=%s:' startcenter.desktop > startcenter.desktop" % self.appname), cwd=self.appimagedir) subprocess.run(shlex.split("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;"), cwd=self.appimagedir) @@ -351,7 +351,7 @@ class Build(object): os.unlink(zsyncfilename[arch]) 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]}")) + subprocess.run(shlex.split(f"sed --in-place 's/^Filename:.*$/Filename: {appimagefilename[arch]}/' {zsyncfilename[arch]}")) def __del__(self): From ebf1e22b0abd1089f266972509139a6fa18e6f0b Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 00:33:11 +0200 Subject: [PATCH 18/24] =?UTF-8?q?Cambio=20del=20default=20per=20firma:=20s?= =?UTF-8?q?=C3=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/loaih-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/loaih-build b/scripts/loaih-build index 2f830de..94cda81 100644 --- a/scripts/loaih-build +++ b/scripts/loaih-build @@ -13,7 +13,7 @@ import loaih @click.option('-o/-O', '--offline-help/--no-offline-help', 'offline', default = False, help="Include or not the offline help for the chosen languages. Default: no offline help") @click.option('-p/-P', '--portable/--no-portable', 'portable', default = False, help="Create a portable version of the AppImage or not. Default: no portable") @click.option('-r', '--repo-path', 'repo_path', default = '/mnt/appimage', type=str, help="Path to the final storage of the AppImage. Default: /mnt/appimage") -@click.option('-s/-S', '--sign/--no-sign', 'sign', default=False, help="Wether to sign the build. Default: no-sign") +@click.option('-s/-S', '--sign/--no-sign', 'sign', default=True, help="Wether to sign the build. Default: sign") @click.option('-u/-U', '--updatable/--no-updatable', 'updatable', default = True, help="Create an updatable version of the AppImage or not. Default: updatable") @click.argument('query') def build(arch, language, offline, portable, updatable, download_path, repo_path, check, sign, query): From e84f275f42ee4dc0c78fd266c82e6849c799fe4e Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 01:18:12 +0200 Subject: [PATCH 19/24] Cambiato sistema di ricerca delle release - ora basate su DownloadPage. --- loaih/versions.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/loaih/versions.py b/loaih/versions.py index fa0d972..201e531 100644 --- a/loaih/versions.py +++ b/loaih/versions.py @@ -6,6 +6,7 @@ from lxml import etree from packaging.version import parse as parse_version class BuildVersion(object): + DOWNLOADPAGE = "https://www.libreoffice.org/download/download/" ARCHIVE = "https://downloadarchive.documentfoundation.org/libreoffice/old/" RELEASE = "https://download.documentfoundation.org/libreoffice/stable/" DAILY = "https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@tb87-TDF/" @@ -67,13 +68,23 @@ class BuildVersion(object): return { 'version': version, 'basedirurl': basedirurl } # Stable releases. - versions = etree.HTML(urllib.request.urlopen(BuildVersion.RELEASE).read()).xpath('//td/a') - index = 1 + # Old approach - Doesn't really work because RelEng can screw order. + #versions = etree.HTML(urllib.request.urlopen(BuildVersion.RELEASE).read()).xpath('//td/a') + #index = 1 + #if branch == 'still': + # index = -2 + #elif branch == 'fresh': + # index = -1 + #version = self.__getlatestrel(versions[index].text.strip('/')) + + # Now I'll rely on DownloadPage + versions = etree.HTML(urllib.request.urlopen(BuildVersion.DOWNLOADPAGE).read()).xpath('//span[@class="dl_version_number"]') + index = 0 if branch == 'still': - index = -2 + index = 1 elif branch == 'fresh': - index = -1 - version = self.__getlatestrel(versions[index].text.strip('/')) + index = 0 + version = self.__getlatestrel(versions[index].text) return { 'version': version, 'basedirurl': self.__getbaseurl(version) } From a3380cecc449a50bd1f36de84f2c803c417938fe Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 01:30:47 +0200 Subject: [PATCH 20/24] Creata funzione di comodo per creazione dei checksum. --- loaih/__init__.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index 7aae124..3ee146a 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -292,14 +292,17 @@ class Build(object): for arch in self.arch: for item in [ self.appimagefilename[arch], self.zsyncfilename[arch] ]: # For any built arch, find out if a file exist. - if not os.path.exists(f"{item}.md5"): - # Build checksum - checksum = subprocess.run(shlex.split(f"md5sum {item}"), capture_output=True, text=True, encoding='utf-8') - if checksum.stdout: - with open(f"{item}.md5", 'w+') as f: - f.write(checksum.stdout) + self.__create_checksum__(item) + def __create_checksum__(self, file): + """Internal function to create checksum file.""" + if not os.path.exists(f"{file}.md5"): + checksum = subprocess.run(shlex.split(f"md5sum {file}"), capture_output=True, text=True, encoding='utf-8') + if checksum.stdout: + with open(f"{file}.md5", 'w+') as c: + c.write(checksum.stdout) + def publish(self): """Moves built versions to definitive storage.""" if all(self.built.values()): @@ -324,6 +327,10 @@ class Build(object): # Creating versions for short version and query text versions = [ self.short_version, self.branch_version ] for arch in Build.ARCHSTD: + # If already built, do not do anything. + if self.built[arch]: + continue + os.chdir(self.full_path) # if the appimage for the reported arch is not found, skip to next # arch @@ -341,7 +348,7 @@ class Build(object): os.unlink(appimagefilename[arch]) os.symlink(self.appimagefilename[arch], appimagefilename[arch]) # Create the checksum for the AppImage - subprocess.run(shlex.split(f"md5sum {appimagefilename[arch]} > {appimagefilename[arch]}.md5")) + self.__create_checksum__(appimagefilename[arch]) # Do not continue if no zsync file is provided. if not self.updatable: continue From b0d1386b49852b2f2aafef22838708e6286169c0 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 01:41:48 +0200 Subject: [PATCH 21/24] Aggiunto file per test con buildfile. Creati checksum anche per .zsync. --- loaih/__init__.py | 1 + test.yml | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test.yml diff --git a/loaih/__init__.py b/loaih/__init__.py index 3ee146a..dbfbd82 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -359,6 +359,7 @@ class Build(object): shutil.copyfile(self.zsyncfilename[arch], zsyncfilename[arch]) # Editing the zsyncfile subprocess.run(shlex.split(f"sed --in-place 's/^Filename:.*$/Filename: {appimagefilename[arch]}/' {zsyncfilename[arch]}")) + self.__create_checksum__(zsyncfilename[arch]) def __del__(self): diff --git a/test.yml b/test.yml new file mode 100644 index 0000000..731b596 --- /dev/null +++ b/test.yml @@ -0,0 +1,12 @@ +--- +data: + repo: /mnt/appimage + download: /var/tmp/downloads + force: no + sign: yes + +builds: + - query: fresh + language: basic + offline_help: no + portable: no From 529cd1d0c80638632756330314e2eccfe1c9e641 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 01:44:06 +0200 Subject: [PATCH 22/24] Sistemazione closing quote. --- loaih/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index dbfbd82..f5048b4 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -110,7 +110,7 @@ class Build(object): for arch in self.arch: print(f"Searching for {self.appimagefilename[arch]}") - res = subprocess.run(shlex.split(f"find {self.full_path} -name {self.appimagefilename[arch]}'"), capture_output=True, env={ "LC_ALL": "C" }, text=True, encoding='utf-8') + res = subprocess.run(shlex.split(f"find {self.full_path} -name {self.appimagefilename[arch]}"), capture_output=True, env={ "LC_ALL": "C" }, text=True, encoding='utf-8') if "No such file or directory" in res.stderr: # Folder is not existent: so the version was not built From 6fb7b052fe28f20451427850bbbdbbd63f6eb8c3 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 01:56:29 +0200 Subject: [PATCH 23/24] Forzata scrittura delle checksum. --- loaih/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/loaih/__init__.py b/loaih/__init__.py index f5048b4..a612057 100644 --- a/loaih/__init__.py +++ b/loaih/__init__.py @@ -297,11 +297,10 @@ class Build(object): def __create_checksum__(self, file): """Internal function to create checksum file.""" - if not os.path.exists(f"{file}.md5"): - checksum = subprocess.run(shlex.split(f"md5sum {file}"), capture_output=True, text=True, encoding='utf-8') - if checksum.stdout: - with open(f"{file}.md5", 'w+') as c: - c.write(checksum.stdout) + checksum = subprocess.run(shlex.split(f"md5sum {file}"), capture_output=True, text=True, encoding='utf-8') + if checksum.stdout: + with open(f"{file}.md5", 'w') as c: + c.write(checksum.stdout) def publish(self): """Moves built versions to definitive storage.""" From 380fd7029e6314f598dab0ffd631e816d70831c4 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 9 Apr 2022 02:02:04 +0200 Subject: [PATCH 24/24] Forzato build in test.yml. --- test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.yml b/test.yml index 731b596..faf4464 100644 --- a/test.yml +++ b/test.yml @@ -2,7 +2,7 @@ data: repo: /mnt/appimage download: /var/tmp/downloads - force: no + force: yes sign: yes builds: