Scrittura md5 più pythonica.
This commit is contained in:
parent
076d5389d6
commit
b5edfce8ab
|
@ -115,10 +115,8 @@ class Build(object):
|
||||||
# Build stays false, and we go to the next arch
|
# Build stays false, and we go to the next arch
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if res.stdout:
|
if res.stdout and len(res.stdout.strip("\n")) > 0:
|
||||||
# All good, the command was executed fine.
|
# 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.")
|
print(f"Build for {self.version} found.")
|
||||||
self.built[arch] = True
|
self.built[arch] = True
|
||||||
|
|
||||||
|
@ -294,7 +292,10 @@ class Build(object):
|
||||||
# For any built arch, find out if a file exist.
|
# For any built arch, find out if a file exist.
|
||||||
if not os.path.exists(f"{item}.md5"):
|
if not os.path.exists(f"{item}.md5"):
|
||||||
# Build checksum
|
# 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):
|
def publish(self):
|
||||||
|
|
Loading…
Reference in New Issue