mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-05 11:02:14 +01:00
Updated for installed
This commit is contained in:
parent
2b39b88986
commit
c5b62a936b
1 changed files with 4 additions and 13 deletions
|
@ -40,20 +40,11 @@ class Utilities(Configs):
|
||||||
|
|
||||||
def all_installed(self) -> dict:
|
def all_installed(self) -> dict:
|
||||||
""" Return all installed packages from /val/log/packages folder. """
|
""" Return all installed packages from /val/log/packages folder. """
|
||||||
var_log_packages: Path = Path(self.log_packages)
|
for file in self.log_packages.glob(self.file_pattern):
|
||||||
|
name: str = self.split_binary_pkg(file.name)[0]
|
||||||
|
|
||||||
try:
|
if not name.startswith('.') and not self.blacklist_pattern(name):
|
||||||
for file in var_log_packages.glob(self.file_pattern):
|
yield name, file.name
|
||||||
name = self.split_binary_pkg(file.name)[0]
|
|
||||||
|
|
||||||
if not name.startswith('.') and not self.blacklist_pattern(name):
|
|
||||||
yield name, file.name
|
|
||||||
|
|
||||||
except ValueError as err:
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
logger.info('%s: %s: %s', self.__class__.__name__,
|
|
||||||
Utilities.all_installed.__name__,
|
|
||||||
err)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def remove_file_if_exists(path: Path, file: str) -> None:
|
def remove_file_if_exists(path: Path, file: str) -> None:
|
||||||
|
|
Loading…
Reference in a new issue