mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-26 09:58:31 +01:00
Updated glob from pathlib module
This commit is contained in:
parent
d3465166a8
commit
e736bcb026
2 changed files with 7 additions and 9 deletions
|
@ -249,12 +249,10 @@ class Slackbuilds:
|
|||
installation. """
|
||||
version = SBoQueries(name).version()
|
||||
|
||||
packages = []
|
||||
pkg = f'{name}-{version}'
|
||||
pattern = f'{name}-{version}-*{self.configs.sbo_repo_tag}*'
|
||||
|
||||
for package in os.listdir(self.configs.tmp_path):
|
||||
if pkg in package and self.configs.sbo_repo_tag in package:
|
||||
packages.append(package)
|
||||
tmp = Path(self.configs.tmp_path)
|
||||
packages = [file.name for file in tmp.glob(pattern)]
|
||||
|
||||
return max(packages)
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import glob
|
||||
import time
|
||||
import shutil
|
||||
import tarfile
|
||||
|
@ -24,11 +23,12 @@ class Utilities:
|
|||
|
||||
def is_installed(self, name: str) -> str:
|
||||
""" Returns the installed package name. """
|
||||
pattern = f'{str(self.configs.log_packages)}/*{self.configs.sbo_repo_tag}'
|
||||
packages = glob.glob(pattern)
|
||||
pattern = f'*{self.configs.sbo_repo_tag}'
|
||||
|
||||
var_log_packages = Path(self.configs.log_packages)
|
||||
packages = [file.name for file in var_log_packages.glob(pattern)]
|
||||
|
||||
for package in packages:
|
||||
package = package.split('/')[-1]
|
||||
pkg = self.split_installed_pkg(package)[0]
|
||||
|
||||
if pkg == name and pkg not in self.black.get():
|
||||
|
|
Loading…
Reference in a new issue