Updated searching

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-01-29 23:33:43 +01:00
parent 2fc4f64036
commit 9e035149bf

View file

@ -23,9 +23,7 @@
from slpkg.utils import Utils
from slpkg.toolbar import status
from slpkg.blacklist import BlackList
from slpkg.splitting import split_package
from slpkg.__metadata__ import MetaData as _meta_
@ -36,9 +34,5 @@ def search_pkg(name, repo):
PACKAGES_TXT = Utils().read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT")
names = list(Utils().package_name(PACKAGES_TXT))
blacklist = BlackList().packages(pkgs=names, repo=repo)
for line in PACKAGES_TXT.splitlines():
status(0)
if line.startswith("PACKAGE NAME: ") and len(line) > 16:
pkg_name = split_package(line[15:])[0].strip()
if name == pkg_name and name not in blacklist:
return pkg_name
if name in names and name not in blacklist:
return name