Ripristinate istruzioni originali, con chiamata a comando locale.

This commit is contained in:
Emiliano Vavassori 2023-01-07 00:30:56 +01:00
parent 6bfa6a3707
commit dff74f0a35
1 changed files with 5 additions and 9 deletions

View File

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