Sostituito lancio programma con codice python.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f6bcf610ba
commit
7013318188
@ -10,6 +10,7 @@ import re
|
|||||||
import shlex
|
import shlex
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
import hashlib
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import loaih
|
import loaih
|
||||||
|
|
||||||
@ -387,13 +388,16 @@ 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 = subprocess.run(
|
|
||||||
f"md5sum {file}", shell=True, cwd=self.appnamedir,
|
checksum = hashlib.md5()
|
||||||
capture_output=True, text=True, encoding='utf-8', check=True
|
|
||||||
)
|
with open(os.path.join(self.appnamedir, file), 'rb') as readfile:
|
||||||
if checksum.stdout:
|
for chunk in iter(lambda: readfile.read(4096), b""):
|
||||||
with open(f"{file}.md5", 'w', encoding='utf-8') as csfile:
|
checksum.update(chunk)
|
||||||
csfile.write(checksum.stdout)
|
|
||||||
|
with open(f"{file}.md5", 'w', encoding='utf-8') as csfile:
|
||||||
|
csfile.write(checksum.hexdigest())
|
||||||
|
|
||||||
|
|
||||||
def publish(self):
|
def publish(self):
|
||||||
"""Moves built versions to definitive storage."""
|
"""Moves built versions to definitive storage."""
|
||||||
|
Reference in New Issue
Block a user