From 5a6c7de600172027be98c69b2fb7b3f5c9463501 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 4 Mar 2023 21:34:47 +0200 Subject: [PATCH] Updated for repo_tag --- man/slpkg-fr.1 | 2 +- man/slpkg.1 | 2 +- slpkg/configs.py | 4 ++++ slpkg/main.py | 10 ++-------- slpkg/slackbuild.py | 4 ---- slpkg/utilities.py | 2 +- slpkg/views/help_commands.py | 2 +- slpkg/views/views.py | 2 +- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/man/slpkg-fr.1 b/man/slpkg-fr.1 index b29a8c11..18bfef8d 100644 --- a/man/slpkg-fr.1 +++ b/man/slpkg-fr.1 @@ -65,7 +65,7 @@ Télécharger les scripts et les sources des SlackBuilds sans les construire ni .B -R, remove .RS 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 .P .B -f, find diff --git a/man/slpkg.1 b/man/slpkg.1 index b49633f9..858df0c1 100644 --- a/man/slpkg.1 +++ b/man/slpkg.1 @@ -68,7 +68,7 @@ Download the SlackBuilds scripts and the sources without building or installing .B -R, remove .RS 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 .P .B -f, find diff --git a/slpkg/configs.py b/slpkg/configs.py index 7c5701af..dd804b27 100644 --- a/slpkg/configs.py +++ b/slpkg/configs.py @@ -161,6 +161,10 @@ class Configs: 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") + repo_tag: str = sbo_repo_tag + if ponce_repo: + repo_tag: str = ponce_repo_tag + # Creating the paths if not exists paths = [ tmp_slpkg, diff --git a/slpkg/main.py b/slpkg/main.py index 2cd1b00d..bc17034d 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -33,7 +33,7 @@ class Argparse(Configs): self.args: list = args self.flags: list = [] 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.utils = Utilities() self.usage = Usage() @@ -304,13 +304,7 @@ class Argparse(Configs): title: str = f' Choose packages you want to {method} ' repo_packages: list = SBoQueries('').sbos() - # Grab all the installed packages - 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)) + installed: list = list(self.utils.all_installed(self.file_pattern)) if method in ['remove', 'find']: diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index f4bf34f9..581e2a4b 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -61,10 +61,6 @@ class Slackbuilds(Configs): self.flag_jobs: list = ['-j', '--jobs'] 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: """ Starting build or install the slackbuilds. """ self.creating_dictionary() diff --git a/slpkg/utilities.py b/slpkg/utilities.py index 4f9779fb..2efa2341 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -81,7 +81,7 @@ class Utilities: name: str = '-'.join(package.split('-')[:-3]) version: str = ''.join(package[len(name):].split('-')[:-2]) 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('-')) return [name, version, arch, build, tag] diff --git a/slpkg/views/help_commands.py b/slpkg/views/help_commands.py index a940d2c8..c10c0637 100644 --- a/slpkg/views/help_commands.py +++ b/slpkg/views/help_commands.py @@ -35,7 +35,7 @@ class Help(Configs): "dependencies for removal.", '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. " - "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.", 'find': "Find your installed packages on your system.", 'view': "View information packages from the repository and get everything in your terminal.", diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 388ed18e..998193ef 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -39,7 +39,7 @@ class ViewMessage(Configs): self.flag_resolve_off: list = ['-o', '--resolve-off'] self.flag_reinstall: list = ['-r', '--reinstall'] 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): """ Printing the main packages. """