mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-26 19:58:50 +01:00
Updated for package pattern
This commit is contained in:
parent
973f7b1ab4
commit
78fc0a79d3
5 changed files with 16 additions and 4 deletions
|
@ -61,7 +61,7 @@ class Packages(Configs):
|
|||
|
||||
self.apply_package_pattern()
|
||||
|
||||
def apply_package_pattern(self):
|
||||
def apply_package_pattern(self) -> None:
|
||||
""" Apply the pattern. """
|
||||
for pkg in self.packages:
|
||||
if pkg == '*':
|
||||
|
|
|
@ -102,7 +102,7 @@ class Dependees(Configs):
|
|||
if [r for r in req[1].split() if r == pkg]:
|
||||
yield req
|
||||
|
||||
def apply_package_pattern(self, repo: str):
|
||||
def apply_package_pattern(self, repo: str) -> None:
|
||||
""" Apply the pattern. """
|
||||
for pkg in self.packages:
|
||||
if pkg == '*':
|
||||
|
|
|
@ -65,7 +65,7 @@ class Slackbuilds(Configs):
|
|||
|
||||
self.apply_package_pattern()
|
||||
|
||||
def apply_package_pattern(self):
|
||||
def apply_package_pattern(self) -> None:
|
||||
""" Apply the pattern. """
|
||||
for pkg in self.slackbuilds:
|
||||
if pkg == '*':
|
||||
|
|
|
@ -82,7 +82,7 @@ class Tracking(Configs):
|
|||
|
||||
print(f'\n{self.grey}{how_many} dependencies for {package}{self.endc}\n')
|
||||
|
||||
def apply_package_pattern(self, packages: list, repo: str):
|
||||
def apply_package_pattern(self, packages: list, repo: str) -> list:
|
||||
""" Apply the pattern. """
|
||||
for pkg in packages:
|
||||
if pkg == '*':
|
||||
|
|
|
@ -34,6 +34,16 @@ class ViewPackage(Configs):
|
|||
self.repo_path: Path = self.repos.ponce_repo_path
|
||||
self.repo_tar_suffix: str = ''
|
||||
|
||||
@staticmethod
|
||||
def apply_package_pattern(packages: list) -> list:
|
||||
""" Apply the pattern. """
|
||||
for pkg in packages:
|
||||
if pkg == '*':
|
||||
packages.remove(pkg)
|
||||
packages += SBoQueries('').sbos()
|
||||
|
||||
return packages
|
||||
|
||||
def package(self, packages: list) -> None:
|
||||
""" View the packages from the repository. """
|
||||
color = self.colour()
|
||||
|
@ -44,6 +54,8 @@ class ViewPackage(Configs):
|
|||
red: str = color['red']
|
||||
endc: str = color['endc']
|
||||
|
||||
packages: list = self.apply_package_pattern(packages)
|
||||
|
||||
for package in packages:
|
||||
|
||||
info: list = self.session.query(
|
||||
|
|
Loading…
Add table
Reference in a new issue