mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Fixed2: Wrong MD5 check #49
This commit is contained in:
parent
b61f526446
commit
6c76e27c63
1 changed files with 42 additions and 9 deletions
|
@ -59,16 +59,35 @@ class SBoGrep(object):
|
||||||
def source(self):
|
def source(self):
|
||||||
"""Grab sources downloads links
|
"""Grab sources downloads links
|
||||||
"""
|
"""
|
||||||
|
source, source64, = "", ""
|
||||||
for line in self.SLACKBUILDS_TXT.splitlines():
|
for line in self.SLACKBUILDS_TXT.splitlines():
|
||||||
if line.startswith(self.line_name):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if (self.meta.arch == "x86_64" and
|
|
||||||
line.startswith(self.line_down_64)):
|
|
||||||
if sbo_name == self.name and line[28:].strip():
|
|
||||||
return line[28:]
|
|
||||||
if line.startswith(self.line_down):
|
if line.startswith(self.line_down):
|
||||||
if sbo_name == self.name and line[21:].strip():
|
if sbo_name == self.name and line[21:].strip():
|
||||||
return line[21:]
|
source = line[21:]
|
||||||
|
if line.startswith(self.line_down_64):
|
||||||
|
if sbo_name == self.name and line[28:].strip():
|
||||||
|
source64 = line[28:]
|
||||||
|
return self._select_source_arch(source, source64)
|
||||||
|
|
||||||
|
def _select_source_arch(self, source, source64):
|
||||||
|
"""Return sources by arch
|
||||||
|
"""
|
||||||
|
src = ""
|
||||||
|
if self.meta.arch == "x86_64":
|
||||||
|
if source64:
|
||||||
|
src = source64
|
||||||
|
else:
|
||||||
|
src = source
|
||||||
|
if self.meta.skip_unst in self.answer and source64 in self.unst:
|
||||||
|
src = source
|
||||||
|
else:
|
||||||
|
if source:
|
||||||
|
src = source
|
||||||
|
if self.meta.skip_unst in self.answer and source in self.unst:
|
||||||
|
src = source64
|
||||||
|
return src
|
||||||
|
|
||||||
def requires(self):
|
def requires(self):
|
||||||
"""Grab package requirements
|
"""Grab package requirements
|
||||||
|
@ -93,16 +112,30 @@ class SBoGrep(object):
|
||||||
def checksum(self):
|
def checksum(self):
|
||||||
"""Grab checksum string
|
"""Grab checksum string
|
||||||
"""
|
"""
|
||||||
|
md5sum, md5sum64, = [], []
|
||||||
for line in self.SLACKBUILDS_TXT.splitlines():
|
for line in self.SLACKBUILDS_TXT.splitlines():
|
||||||
if line.startswith(self.line_name):
|
if line.startswith(self.line_name):
|
||||||
sbo_name = line[17:].strip()
|
sbo_name = line[17:].strip()
|
||||||
if (self.meta.arch == "x86_64" and
|
if line.startswith(self.line_md5_64):
|
||||||
line.startswith(self.line_md5_64)):
|
|
||||||
if sbo_name == self.name and line[26:].strip():
|
if sbo_name == self.name and line[26:].strip():
|
||||||
return line[26:].strip().split()
|
md5sum64 = line[26:].strip().split()
|
||||||
if line.startswith(self.line_md5):
|
if line.startswith(self.line_md5):
|
||||||
if sbo_name == self.name and line[19:].strip():
|
if sbo_name == self.name and line[19:].strip():
|
||||||
return line[19:].strip().split()
|
md5sum = line[19:].strip().split()
|
||||||
|
return self._select_md5sum_arch(md5sum, md5sum64)
|
||||||
|
|
||||||
|
def _select_md5sum_arch(self, md5sum, md5sum64):
|
||||||
|
"""Return checksums by arch
|
||||||
|
"""
|
||||||
|
if md5sum and md5sum64:
|
||||||
|
if self.meta.arch == "x86_64":
|
||||||
|
return md5sum64
|
||||||
|
else:
|
||||||
|
return md5sum
|
||||||
|
if md5sum:
|
||||||
|
return md5sum
|
||||||
|
else:
|
||||||
|
return md5sum64
|
||||||
|
|
||||||
def description(self):
|
def description(self):
|
||||||
"""Grab package verion
|
"""Grab package verion
|
||||||
|
|
Loading…
Add table
Reference in a new issue