mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed upgradeable packages
This commit is contained in:
parent
5c3432feed
commit
59a78874aa
4 changed files with 13 additions and 7 deletions
|
@ -123,7 +123,7 @@ class Slackbuilds(Configs):
|
|||
def is_for_skipped(self, sbo):
|
||||
""" Condition to check if slackbuild is for skipped. """
|
||||
return (not self.utils.is_installed(sbo, self.file_pattern) or
|
||||
self.utils.is_repo_version_bigger(sbo, self.file_pattern) or
|
||||
self.utils.is_package_upgradeable(sbo, self.file_pattern) or
|
||||
self.mode == 'build' or self.utils.is_option(self.flag_reinstall, self.flags))
|
||||
|
||||
def download_slackbuilds(self):
|
||||
|
@ -331,9 +331,15 @@ class Slackbuilds(Configs):
|
|||
for package in dependencies:
|
||||
status = False
|
||||
repo_ver = SBoQueries(package).version()
|
||||
self.utils.is_repo_version_bigger(package, self.file_pattern)
|
||||
self.utils.is_package_upgradeable(package, self.file_pattern)
|
||||
|
||||
if self.utils.is_repo_version_bigger(package, self.file_pattern):
|
||||
if self.mode == 'upgrade' and self.utils.is_package_upgradeable(package, self.file_pattern):
|
||||
status = True
|
||||
|
||||
if self.mode == 'install' and not self.utils.is_installed(package, self.file_pattern):
|
||||
status = True
|
||||
|
||||
if self.mode == 'install' and self.utils.is_package_upgradeable(package, self.file_pattern):
|
||||
status = True
|
||||
|
||||
choices += [(package, repo_ver, status)]
|
||||
|
|
|
@ -29,7 +29,7 @@ class Upgrade(Configs, Utilities):
|
|||
|
||||
if inst_pkg_name not in black and inst_pkg_name in repo_packages:
|
||||
|
||||
if self.is_repo_version_bigger(inst_pkg_name, self.file_pattern):
|
||||
if self.is_package_upgradeable(inst_pkg_name, self.file_pattern):
|
||||
requires += Requires(inst_pkg_name).resolve()
|
||||
upgrade.append(inst_pkg_name)
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class Utilities:
|
|||
time.strftime(f'[{self.cyan}%H:%M:%S{self.endc}]',
|
||||
time.gmtime(elapsed_time)))
|
||||
|
||||
def is_repo_version_bigger(self, package: str, file_pattern: str) -> bool:
|
||||
def is_package_upgradeable(self, package: str, file_pattern: str) -> bool:
|
||||
""" Compare two versions. """
|
||||
installed = self.is_installed(package, file_pattern)
|
||||
if installed:
|
||||
|
|
|
@ -192,8 +192,8 @@ class ViewMessage(Configs):
|
|||
install += 1
|
||||
elif installed and self.utils.is_option(self.flag_reinstall, self.flags):
|
||||
upgrade += 1
|
||||
elif (installed and self.utils.is_repo_version_bigger(sbo, self.file_pattern) and
|
||||
self.utils.is_option(self.flag_reinstall, self.flags)):
|
||||
elif (installed and self.utils.is_package_upgradeable(sbo, self.file_pattern) and
|
||||
self.utils.is_option(self.flag_reinstall, self.flags)):
|
||||
upgrade += 1
|
||||
elif installed and option == 'remove':
|
||||
remove += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue