mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-05 11:02:14 +01:00
Fixed for checksum name
This commit is contained in:
parent
dc2c031b82
commit
c5676401da
2 changed files with 7 additions and 6 deletions
|
@ -17,19 +17,20 @@ class Md5sum:
|
||||||
self.flags: list = flags
|
self.flags: list = flags
|
||||||
self.ascii = Ascii()
|
self.ascii = Ascii()
|
||||||
|
|
||||||
def check(self, path: Union[str, Path], source: str, checksum: str, name: str) -> None:
|
def check(self, path: Union[str, Path], source: str, checksum: str) -> None:
|
||||||
""" Checksum the source. """
|
""" Checksum the source. """
|
||||||
filename = unquote(source)
|
source_file = unquote(source)
|
||||||
source_file = Path(path, filename.split('/')[-1])
|
filename = source_file.split('/')[-1]
|
||||||
|
source_path = Path(path, filename)
|
||||||
|
|
||||||
md5 = self.read_file(source_file)
|
md5 = self.read_file(source_path)
|
||||||
|
|
||||||
file_check = hashlib.md5(md5).hexdigest()
|
file_check = hashlib.md5(md5).hexdigest()
|
||||||
|
|
||||||
checksum = "".join(checksum)
|
checksum = "".join(checksum)
|
||||||
|
|
||||||
if file_check != checksum:
|
if file_check != checksum:
|
||||||
self.ascii.draw_checksum_error_box(name, checksum, file_check)
|
self.ascii.draw_checksum_error_box(filename, checksum, file_check)
|
||||||
view = ViewMessage(self.flags)
|
view = ViewMessage(self.flags)
|
||||||
view.question()
|
view.question()
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
for source, checksum in zip(sources, checksums):
|
for source, checksum in zip(sources, checksums):
|
||||||
md5sum = Md5sum(self.flags)
|
md5sum = Md5sum(self.flags)
|
||||||
md5sum.check(path, source, checksum, sbo)
|
md5sum.check(path, source, checksum)
|
||||||
|
|
||||||
def build_and_install(self) -> None:
|
def build_and_install(self) -> None:
|
||||||
""" Build the slackbuilds and install. """
|
""" Build the slackbuilds and install. """
|
||||||
|
|
Loading…
Reference in a new issue