mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
Added logging
This commit is contained in:
parent
5e0103a8e5
commit
33c6d676c2
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
from typing import Generator
|
||||
from packaging.version import parse, InvalidVersion
|
||||
|
||||
|
@ -23,6 +24,7 @@ class Upgrade(Configs):
|
|||
self.repo_for_binaries: bool = self.utils.is_option(self.flag_bin_repository, self.flags)
|
||||
|
||||
self.all_installed: list = self.utils.installed_package_names
|
||||
logging.basicConfig(filename='slpkg_upgrade.log', encoding='utf-8', level=logging.DEBUG)
|
||||
|
||||
def packages(self) -> Generator[str, None, None]:
|
||||
""" Returns the upgradable packages. """
|
||||
|
@ -64,7 +66,7 @@ class Upgrade(Configs):
|
|||
|
||||
if parse(repo_version) == parse(inst_version) and parse(repo_build) > parse(inst_build):
|
||||
return True
|
||||
except InvalidVersion:
|
||||
pass
|
||||
except InvalidVersion as err:
|
||||
logging.debug(err)
|
||||
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue