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):
"""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):