Updated for package pattern

This commit is contained in:
Dimitris Zlatanidis 2023-04-01 12:33:01 +03:00
parent 973f7b1ab4
commit 78fc0a79d3
5 changed files with 16 additions and 4 deletions

View file

@ -61,7 +61,7 @@ class Packages(Configs):
self.apply_package_pattern() self.apply_package_pattern()
def apply_package_pattern(self): def apply_package_pattern(self) -> None:
""" Apply the pattern. """ """ Apply the pattern. """
for pkg in self.packages: for pkg in self.packages:
if pkg == '*': if pkg == '*':

View file

@ -102,7 +102,7 @@ class Dependees(Configs):
if [r for r in req[1].split() if r == pkg]: if [r for r in req[1].split() if r == pkg]:
yield req yield req
def apply_package_pattern(self, repo: str): def apply_package_pattern(self, repo: str) -> None:
""" Apply the pattern. """ """ Apply the pattern. """
for pkg in self.packages: for pkg in self.packages:
if pkg == '*': if pkg == '*':

View file

@ -65,7 +65,7 @@ class Slackbuilds(Configs):
self.apply_package_pattern() self.apply_package_pattern()
def apply_package_pattern(self): def apply_package_pattern(self) -> None:
""" Apply the pattern. """ """ Apply the pattern. """
for pkg in self.slackbuilds: for pkg in self.slackbuilds:
if pkg == '*': if pkg == '*':

View file

@ -82,7 +82,7 @@ class Tracking(Configs):
print(f'\n{self.grey}{how_many} dependencies for {package}{self.endc}\n') 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. """ """ Apply the pattern. """
for pkg in packages: for pkg in packages:
if pkg == '*': if pkg == '*':

View file

@ -34,6 +34,16 @@ class ViewPackage(Configs):
self.repo_path: Path = self.repos.ponce_repo_path self.repo_path: Path = self.repos.ponce_repo_path
self.repo_tar_suffix: str = '' 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: def package(self, packages: list) -> None:
""" View the packages from the repository. """ """ View the packages from the repository. """
color = self.colour() color = self.colour()
@ -44,6 +54,8 @@ class ViewPackage(Configs):
red: str = color['red'] red: str = color['red']
endc: str = color['endc'] endc: str = color['endc']
packages: list = self.apply_package_pattern(packages)
for package in packages: for package in packages:
info: list = self.session.query( info: list = self.session.query(