mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-29 20:34:22 +01:00
Created generator allias
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
9cb48a3c1e
commit
4bdc3e2505
1 changed files with 8 additions and 4 deletions
|
@ -27,10 +27,9 @@ from slpkg.blacklist import BlackList
|
|||
from slpkg.splitting import split_package
|
||||
|
||||
|
||||
def find_package(find_pkg, directory):
|
||||
def searching(find_pkg, directory):
|
||||
"""Find packages
|
||||
"""
|
||||
pkgs = []
|
||||
if os.path.isdir(directory):
|
||||
installed = sorted(os.listdir(directory))
|
||||
blacklist = BlackList().packages(pkgs=installed, repo="local")
|
||||
|
@ -38,5 +37,10 @@ def find_package(find_pkg, directory):
|
|||
for pkg in installed:
|
||||
if (not pkg.startswith(".") and pkg.startswith(find_pkg) and
|
||||
split_package(pkg)[0] not in blacklist):
|
||||
pkgs.append(pkg)
|
||||
return pkgs
|
||||
yield pkg
|
||||
|
||||
|
||||
def find_package(pkg, path):
|
||||
"""Generator allias
|
||||
"""
|
||||
return list(searching(pkg, path))
|
Loading…
Add table
Reference in a new issue