From c5676401da9285c46af009571dd3d9c8578c8ca4 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 12 Mar 2023 23:51:00 +0200 Subject: [PATCH] Fixed for checksum name --- slpkg/checksum.py | 11 ++++++----- slpkg/slackbuild.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/slpkg/checksum.py b/slpkg/checksum.py index ab70cf52..eda55172 100644 --- a/slpkg/checksum.py +++ b/slpkg/checksum.py @@ -17,19 +17,20 @@ class Md5sum: self.flags: list = flags 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. """ - filename = unquote(source) - source_file = Path(path, filename.split('/')[-1]) + source_file = unquote(source) + 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() checksum = "".join(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.question() diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 0f3676e7..14373a72 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -206,7 +206,7 @@ class Slackbuilds(Configs): for source, checksum in zip(sources, checksums): md5sum = Md5sum(self.flags) - md5sum.check(path, source, checksum, sbo) + md5sum.check(path, source, checksum) def build_and_install(self) -> None: """ Build the slackbuilds and install. """