From 4d799655b7de283f1b22308d9ff78e2bc2d177f3 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 15 Jan 2019 19:07:23 +0100 Subject: [PATCH] Updated third-party option Signed-off-by: Dimitris Zlatanidis --- slpkg/pkg/manager.py | 12 +++++++----- slpkg/slack/slackware_repo.py | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index 87faf2b8..ca3349c6 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -167,12 +167,13 @@ class PackageManager(object): pkg = "" extra = "" elif "--third-party" in extra: - slackware_packages = slackware_repository() + slack_packages, slack_names = slackware_repository() slpkg_pkg = self.meta.__all__ + "-" + self.meta.__version__ binary = self.binary for pkg in find_package("", self.meta.pkg_path): + slack_name = split_package(pkg)[0] for tag in binary: - if (pkg not in slackware_packages and + if (slack_name not in slack_names and slpkg_pkg not in pkg and tag in pkg): removed.append(split_package(pkg)[0]) packages.append(pkg) @@ -406,7 +407,7 @@ class PackageManager(object): """ matching, packages = 0, [] pkg_cache, match_cache = "", "" - slackware_packages = slackware_repository() + slack_packages, slack_names = slackware_repository() print("\nPackages with matching name [ {0}{1}{2} ]\n".format( self.meta.color["CYAN"], ", ".join(self.binary), self.meta.color["ENDC"])) @@ -414,14 +415,15 @@ class PackageManager(object): for match in find_package("", self.meta.pkg_path): pkg_cache = pkg match_cache = match + split_name = split_package(match)[0] if "--case-ins" in flag: pkg_cache = pkg.lower() match_cache = match.lower() if ("--third-party" in flag and not self.binary and - match not in slackware_packages): + split_name not in slack_names): packages.append(match) if ("--third-party" in flag and pkg_cache in match_cache and - match not in slackware_packages): + split_name not in slack_names): packages.append(match) if pkg_cache in match_cache and not flag: packages.append(match) diff --git a/slpkg/slack/slackware_repo.py b/slpkg/slack/slackware_repo.py index 2a8bd428..ae88b4fa 100644 --- a/slpkg/slack/slackware_repo.py +++ b/slpkg/slack/slackware_repo.py @@ -24,16 +24,19 @@ from slpkg.utils import Utils from slpkg.binary.greps import repo_data +from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ def slackware_repository(): - """Return all official Slackware packages without the extension .txz + """Return all official Slackware packages """ - slack_repo, slackware_repo = [], [] + slack_repo, packages, names, name = [], [], [], "" slack_repo = repo_data( Utils().read_file(_meta_.lib_path + "slack_repo/PACKAGES.TXT"), "slack", "") for pkg in slack_repo[0]: - slackware_repo.append(pkg[:-4]) - return slackware_repo + name = split_package(pkg)[0] + names.append(name) + packages.append(pkg[:-4]) + return packages, names