diff --git a/slpkg/binary/dependency.py b/slpkg/binary/dependency.py index ba3198b2..520e72e9 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binary/dependency.py @@ -24,7 +24,6 @@ import sys -from slpkg.utils import Utils from slpkg.toolbar import status from slpkg.__metadata__ import MetaData as _meta_ @@ -37,7 +36,6 @@ class Dependencies(object): self.packages = PACKAGES_TXT self.repo = repo self.black = black - self.names = Utils().package_name(PACKAGES_TXT) self.dep_results = [] self.meta = _meta_ @@ -55,8 +53,7 @@ class Dependencies(object): for req in requires: index += 1 toolbar_width = status(index, toolbar_width, 7) - if (req and req in self.names and - req not in self.black): + if req and req not in self.black: dependencies.append(req) if dependencies: self.dep_results.append(dependencies) diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index 11048d16..74d66cb8 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -29,6 +29,7 @@ from slpkg.utils import Utils from slpkg.sizes import units from slpkg.messages import Msg from slpkg.remove import delete +from slpkg.toolbar import status from slpkg.checksum import check_md5 from slpkg.blacklist import BlackList from slpkg.downloader import Download @@ -197,7 +198,10 @@ class BinaryInstall(object): if (self.meta.rsl_deps in ["on", "ON"] and self.flag != "--resolve-off"): Msg().resolving() + toolbar_width, index = 2, 0 for dep in self.packages: + index += 1 + toolbar_width = status(index, toolbar_width, 3) dependencies = [] dependencies = Utils().dimensional_list(Dependencies( self.PACKAGES_TXT, self.repo, self.blacklist).binary( diff --git a/slpkg/blacklist.py b/slpkg/blacklist.py index cb7d1184..4a8fff39 100644 --- a/slpkg/blacklist.py +++ b/slpkg/blacklist.py @@ -25,6 +25,7 @@ from utils import Utils from splitting import split_package from __metadata__ import MetaData as _meta_ +from slpkg.pkg.find import find_package class BlackList(object): @@ -139,3 +140,8 @@ class BlackList(object): if bl not in black and "*" not in bl: black.append(bl) return black + + def installed(self): + """Return all installed packages + """ + return find_package("", _meta_.pkg_path) diff --git a/slpkg/pkg/find.py b/slpkg/pkg/find.py index ba62504a..3f9c9ac0 100644 --- a/slpkg/pkg/find.py +++ b/slpkg/pkg/find.py @@ -23,7 +23,7 @@ import os -from slpkg.blacklist import BlackList +# from slpkg.blacklist import BlackList from slpkg.splitting import split_package @@ -33,7 +33,7 @@ def find_package(find_pkg, directory): """ pkgs = [] installed = sorted(os.listdir(directory)) - blacklist = BlackList().packages(pkgs=installed, repo="local") + blacklist = "" if os.path.exists(directory): for pkg in installed: if (not pkg.startswith(".") and pkg.startswith(find_pkg) and diff --git a/slpkg/utils.py b/slpkg/utils.py index c89a24fd..721c54da 100644 --- a/slpkg/utils.py +++ b/slpkg/utils.py @@ -62,7 +62,7 @@ class Utils(object): Returns list with all the names of packages repository """ packages = [] - for line in PACKAGES_TXT: + for line in PACKAGES_TXT.splitlines(): if line.startswith("PACKAGE NAME:"): packages.append(split_package(line[14:].strip())[0]) return packages