mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-27 09:58:10 +01:00
Added option to install
This commit is contained in:
parent
8be6761d1b
commit
1ea4217db9
3 changed files with 24 additions and 14 deletions
|
@ -157,7 +157,9 @@ Print the repository package version. (to be used with: -e, dependees, -t, track
|
||||||
--file-pattern=PATTERN
|
--file-pattern=PATTERN
|
||||||
.RS
|
.RS
|
||||||
Search for specific installed files with a pattern, such as: slpkg -f 'python' --file-pattern='*',
|
Search for specific installed files with a pattern, such as: slpkg -f 'python' --file-pattern='*',
|
||||||
prints all installed packages that include the name 'python', not only the SBo packages. (to be used with: -f, find)
|
prints all installed packages that include the name 'python', not only the SBo packages.
|
||||||
|
Also when you want to see packages that you have installed from other repositories, like:
|
||||||
|
slpkg -i podman --file-pattern='*alien'. (to be used with: -i, install, -f, find)
|
||||||
.RE
|
.RE
|
||||||
.P
|
.P
|
||||||
-h | --help
|
-h | --help
|
||||||
|
|
|
@ -130,7 +130,8 @@ class Argparse(Configs):
|
||||||
self.flag_reinstall,
|
self.flag_reinstall,
|
||||||
self.flag_skip_installed,
|
self.flag_skip_installed,
|
||||||
self.flag_search,
|
self.flag_search,
|
||||||
self.flag_no_silent
|
self.flag_no_silent,
|
||||||
|
self.flag_pattern
|
||||||
],
|
],
|
||||||
'download': [
|
'download': [
|
||||||
self.flag_yes,
|
self.flag_yes,
|
||||||
|
@ -346,7 +347,10 @@ class Argparse(Configs):
|
||||||
self.check.exists(packages)
|
self.check.exists(packages)
|
||||||
self.check.unsupported(packages)
|
self.check.unsupported(packages)
|
||||||
|
|
||||||
install = Slackbuilds(packages, self.flags, mode=command)
|
if not self.file_pattern:
|
||||||
|
self.file_pattern = f'*{self.sbo_repo_tag}'
|
||||||
|
|
||||||
|
install = Slackbuilds(packages, self.flags, self.file_pattern, mode=command)
|
||||||
install.execute()
|
install.execute()
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
self.usage.help(1)
|
self.usage.help(1)
|
||||||
|
|
|
@ -25,10 +25,11 @@ from slpkg.models.models import session as Session
|
||||||
class Slackbuilds(Configs):
|
class Slackbuilds(Configs):
|
||||||
""" Download build and install the SlackBuilds. """
|
""" Download build and install the SlackBuilds. """
|
||||||
|
|
||||||
def __init__(self, slackbuilds: list, flags: list, mode: str):
|
def __init__(self, slackbuilds: list, flags: list, file_pattern, mode: str):
|
||||||
super(Configs, self).__init__()
|
super(Configs, self).__init__()
|
||||||
self.slackbuilds = slackbuilds
|
self.slackbuilds = slackbuilds
|
||||||
self.flags = flags
|
self.flags = flags
|
||||||
|
self.file_pattern = file_pattern
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.install_order = []
|
self.install_order = []
|
||||||
self.dependencies = []
|
self.dependencies = []
|
||||||
|
@ -81,14 +82,14 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
def creating_dependencies_for_build(self):
|
def creating_dependencies_for_build(self):
|
||||||
""" List with the dependencies. """
|
""" List with the dependencies. """
|
||||||
pattern = f'*{self.sbo_repo_tag}'
|
# pattern = f'*{self.sbo_repo_tag}'
|
||||||
|
|
||||||
for deps in self.sbos.values():
|
for deps in self.sbos.values():
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
|
|
||||||
# Checks if the package was installed and skipped.
|
# Checks if the package was installed and skipped.
|
||||||
if (self.flag_skip_installed in self.flags and
|
if (self.flag_skip_installed in self.flags and
|
||||||
self.utils.is_installed(dep, pattern)):
|
self.utils.is_installed(dep, self.file_pattern)):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.dependencies.append(dep)
|
self.dependencies.append(dep)
|
||||||
|
@ -123,8 +124,9 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
def is_for_skipped(self, sbo):
|
def is_for_skipped(self, sbo):
|
||||||
""" Condition to check if slackbuild is for skipped. """
|
""" Condition to check if slackbuild is for skipped. """
|
||||||
pattern = f'*{self.sbo_repo_tag}'
|
# pattern = f'*{self.sbo_repo_tag}'
|
||||||
return (not self.utils.is_installed(sbo, pattern) or self.utils.is_repo_version_bigger(sbo) or
|
|
||||||
|
return (not self.utils.is_installed(sbo, self.file_pattern) or self.utils.is_repo_version_bigger(sbo) or
|
||||||
self.mode == 'build' or self.flag_reinstall in self.flags)
|
self.mode == 'build' or self.flag_reinstall in self.flags)
|
||||||
|
|
||||||
def download_slackbuilds(self):
|
def download_slackbuilds(self):
|
||||||
|
@ -153,7 +155,7 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
def build_and_install(self):
|
def build_and_install(self):
|
||||||
""" Build the slackbuilds and install. """
|
""" Build the slackbuilds and install. """
|
||||||
pattern = f'*{self.sbo_repo_tag}'
|
# pattern = f'*{self.sbo_repo_tag}'
|
||||||
|
|
||||||
for sbo in self.install_order:
|
for sbo in self.install_order:
|
||||||
|
|
||||||
|
@ -169,7 +171,7 @@ class Slackbuilds(Configs):
|
||||||
if self.flag_resolve_off not in self.flags:
|
if self.flag_resolve_off not in self.flags:
|
||||||
self.logging_installed_dependencies(sbo)
|
self.logging_installed_dependencies(sbo)
|
||||||
else:
|
else:
|
||||||
package = self.utils.is_installed(sbo, pattern)
|
package = self.utils.is_installed(sbo, self.file_pattern)
|
||||||
version = self.utils.split_installed_pkg(package)[1]
|
version = self.utils.split_installed_pkg(package)[1]
|
||||||
self.view_message.view_skipping_packages(sbo, version)
|
self.view_message.view_skipping_packages(sbo, version)
|
||||||
|
|
||||||
|
@ -208,12 +210,13 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
def install_package(self, package: str):
|
def install_package(self, package: str):
|
||||||
""" Install the packages that before created in the tmp directory. """
|
""" Install the packages that before created in the tmp directory. """
|
||||||
pattern = f'*{self.sbo_repo_tag}'
|
# pattern = f'*{self.sbo_repo_tag}'
|
||||||
|
|
||||||
pkg = self.utils.split_installed_pkg(package)[0]
|
pkg = self.utils.split_installed_pkg(package)[0]
|
||||||
|
|
||||||
execute = self.installpkg
|
execute = self.installpkg
|
||||||
if (self.flag_reinstall in self.flags and
|
if (self.flag_reinstall in self.flags and
|
||||||
self.utils.is_installed(pkg, pattern)):
|
self.utils.is_installed(pkg, self.file_pattern)):
|
||||||
execute = self.reinstall
|
execute = self.reinstall
|
||||||
|
|
||||||
message = f'{self.cyan}Installing{self.endc}'
|
message = f'{self.cyan}Installing{self.endc}'
|
||||||
|
@ -334,9 +337,10 @@ class Slackbuilds(Configs):
|
||||||
|
|
||||||
for package in dependencies:
|
for package in dependencies:
|
||||||
status = True
|
status = True
|
||||||
pattern = f'*{self.sbo_repo_tag}'
|
# pattern = f'*{self.sbo_repo_tag}'
|
||||||
|
|
||||||
repo_ver = SBoQueries(package).version()
|
repo_ver = SBoQueries(package).version()
|
||||||
installed = self.utils.is_installed(package, pattern)
|
installed = self.utils.is_installed(package, self.file_pattern)
|
||||||
|
|
||||||
if installed:
|
if installed:
|
||||||
status = False
|
status = False
|
||||||
|
|
Loading…
Reference in a new issue