Updated for pathlib module

This commit is contained in:
Dimitris Zlatanidis 2023-01-09 19:48:59 +02:00
parent e736bcb026
commit a6c7e8b966

View file

@ -4,6 +4,7 @@
import os
import shutil
from typing import Any
from pathlib import Path
from distutils.version import LooseVersion
from slpkg.configs import Configs
@ -180,7 +181,10 @@ class ViewMessage:
def _view_removed(self, name: str):
""" View and creates list with packages for remove. """
installed = os.listdir(self.configs.log_packages)
pattern = f'*{self.configs.sbo_repo_tag}'
var_log_packages = Path(self.configs.log_packages)
installed = [file.name for file in var_log_packages.glob(pattern)]
if self.utils.is_installed(name):
for package in installed: