Updated for repo_tag

This commit is contained in:
Dimitris Zlatanidis 2023-03-04 21:34:47 +02:00
parent f30199c5ee
commit 5a6c7de600
8 changed files with 11 additions and 17 deletions

View file

@ -65,7 +65,7 @@ Télécharger les scripts et les sources des SlackBuilds sans les construire ni
.B -R, remove .B -R, remove
.RS .RS
Supprimer les paquets avec leurs dépendances s'ils ont été installés avec la méthode \fB'slpkg install'\fP. Supprimer les paquets avec leurs dépendances s'ils ont été installés avec la méthode \fB'slpkg install'\fP.
Slpkg examine la configuration \fB'sbo_repo_tag'\fP pour trouver les paquets à supprimer. Slpkg examine la configuration \fB'REPO_TAG'\fP pour trouver les paquets à supprimer.
.RE .RE
.P .P
.B -f, find .B -f, find

View file

@ -68,7 +68,7 @@ Download the SlackBuilds scripts and the sources without building or installing
.B -R, remove .B -R, remove
.RS .RS
Removes packages with dependencies if the packages was installed with 'slpkg install' method. Removes packages with dependencies if the packages was installed with 'slpkg install' method.
Slpkg looks at the 'sbo_repo_tag' configuration to find packages for removal by default, except if you are using --file-pattern option. Slpkg looks at the 'REPO_TAG' configuration to find packages for removal by default, except if you are using --file-pattern option.
.RE .RE
.P .P
.B -f, find .B -f, find

View file

@ -161,6 +161,10 @@ class Configs:
f"\nIf you have upgraded the '{prog_name}' probably you need to run:\n" f"\nIf you have upgraded the '{prog_name}' probably you need to run:\n"
f"mv {etc_path}/{prog_name}.toml.new {etc_path}/{prog_name}.toml\n") f"mv {etc_path}/{prog_name}.toml.new {etc_path}/{prog_name}.toml\n")
repo_tag: str = sbo_repo_tag
if ponce_repo:
repo_tag: str = ponce_repo_tag
# Creating the paths if not exists # Creating the paths if not exists
paths = [ paths = [
tmp_slpkg, tmp_slpkg,

View file

@ -33,7 +33,7 @@ class Argparse(Configs):
self.args: list = args self.args: list = args
self.flags: list = [] self.flags: list = []
self.directory = self.tmp_slpkg self.directory = self.tmp_slpkg
self.file_pattern: str = f'*{self.sbo_repo_tag}' self.file_pattern: str = f'*{self.repo_tag}'
self.dialogbox = DialogBox() self.dialogbox = DialogBox()
self.utils = Utilities() self.utils = Utilities()
self.usage = Usage() self.usage = Usage()
@ -304,13 +304,7 @@ class Argparse(Configs):
title: str = f' Choose packages you want to {method} ' title: str = f' Choose packages you want to {method} '
repo_packages: list = SBoQueries('').sbos() repo_packages: list = SBoQueries('').sbos()
# Grab all the installed packages installed: list = list(self.utils.all_installed(self.file_pattern))
pattern: str = f'*{self.sbo_repo_tag}'
if method == 'find' and self.file_pattern:
pattern: str = self.file_pattern
installed: list = list(self.utils.all_installed(pattern))
if method in ['remove', 'find']: if method in ['remove', 'find']:

View file

@ -61,10 +61,6 @@ class Slackbuilds(Configs):
self.flag_jobs: list = ['-j', '--jobs'] self.flag_jobs: list = ['-j', '--jobs']
self.flag_no_silent: list = ['-n', '--no-silent'] self.flag_no_silent: list = ['-n', '--no-silent']
self.repo_tag: str = self.sbo_repo_tag
if self.ponce_repo:
self.repo_tag: str = self.ponce_repo_tag
def execute(self) -> None: def execute(self) -> None:
""" Starting build or install the slackbuilds. """ """ Starting build or install the slackbuilds. """
self.creating_dictionary() self.creating_dictionary()

View file

@ -81,7 +81,7 @@ class Utilities:
name: str = '-'.join(package.split('-')[:-3]) name: str = '-'.join(package.split('-')[:-3])
version: str = ''.join(package[len(name):].split('-')[:-2]) version: str = ''.join(package[len(name):].split('-')[:-2])
arch: str = ''.join(package[len(name + version) + 2:].split('-')[:-1]) arch: str = ''.join(package[len(name + version) + 2:].split('-')[:-1])
build: str = ''.join(package[len(name + version + arch) + 3:].split('-')).replace(self.configs.sbo_repo_tag, '') build: str = ''.join(package[len(name + version + arch) + 3:].split('-')).replace(self.configs.repo_tag, '')
tag: str = ''.join(package[len(name + version + arch + build) + 4:].split('-')) tag: str = ''.join(package[len(name + version + arch + build) + 4:].split('-'))
return [name, version, arch, build, tag] return [name, version, arch, build, tag]

View file

@ -35,7 +35,7 @@ class Help(Configs):
"dependencies for removal.", "dependencies for removal.",
'download': "Download the SlackBuilds scripts and the sources without building or installing it.", 'download': "Download the SlackBuilds scripts and the sources without building or installing it.",
'remove': "Removes packages with dependencies if the packages was installed with 'slpkg install' method. " 'remove': "Removes packages with dependencies if the packages was installed with 'slpkg install' method. "
"Slpkg looks at the 'sbo_repo_tag' configuration to find packages for removal by default, except " "Slpkg looks at the 'REPO_TAG' configuration to find packages for removal by default, except "
"if you are using '--file-pattern=' option.", "if you are using '--file-pattern=' option.",
'find': "Find your installed packages on your system.", 'find': "Find your installed packages on your system.",
'view': "View information packages from the repository and get everything in your terminal.", 'view': "View information packages from the repository and get everything in your terminal.",

View file

@ -39,7 +39,7 @@ class ViewMessage(Configs):
self.flag_resolve_off: list = ['-o', '--resolve-off'] self.flag_resolve_off: list = ['-o', '--resolve-off']
self.flag_reinstall: list = ['-r', '--reinstall'] self.flag_reinstall: list = ['-r', '--reinstall']
self.flag_yes: list = ['-y', '--yes'] self.flag_yes: list = ['-y', '--yes']
self.file_pattern: str = f'*{self.sbo_repo_tag}' self.file_pattern: str = f'*{self.repo_tag}'
def view_packages(self, package, version, mode): def view_packages(self, package, version, mode):
""" Printing the main packages. """ """ Printing the main packages. """