From 749bfe0f21de114855cdb915a3902abb168705f5 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 28 Jun 2015 14:25:25 +0300 Subject: [PATCH] Fixed checksum #23 --- slpkg/binary/install.py | 11 +---------- slpkg/grep_md5.py | 6 ++---- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index 0876bb0d..f134c135 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -42,8 +42,6 @@ from slpkg.get_version import get_installed_version from slpkg.pkg.find import find_package from slpkg.pkg.manager import PackageManager -from slpkg.slack.slack_version import slack_ver - from greps import repo_data from repo_init import RepoInit from dependency import Dependencies @@ -181,14 +179,7 @@ class BinaryInstall(object): """ Checksums before install """ - if self.repo == "alien" and self.version == "stable": - check_md5(pkg_checksum("/" + slack_ver() + "/" + install, - self.repo), self.tmp_path + install) - elif self.repo == "alien" and self.version == "current": - check_md5(pkg_checksum("/" + self.version + "/" + install, - self.repo), self.tmp_path + install) - else: - check_md5(pkg_checksum(install, self.repo), self.tmp_path + install) + check_md5(pkg_checksum(install, self.repo), self.tmp_path + install) def resolving_deps(self): """ diff --git a/slpkg/grep_md5.py b/slpkg/grep_md5.py index b142d45a..dd725bf9 100644 --- a/slpkg/grep_md5.py +++ b/slpkg/grep_md5.py @@ -32,7 +32,7 @@ def pkg_checksum(binary, repo): """ Return checksum from CHECKSUMS.md5 file by repository """ - md5, end = "None", "/" + md5 = "None" if repo == "slack_patches" and _meta_.slack_rel == "stable": CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading() elif repo == "slack_patches" and _meta_.slack_rel == "current": @@ -44,9 +44,7 @@ def pkg_checksum(binary, repo): f = open(lib, "r") CHECKSUMS_md5 = f.read() f.close() - if repo == "alien": - end = "" for line in CHECKSUMS_md5.splitlines(): - if line.endswith("%s%s" % (end, binary)): + if line.endswith("/{0}".format(binary)): md5 = line.split()[0] return md5