mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-07 17:24:57 +01:00
Fixed for install
This commit is contained in:
parent
c1d877bab7
commit
cdd28f0197
2 changed files with 13 additions and 17 deletions
|
@ -100,10 +100,7 @@ class Packages(Configs):
|
||||||
|
|
||||||
for pkg in self.install_order:
|
for pkg in self.install_order:
|
||||||
|
|
||||||
skip_package: str = self.skip_installed_package(pkg)
|
if self.is_for_install(pkg):
|
||||||
|
|
||||||
if not skip_package:
|
|
||||||
|
|
||||||
mirror: str = BinQueries(pkg, self.repo).mirror()
|
mirror: str = BinQueries(pkg, self.repo).mirror()
|
||||||
location: str = BinQueries(pkg, self.repo).location()
|
location: str = BinQueries(pkg, self.repo).location()
|
||||||
package: str = BinQueries(pkg, self.repo).package_bin()
|
package: str = BinQueries(pkg, self.repo).package_bin()
|
||||||
|
@ -111,9 +108,8 @@ class Packages(Configs):
|
||||||
pkg_urls.append(f'{mirror}{location}/{package}')
|
pkg_urls.append(f'{mirror}{location}/{package}')
|
||||||
self.binary_packages.append(package)
|
self.binary_packages.append(package)
|
||||||
self.utils.remove_file_if_exists(self.tmp_slpkg, package)
|
self.utils.remove_file_if_exists(self.tmp_slpkg, package)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
version: str = self.utils.split_binary_pkg(skip_package)[1]
|
version: str = BinQueries(pkg, self.repo).version()
|
||||||
self.view_message.view_skipping_packages(pkg, version)
|
self.view_message.view_skipping_packages(pkg, version)
|
||||||
|
|
||||||
if pkg_urls:
|
if pkg_urls:
|
||||||
|
@ -121,13 +117,13 @@ class Packages(Configs):
|
||||||
down.download()
|
down.download()
|
||||||
print()
|
print()
|
||||||
|
|
||||||
def skip_installed_package(self, package) -> str:
|
def is_for_install(self, name) -> bool:
|
||||||
""" Skip installed package when the option --skip-installed is applied. """
|
""" Skip installed package when the option --skip-installed is applied. """
|
||||||
installed_package: str = self.utils.is_package_installed(package)
|
if self.utils.is_option(self.flag_skip_installed, self.flags):
|
||||||
|
return False
|
||||||
|
|
||||||
if (installed_package and self.mode == 'upgrade' and not self.upgrade.is_package_upgradeable(package)
|
if self.upgrade.is_package_upgradeable(name) or self.utils.is_option(self.flag_reinstall, self.flags):
|
||||||
or self.mode == 'install' and not self.utils.is_option(self.flag_reinstall, self.flags)):
|
return True
|
||||||
return installed_package
|
|
||||||
|
|
||||||
def checksum(self) -> None:
|
def checksum(self) -> None:
|
||||||
""" Packages checksums. """
|
""" Packages checksums. """
|
||||||
|
|
|
@ -37,18 +37,18 @@ class Upgrade(Configs):
|
||||||
if self.is_package_upgradeable(inst_package):
|
if self.is_package_upgradeable(inst_package):
|
||||||
yield inst_package
|
yield inst_package
|
||||||
|
|
||||||
def is_package_upgradeable(self, package: str) -> bool:
|
def is_package_upgradeable(self, name: str) -> bool:
|
||||||
""" Checks for installed and upgradeable packages. """
|
""" Checks for installed and upgradeable packages. """
|
||||||
inst_package: str = self.utils.is_package_installed(package)
|
inst_package: str = self.utils.is_package_installed(name)
|
||||||
inst_version: str = self.utils.split_binary_pkg(inst_package)[1]
|
inst_version: str = self.utils.split_binary_pkg(inst_package)[1]
|
||||||
inst_build: str = self.utils.split_binary_pkg(inst_package)[3]
|
inst_build: str = self.utils.split_binary_pkg(inst_package)[3]
|
||||||
|
|
||||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||||
repo_package: str = BinQueries(package, self.repo).package_bin()
|
repo_package: str = BinQueries(name, self.repo).package_bin()
|
||||||
repo_version: str = BinQueries(package, self.repo).version()
|
repo_version: str = BinQueries(name, self.repo).version()
|
||||||
repo_build: str = self.utils.split_binary_pkg(repo_package)[3]
|
repo_build: str = self.utils.split_binary_pkg(repo_package)[3]
|
||||||
else:
|
else:
|
||||||
repo_version: str = SBoQueries(package).version()
|
repo_version: str = SBoQueries(name).version()
|
||||||
repo_build: str = self.utils.read_sbo_build_tag(package)
|
repo_build: str = self.utils.read_sbo_build_tag(name)
|
||||||
|
|
||||||
return parse(repo_version + repo_build) > parse(inst_version + inst_build)
|
return parse(repo_version + repo_build) > parse(inst_version + inst_build)
|
||||||
|
|
Loading…
Reference in a new issue