diff --git a/loaih/build.py b/loaih/build.py index 0846dc3..6a8d479 100644 --- a/loaih/build.py +++ b/loaih/build.py @@ -390,16 +390,12 @@ class Build(loaih.RemoteBuild): def __create_checksum__(self, file): """Internal function to create checksum file.""" - checksum = hashlib.md5() - fullpath = os.path.join(self.appnamedir, file) + checksum = subprocess.run(shlex.split(f"md5sum {file}"), + capture_output=True, text=True, encoding='utf-8', check=True) - if os.path.exists(fullpath): - with open(os.path.join(self.appnamedir, file), 'rb') as readfile: - for chunk in iter(lambda: readfile.read(4096), b""): - checksum.update(chunk) - - with open(f"{file}.md5", 'w', encoding='utf-8') as csfile: - csfile.write(checksum.hexdigest()) + if checksum.stdout: + with open(f"{file}.md5", 'w', encoding='utf-8') as checkfile: + checkfile.write(checksum.stdout) def publish(self):