From 301e5b321fbaaba43024e08b0271a74989612d19 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 1 Nov 2022 19:06:49 +0200 Subject: [PATCH 1/3] Updated manpage Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 4 ++++ man/slpkg.1 | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4f05dae0..e959eea9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +4.2.5 - 01/11/2022 +Updated: +- man page + 4.2.4 - 30/10/2022 Added: - Patching SBo TAG from the configuration file diff --git a/man/slpkg.1 b/man/slpkg.1 index 06c553dc..721b8a4a 100644 --- a/man/slpkg.1 +++ b/man/slpkg.1 @@ -1,4 +1,4 @@ -.TH slpkg 1 "Orestiada, Greece" "slpkg 4.2.0" dslackw +.TH slpkg 1 "Orestiada, Greece" "slpkg 4.2.5" dslackw .SH NAME .P slpkg - [OPTIONS] [COMMAND] @@ -19,12 +19,12 @@ Updates the package list and the database. .P upgrade .RS -Upgrade all the installed packages. +Upgrade all the installed packages if the newer version exists in the repository. .RE .P build .RS -Builds the scripts and puts them in the /tmp directory. +Builds the Slackbuilds scripts and adds them to the /tmp directory. .RE .P install @@ -34,12 +34,12 @@ Builds and installs the packages in the correct order and also logs the packages .P download .RS -Download only the packages without building or installing it. +Download the SlackBuilds scripts and the sources without building or installing it. .RE .P remove .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. .RE .P find @@ -59,12 +59,12 @@ Search and match packages from the repository. .P clean-logs .RS -Cleans dependencies log tracking. +Cleans dependencies log tracking. After that procedure you should remove dependencies by hand. .RE .P clean-tmp .RS -Deletes all the downloaded sources. +Deletes all the downloaded SlackBuilds scripts and sources. .RE .SH OPTIONS .P From aa9c58c636ec38399c0979a33660a0d32ec31742 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 3 Nov 2022 18:52:01 +0200 Subject: [PATCH 2/3] Added to check if there is news on ChangeLog.txt Signed-off-by: Dimitris Zlatanidis --- ChangeLog.txt | 2 ++ configs/slpkg.yml | 5 ++++- man/slpkg.1 | 7 ++++++- slpkg/configs.py | 2 ++ slpkg/main.py | 11 +++++++++++ slpkg/update_repository.py | 8 ++++++-- slpkg/views/cli_menu.py | 1 + 7 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e959eea9..fe685aa5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,6 @@ 4.2.5 - 01/11/2022 +Added: +- Command to check if there is news on ChangeLog.txt Updated: - man page diff --git a/configs/slpkg.yml b/configs/slpkg.yml index c2fb245f..20bd4201 100644 --- a/configs/slpkg.yml +++ b/configs/slpkg.yml @@ -20,9 +20,12 @@ configs: # Slackbuilds.org repository url. sbo_repo_url: http://slackbuilds.org/slackbuilds/15.0 - # The sbo repository main file. + # The SLACKBUILDS.TXT repository file. sbo_txt: SLACKBUILDS.TXT + # The ChangeLog.txt file. + chglog_txt: ChangeLog.txt + # The sbo tar suffix. sbo_tar_suffix: .tar.gz diff --git a/man/slpkg.1 b/man/slpkg.1 index 721b8a4a..7df956c0 100644 --- a/man/slpkg.1 +++ b/man/slpkg.1 @@ -4,7 +4,7 @@ slpkg - [OPTIONS] [COMMAND] .SH SYNAPSES .P -slpkg [-h|-v] [update] [upgrade] [build] [install] [download] [remove] [find] [view] [search] [clean-logs] [clean-tmp] --yes --jobs --resolve-off --reinstall --skip-installed +slpkg [-h|-v] [update] [upgrade] [check-updates] [build] [install] [download] [remove] [find] [view] [search] [clean-logs] [clean-tmp] --yes --jobs --resolve-off --reinstall --skip-installed .SH DESCRIPTION .P Slpkg is a software package manager that installs, updates, and removes packages on Slackware based systems. It automatically computes dependencies and figures out what things should occur to install packages. Slpkg makes it easier to maintain groups of machines without having to manually update. @@ -22,6 +22,11 @@ upgrade Upgrade all the installed packages if the newer version exists in the repository. .RE .P +check-updates +.RS +Check if there is any news on the SlackBuild's ChangeLog.txt file. +.RE +.P build .RS Builds the Slackbuilds scripts and adds them to the /tmp directory. diff --git a/slpkg/configs.py b/slpkg/configs.py index 170bfc22..d3905606 100644 --- a/slpkg/configs.py +++ b/slpkg/configs.py @@ -35,6 +35,7 @@ class Configs: # SBo repository configs sbo_repo_url: str = 'http://slackbuilds.org/slackbuilds/15.0' sbo_txt: str = 'SLACKBUILDS.TXT' + chglog_txt: str = 'ChangeLog.txt' sbo_tar_suffix: str = '.tar.gz' sbo_repo_tag: str = '_SBo' @@ -74,6 +75,7 @@ class Configs: # SBo repository details sbo_repo_url: str = config['sbo_repo_url'] sbo_txt: str = config['sbo_txt'] + chglog_txt: str = config['chglog_txt'] sbo_tar_suffix: str = config['sbo_tar_suffix'] sbo_repo_tag: str = config['sbo_repo_tag'] diff --git a/slpkg/main.py b/slpkg/main.py index 4ca2d99f..1dd98823 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -19,6 +19,7 @@ from slpkg.find_installed import FindInstalled from slpkg.remove_packages import RemovePackages from slpkg.clean_logs import CleanLogsDependencies from slpkg.update_repository import UpdateRepository +from slpkg.check_updates import CheckUpdates @dataclass @@ -81,6 +82,15 @@ class Argparse: raise SystemExit() usage(1) + def check_updates(self): + if len(self.args) == 1 and not self.flags: + self.check.database() + + check = CheckUpdates() + check.updates() + raise SystemExit() + usage(1) + def build(self): if len(self.args) >= 2 and '--reinstall' not in self.flags: packages = list(set(self.args[1:])) @@ -219,6 +229,7 @@ def main(): '--version': argparse.version, 'update': argparse.update, 'upgrade': argparse.upgrade, + 'check-updates': argparse.check_updates, 'build': argparse.build, 'install': argparse.install, 'download': argparse.download, diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 4ba0cad1..01735c32 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -20,6 +20,7 @@ class UpdateRepository: sbo_repo_path: str = Configs.sbo_repo_path url: str = Configs.sbo_repo_url sbo_txt: str = Configs.sbo_txt + chglog_txt: str = Configs.chglog_txt db_path: str = Configs.db_path database: str = Configs.database session: str = Session @@ -27,12 +28,15 @@ class UpdateRepository: def sbo(self): print('Updating the package list...\n') self.delete_file(self.sbo_repo_path, self.sbo_txt) + self.delete_file(self.sbo_repo_path, self.chglog_txt) self.delete_sbo_data() - sbo_repo_url = f'{self.url}/{self.sbo_txt}' + slackbuilds_txt = f'{self.url}/{self.sbo_txt}' + changelog_txt = f'{self.url}/{self.chglog_txt}' wget = Wget() - wget.download(self.sbo_repo_path, sbo_repo_url) + wget.download(self.sbo_repo_path, slackbuilds_txt) + wget.download(self.sbo_repo_path, changelog_txt) data = CreateData() data.insert_sbo_table() diff --git a/slpkg/views/cli_menu.py b/slpkg/views/cli_menu.py index 0c6091c6..80417829 100644 --- a/slpkg/views/cli_menu.py +++ b/slpkg/views/cli_menu.py @@ -21,6 +21,7 @@ def usage(status: int): f'{BOLD}COMMANDS:{ENDC}', f' {RED}update{ENDC} Update the package lists.', f' {CYAN}upgrade{ENDC} Upgrade all the packages.', + f' {CYAN}check-updates{ENDC} Check for news on ChangeLog.txt.', f' {CYAN}build{ENDC} Build only the packages.', f' {CYAN}install{ENDC} Build and install the packages.', f' {CYAN}download{ENDC} Download only the scripts and sources.', From b69ae8c8a8d70854bcdd61f594318e3a45355ecb Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 3 Nov 2022 19:13:46 +0200 Subject: [PATCH 3/3] Updated for version 4.2.5 Signed-off-by: Dimitris Zlatanidis --- README.rst | 4 ++-- setup.cfg | 2 +- slpkg/main.py | 2 +- slpkg/version.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 1b64176f..508a518c 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Install from the official third-party `SBo repository