mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Updated checksum check
This commit is contained in:
parent
94153d5eca
commit
0e89183985
2 changed files with 4 additions and 15 deletions
|
@ -79,19 +79,14 @@ class SBoQueries:
|
|||
|
||||
def checksum(self) -> str:
|
||||
""" Returns the source checksum. """
|
||||
md5sum, md5sum64, = [], []
|
||||
mds5, md5s64 = self.session.query(
|
||||
SBoTable.md5sum, SBoTable.md5sum64).filter(
|
||||
SBoTable.name == self.name).first()
|
||||
|
||||
if mds5:
|
||||
md5sum.append(mds5)
|
||||
if md5s64:
|
||||
md5sum64.append(md5s64)
|
||||
if self.configs.os_arch == 'x86_64' and md5s64:
|
||||
return md5s64.split()
|
||||
|
||||
if md5sum or md5sum64:
|
||||
return self._chose_arch(md5sum, md5sum64)
|
||||
return ''
|
||||
return mds5.split()
|
||||
|
||||
def description(self) -> str:
|
||||
""" Returns the slackbuild description. """
|
||||
|
@ -112,9 +107,3 @@ class SBoQueries:
|
|||
if files:
|
||||
return files[0]
|
||||
return ''
|
||||
|
||||
def _chose_arch(self, arch: list, arch64: list) -> str:
|
||||
""" Choosing the right arch. """
|
||||
if self.configs.os_arch == 'x86_64' and arch64:
|
||||
return arch64
|
||||
return arch
|
||||
|
|
|
@ -208,7 +208,7 @@ class Slackbuilds:
|
|||
|
||||
checksums = SBoQueries(name).checksum()
|
||||
|
||||
for source, checksum in zip(sources.split(), checksums[0].split()):
|
||||
for source, checksum in zip(sources.split(), checksums):
|
||||
wget.download(path, source)
|
||||
md5sum = Md5sum(self.flags)
|
||||
md5sum.check(path, source, checksum, name)
|
||||
|
|
Loading…
Add table
Reference in a new issue