From 6a0af520d6a8540cf59f946753829ea079696331 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 14:27:52 +0300 Subject: [PATCH 01/25] Created list --- README.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index d7ab5e55..c0a3f2cc 100644 --- a/README.rst +++ b/README.rst @@ -54,8 +54,6 @@ Usage Copyright --------- -Copyright 2014-2022 © Dimitris Zlatanidis. - -Slackware® is a Registered Trademark of Patrick Volkerding. - -Linux is a Registered Trademark of Linus Torvalds. +- Copyright 2014-2022 © Dimitris Zlatanidis. +- Slackware® is a Registered Trademark of Patrick Volkerding. +- Linux is a Registered Trademark of Linus Torvalds. From dbd14aa08f6eeffbb11425ce249c72b72c80e33b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 22:26:55 +0300 Subject: [PATCH 02/25] Updated location --- slpkg/models/data.py | 3 ++- slpkg/sbo/search.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/slpkg/models/data.py b/slpkg/models/data.py index b406012b..53fcf214 100644 --- a/slpkg/models/data.py +++ b/slpkg/models/data.py @@ -65,7 +65,8 @@ class Database: cache.append(line) if (i % 11) == 0: - data = SBoTable(name=cache[0], location=cache[1], + data = SBoTable(name=cache[0], + location=cache[1].split('/')[1:-1][0], files=cache[2], version=cache[3], download=cache[4], download64=cache[5], md5sum=cache[6], md5sum64=cache[7], diff --git a/slpkg/sbo/search.py b/slpkg/sbo/search.py index 443cb3a5..b0add827 100644 --- a/slpkg/sbo/search.py +++ b/slpkg/sbo/search.py @@ -38,4 +38,4 @@ def sbo_search_pkg(name): sbo = repo.default_repository()["sbo"] sbo_url = f"{sbo}{slack_ver()}/" - return f"{sbo_url}{location[0][2:]}/" + return f"{sbo_url}{location[0]}/{name}/" From cbca9570f0e4d6ccd195129866df1a477540de35 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 22:45:49 +0300 Subject: [PATCH 03/25] Removed slacky repository --- EXAMPLES.md | 9 +++------ conf/default-repositories | 3 +-- conf/repositories.conf | 1 - man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 10 +++++----- slpkg/binary/greps.py | 26 ++++++-------------------- slpkg/binary/repo_init.py | 7 ------- slpkg/checks.py | 1 - slpkg/init.py | 35 ----------------------------------- 10 files changed, 15 insertions(+), 79 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 2c2858f2..b7c83db1 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -21,7 +21,6 @@ $ slpkg update Update repository [slack] ... Done Update repository [sbo] ... Done Update repository [alien] ... Done -Update repository [slacky] ... Done Update repository [conrad] ... Done Update repository [slonly] ... Done Update repository [ktown] ... Done @@ -35,7 +34,7 @@ Update repository [msb] ... Done Update specifically repositories: ``` -$ slpkg update --repositories=sbo,msb,slacky +$ slpkg update --repositories=sbo,msb ``` Also you can check ChangeLog.txt for changes, like: @@ -60,7 +59,6 @@ $ slpkg --check +============================================================================== slack No changes in ChangeLog.txt sbo News in ChangeLog.txt - slacky News in ChangeLog.txt alien No changes in ChangeLog.txt rlw No changes in ChangeLog.txt @@ -107,7 +105,6 @@ $ slpkg repo-list slacke http://ngc891.blogdns.net/pub/ yes disabled slackl http://www.slackel.gr/repo/ yes disabled conrad http://slack.conraid.net/repository/slackware64-~ yes disabled - slacky http://repository.slacky.eu/ yes disabled slonly https://slackonly.com/pub/packages/ yes disabled Repositories summary @@ -477,7 +474,7 @@ will be upgraded. Would you like to continue [y/N]? -$ slpkg -c slacky --upgrade +$ slpkg -c alien --upgrade Checking... Done Reading package lists... Done Resolving dependencies... Done @@ -486,7 +483,7 @@ Resolving dependencies... Done | Package New version Arch Build Repos Size +============================================================================== Upgrading: - gstreamer1-1.4.1 1.4.4 x86_64 1 slacky 1563 K + gstreamer1-1.4.1 1.4.4 x86_64 1 alien 1563 K Installing summary =============================================================================== diff --git a/conf/default-repositories b/conf/default-repositories index 5457fb22..dc70ea3e 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -29,7 +29,7 @@ # repository. # # Default repositories names: -# sbo, slack, rlw, alien, slacky, conrad, slonly, ktown, multi, slacke, salix, +# sbo, slack, rlw, alien, conrad, slonly, ktown, multi, slacke, salix, # slackl, rested, msb, csb, connos, mles # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- @@ -38,7 +38,6 @@ sbo http://slackbuilds.org/slackbuilds/ rlw http://slackware.uk/people/rlworkman/ alien http://bear.alienbase.nl/mirrors/people/alien/sbrepos/ - slacky http://repository.slacky.eu/ conrad http://slack.conraid.net/repository/slackware64-current/ slonly https://slackonly.com/pub/packages/ ktown http://alien.slackbook.org/ktown/ diff --git a/conf/repositories.conf b/conf/repositories.conf index 81c47fc0..06eefa43 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -44,7 +44,6 @@ slack sbo # alien # rlw -# slacky # conrad # slonly # ktown{latest} diff --git a/man/slpkg.8 b/man/slpkg.8 index be37a854..a9b9ceac 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -324,7 +324,6 @@ For example: slackware.com = "slack" SlackBuilds.org = "sbo" Alien's = "alien" - slacky.eu = "slacky" rworkman's = "rlw" Conraid's = "conrad" slackonly.com = "slonly" diff --git a/man/slpkg.html b/man/slpkg.html index 57d26c63..dafe9705 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -592,7 +592,6 @@ slpkg −−help - display help for slpkg

"slack"
SlackBuilds.org = "sbo"
Alien’s = "alien"
-slacky.eu = "slacky"
rworkman’s = "rlw"
Conraid’s = "conrad"
slackonly.com = "slonly"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index bf04d38c..8efe660b 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -100,10 +100,10 @@ class MetaData: "SLACKWARE_VERSION": "off", "COMP_ARCH": "off", "REPOSITORIES": ["slack", "sbo", "rlw", "alien", - "slacky", "conrad", "slonly", - "ktown{latest}", "multi", "slacke{18}", - "salix", "slackl", "rested", "msb{1.18}", - "csb", "connos", "mles{desktop}"], + "conrad", "slonly", "ktown{latest}", + "multi", "slacke{18}", "salix", "slackl", + "rested", "msb{1.18}", "csb", "connos", + "mles{desktop}"], "BUILD_PATH": "/tmp/slpkg/build/", "SBOSRCARCH": "off", "SBOSRCARCH_LINK": "http://slackware.uk/sbosrcarch/by-name/", @@ -129,7 +129,7 @@ class MetaData: "HTTP_PROXY": "", } - default_repositories = ["slack", "sbo", "rlw", "alien", "slacky", "conrad", + default_repositories = ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown", "multi", "slacke", "salix", "slackl", "rested", "msb", "csb", "connos", "mles"] diff --git a/slpkg/binary/greps.py b/slpkg/binary/greps.py index 125560a5..928da1df 100644 --- a/slpkg/binary/greps.py +++ b/slpkg/binary/greps.py @@ -254,31 +254,17 @@ class Requires: @lru_cache def _req_fix(self, line): - """Fix slacky and salix requirements because many dependencies - splitting with "," and others with "|" + """Fix salix requirements because many dependencies + splitting with "," """ deps = [] for dep in line[18:].strip().split(","): - dep = dep.split("|") + if len(dep) > 1: - if self.repo == "slacky": + for d in dep: + deps.append(d) - if len(dep) > 1: - - for d in dep: - deps.append(d.split()[0]) - - dep = "".join(dep) - deps.append(dep.split()[0]) - - else: - - if len(dep) > 1: - - for d in dep: - deps.append(d) - - deps.append(dep[0]) + deps.append(dep[0]) return deps diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index 56a1d9cf..775e0264 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -71,13 +71,6 @@ class RepoInit(Utils): self.mirror = f"{self.def_repo_dict['alien']}{ver}/{arch}/" - def _init_slacky(self): - arch = "" - if self.meta.arch == "x86_64": - arch = "64" - - self.mirror = f"{self.def_repo_dict}slackware{arch}-{slack_ver()}/" - def _init_conrad(self): self.mirror = self.def_repo_dict["conrad"] diff --git a/slpkg/checks.py b/slpkg/checks.py index aaa10025..65f5c944 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -48,7 +48,6 @@ class Updates: "sbo": self._init.sbo, "rlw": self._init.rlw, "alien": self._init.alien, - "slacky": self._init.slacky, "conrad": self._init.conrad, "slonly": self._init.slonly, "ktown": self._init.ktown, diff --git a/slpkg/init.py b/slpkg/init.py index 406913b3..96f51ad7 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -263,41 +263,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def slacky(self): - """Creating slacky.eu local library - """ - ar = "" - repo = self.def_repos_dict["slacky"] - log = self.log_path + "slacky/" - lib = self.lib_path + "slacky_repo/" - repo_name = Init.slacky.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - if self.arch == "x86_64": - ar = "64" - - PACKAGES_TXT = f"{repo}slackware{ar}-{self.slack_ver}/{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}slackware{ar}-{self.slack_ver}/{md5_file}" - - ChangeLog_txt = f"{repo}slackware{ar}-{self.slack_ver}/{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def conrad(self): """Creating slackers local library """ From 3a82750cc4594c6c6795bb5b2cac375e7e356a5a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 23:13:20 +0300 Subject: [PATCH 04/25] Removed slacke repository --- EXAMPLES.md | 4 +--- conf/default-repositories | 3 +-- conf/repositories.conf | 2 -- man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 5 ++--- slpkg/binary/repo_init.py | 9 --------- slpkg/checks.py | 1 - slpkg/init.py | 38 -------------------------------------- 9 files changed, 4 insertions(+), 60 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index b7c83db1..99c0ff98 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -25,7 +25,6 @@ Update repository [conrad] ... Done Update repository [slonly] ... Done Update repository [ktown] ... Done Update repository [salix] ... Done -Update repository [slacke] ... Done Update repository [slackl] ... Done Update repository [multi] ... Done Update repository [msb] ... Done @@ -102,14 +101,13 @@ $ slpkg repo-list salix http://download.salixos.org/ yes disabled sbo http://slackbuilds.org/slackbuilds/ yes enabled slack http://ftp.cc.uoc.gr/mirrors/linux/slackware/ yes enabled - slacke http://ngc891.blogdns.net/pub/ yes disabled slackl http://www.slackel.gr/repo/ yes disabled conrad http://slack.conraid.net/repository/slackware64-~ yes disabled slonly https://slackonly.com/pub/packages/ yes disabled Repositories summary =============================================================================== -3/14 enabled default repositories and 1 custom. +3/13 enabled default repositories and 1 custom. For enable or disable default repositories edit '/etc/slpkg/repositories.conf' file. diff --git a/conf/default-repositories b/conf/default-repositories index dc70ea3e..8f2c0344 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -29,7 +29,7 @@ # repository. # # Default repositories names: -# sbo, slack, rlw, alien, conrad, slonly, ktown, multi, slacke, salix, +# sbo, slack, rlw, alien, conrad, slonly, ktown, multi, salix, # slackl, rested, msb, csb, connos, mles # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- @@ -42,7 +42,6 @@ slonly https://slackonly.com/pub/packages/ ktown http://alien.slackbook.org/ktown/ multi http://bear.alienbase.nl/mirrors/people/alien/multilib/ - slacke http://ngc891.blogdns.net/pub/ salix http://download.salixos.org/ slackl http://www.slackel.gr/repo/ rested http://bear.alienbase.nl/mirrors/people/alien/restricted_slackbuilds/ diff --git a/conf/repositories.conf b/conf/repositories.conf index 06eefa43..b9b509cb 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -25,7 +25,6 @@ # ---------------------------------------------------------------------------- # conrad (Conraid's) repository must used from Slackware64 current. # ktown (Alien"s ktown: 4.14.3 and latest) repository. Default ktown{latest}. -# slacke (Enlightenment: E17 and E18) repository. Default slacke{18}. # msb (Mate: 1.14, 1.16, 1,18, latest) repository. Default msb{1.18} # mles (Microlinux: desktop, extras, server) repository. Default mles{desktop} # @@ -48,7 +47,6 @@ sbo # slonly # ktown{latest} # multi -# slacke{18} # salix # slackl # rested diff --git a/man/slpkg.8 b/man/slpkg.8 index a9b9ceac..be32b70f 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -329,7 +329,6 @@ For example: slackonly.com = "slonly" Alien's ktown = "ktown{latest}" Alien's multilib = "multi" - Slacke E17 and E18 = "slacke{18}" SalixOS = "salix" Slackel.gr = "slackel" Alien's restricted = "rested" diff --git a/man/slpkg.html b/man/slpkg.html index dafe9705..b2746bfd 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -597,7 +597,6 @@ Conraid’s = "conrad"
slackonly.com = "slonly"
Alien’s ktown = "ktown{latest}"
Alien’s multilib = "multi"
-Slacke E17 and E18 = "slacke{18}"
SalixOS = "salix"
Slackel.gr = "slackel"
Alien’s restricted = "rested"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 8efe660b..8dbf3401 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -101,7 +101,7 @@ class MetaData: "COMP_ARCH": "off", "REPOSITORIES": ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown{latest}", - "multi", "slacke{18}", "salix", "slackl", + "multi", "salix", "slackl", "rested", "msb{1.18}", "csb", "connos", "mles{desktop}"], "BUILD_PATH": "/tmp/slpkg/build/", @@ -130,7 +130,7 @@ class MetaData: } default_repositories = ["slack", "sbo", "rlw", "alien", "conrad", - "slonly", "ktown", "multi", "slacke", "salix", + "slonly", "ktown", "multi", "salix", "slackl", "rested", "msb", "csb", "connos", "mles"] # reads values from the configuration file @@ -187,7 +187,6 @@ class MetaData: # Grabs sub repositories ktown_kde_repo = grab_sub_repo(repositories, "ktown") - slacke_sub_repo = grab_sub_repo(repositories, "slacke") msb_sub_repo = grab_sub_repo(repositories, "msb") mles_sub_repo = grab_sub_repo(repositories, "mles") diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index 775e0264..7bc273b6 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -100,15 +100,6 @@ class RepoInit(Utils): self.mirror = self.def_repo_dict["multi"] + ver + "/" - def _init_slacke(self): - arch = "" - if self.meta.arch == "x86_64": - arch = "64" - - self.mirror = (f"{self.def_repo_dict['slacke']}" - f"slacke{self.meta.slacke_sub_repo[1:-1]}/slackware" - f"{arch}-{slack_ver()}/") - def _init_salix(self): arch = "i486" if self.meta.arch == "x86_64": diff --git a/slpkg/checks.py b/slpkg/checks.py index 65f5c944..ac040e8c 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -52,7 +52,6 @@ class Updates: "slonly": self._init.slonly, "ktown": self._init.ktown, "multi": self._init.multi, - "slacke": self._init.slacke, "salix": self._init.salix, "slackl": self._init.slackl, "rested": self._init.rested, diff --git a/slpkg/init.py b/slpkg/init.py index 96f51ad7..9638797c 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -396,44 +396,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def slacke(self): - """Creating Slacke local library - """ - ar = "" - repo = self.def_repos_dict["slacke"] - log = self.log_path + "slacke/" - lib = self.lib_path + "slacke_repo/" - repo_name = Init.slacke.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - if self.arch == "x86_64": - ar = "64" - - version = self.meta.slacke_sub_repo[1:-1] - PACKAGES_TXT = (f"{repo}slacke{version}/slackware{ar}-" - f"{self.slack_ver}/{lib_file}") - FILELIST_TXT = "" - CHECKSUMS_MD5 = (f"{repo}slacke{version}/slackware{ar}-" - f"{self.slack_ver}/{md5_file}") - ChangeLog_txt = (f"{repo}slacke{version}/slackware{ar}-" - f"{self.slack_ver}/{log_file}") - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def salix(self): """Creating SalixOS local library """ From 7275d74bf5d9af432438073ce6673ef4e9b11639 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 23:22:06 +0300 Subject: [PATCH 05/25] Removed rested repository --- EXAMPLES.md | 5 ++--- conf/default-repositories | 3 +-- conf/repositories.conf | 1 - man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 7 +++---- slpkg/binary/greps.py | 32 -------------------------------- slpkg/binary/repo_init.py | 3 --- slpkg/checks.py | 1 - slpkg/init.py | 30 ------------------------------ 10 files changed, 6 insertions(+), 78 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 99c0ff98..9c119bf5 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -96,18 +96,17 @@ $ slpkg repo-list msb http://slackware.org.uk/msb/ yes enabled multi http://www.slackware.com/~alien/multilib/ yes disabled ponce http://ponce.cc/slackware/slackware64-14.2/packa~ no enabled - rested http://taper.alienbase.nl/mirrors/people/alien/r~ yes disabled rlw http://rlworkman.net/pkgs/ yes disabled salix http://download.salixos.org/ yes disabled sbo http://slackbuilds.org/slackbuilds/ yes enabled slack http://ftp.cc.uoc.gr/mirrors/linux/slackware/ yes enabled slackl http://www.slackel.gr/repo/ yes disabled - conrad http://slack.conraid.net/repository/slackware64-~ yes disabled + conrad http://slack.conraid.net/repository/slackware64-~ yes disabled slonly https://slackonly.com/pub/packages/ yes disabled Repositories summary =============================================================================== -3/13 enabled default repositories and 1 custom. +3/12 enabled default repositories and 1 custom. For enable or disable default repositories edit '/etc/slpkg/repositories.conf' file. diff --git a/conf/default-repositories b/conf/default-repositories index 8f2c0344..cf5457cf 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -30,7 +30,7 @@ # # Default repositories names: # sbo, slack, rlw, alien, conrad, slonly, ktown, multi, salix, -# slackl, rested, msb, csb, connos, mles +# slackl, msb, csb, connos, mles # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- # @@ -44,7 +44,6 @@ multi http://bear.alienbase.nl/mirrors/people/alien/multilib/ salix http://download.salixos.org/ slackl http://www.slackel.gr/repo/ - rested http://bear.alienbase.nl/mirrors/people/alien/restricted_slackbuilds/ msb http://slackware.org.uk/msb/ csb http://slackware.uk/csb/ connos https://connochaetos.org/slack-n-free/ diff --git a/conf/repositories.conf b/conf/repositories.conf index b9b509cb..71f3a65c 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -49,7 +49,6 @@ sbo # multi # salix # slackl -# rested # msb{1.18} # csb # connos diff --git a/man/slpkg.8 b/man/slpkg.8 index be32b70f..44e3b483 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -331,7 +331,6 @@ For example: Alien's multilib = "multi" SalixOS = "salix" Slackel.gr = "slackel" - Alien's restricted = "rested" MATE Desktop Environment = "msb{1.18}" Cinnamon Desktop Environment = "csb" Connochaetos slack-n-free = "connos" diff --git a/man/slpkg.html b/man/slpkg.html index b2746bfd..9ae27c02 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -599,7 +599,6 @@ Alien’s ktown = "ktown{latest}"
Alien’s multilib = "multi"
SalixOS = "salix"
Slackel.gr = "slackel"
-Alien’s restricted = "rested"
MATE Desktop Environment = "msb{1.18}"
Cinnamon Desktop Environment = "csb"
Connochaetos slack-n-free = "connos"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 8dbf3401..08e61e92 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -101,9 +101,8 @@ class MetaData: "COMP_ARCH": "off", "REPOSITORIES": ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown{latest}", - "multi", "salix", "slackl", - "rested", "msb{1.18}", "csb", "connos", - "mles{desktop}"], + "multi", "salix", "slackl", "msb{1.18}", + "csb", "connos", "mles{desktop}"], "BUILD_PATH": "/tmp/slpkg/build/", "SBOSRCARCH": "off", "SBOSRCARCH_LINK": "http://slackware.uk/sbosrcarch/by-name/", @@ -131,7 +130,7 @@ class MetaData: default_repositories = ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown", "multi", "salix", - "slackl", "rested", "msb", "csb", "connos", "mles"] + "slackl", "msb", "csb", "connos", "mles"] # reads values from the configuration file repositories = [] diff --git a/slpkg/binary/greps.py b/slpkg/binary/greps.py index 928da1df..7e1c9c88 100644 --- a/slpkg/binary/greps.py +++ b/slpkg/binary/greps.py @@ -71,13 +71,6 @@ def repo_data(PACKAGES_TXT, repo, flag): runsize ) = alien_filter(name, location, size, unsize) - elif repo == "rested": - (rname, - rlocation, - rsize, - runsize - ) = rested_filter(name, location, size, unsize) - elif repo == "ktown": (rname, rlocation, @@ -158,31 +151,6 @@ def alien_filter(name, location, size, unsize): return [fname, flocation, fsize, funsize] -def rested_filter(name, location, size, unsize): - """Filter Alien"s repository data - """ - ver = slack_ver() - if _meta_.slack_rel == "current": - ver = "current" - - path_pkg = "pkg" - - if _meta_.arch == "x86_64": - path_pkg = "pkg64" - - (fname, flocation, fsize, funsize) = ([] for i in range(4)) - - for n, l, s, u in zip(name, location, size, unsize): - - if path_pkg == l.split("/")[-2] and ver == l.split("/")[-1]: - fname.append(n) - flocation.append(l) - fsize.append(s) - funsize.append(u) - - return [fname, flocation, fsize, funsize] - - def ktown_filter(name, location, size, unsize): """Filter Alien"s ktown repository data """ diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index 7bc273b6..ce4dae80 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -114,9 +114,6 @@ class RepoInit(Utils): self.mirror = f"{self.def_repo_dict['slackl']}{arch}/current/" - def _init_rested(self): - self.mirror = self.def_repo_dict["rested"] - def _init_msb(self): arch = "x86" if self.meta.arch == "x86_64": diff --git a/slpkg/checks.py b/slpkg/checks.py index ac040e8c..730f14f2 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -54,7 +54,6 @@ class Updates: "multi": self._init.multi, "salix": self._init.salix, "slackl": self._init.slackl, - "rested": self._init.rested, "msb": self._init.msb, "csb": self._init.csb, "connos": self._init.msb, diff --git a/slpkg/init.py b/slpkg/init.py index 9638797c..e4e6438d 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -464,36 +464,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def rested(self): - """Creating alien restricted local library - """ - repo = self.def_repos_dict["rested"] - log = self.log_path + "rested/" - lib = self.lib_path + "rested_repo/" - repo_name = Init.rested.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - PACKAGES_TXT = f"{repo}{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{md5_file}" - ChangeLog_txt = f"{repo}{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def msb(self): """Creating MATE local library """ From 54abe8099b2182ca95c474828207503a88c6b33c Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 23:29:49 +0300 Subject: [PATCH 06/25] Removed mles repository --- REPOSITORIES.md | 4 ++-- conf/default-repositories | 3 +-- conf/repositories.conf | 2 -- man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 5 ++--- slpkg/binary/repo_init.py | 8 -------- slpkg/checks.py | 1 - slpkg/init.py | 39 ++------------------------------------- 9 files changed, 7 insertions(+), 57 deletions(-) diff --git a/REPOSITORIES.md b/REPOSITORIES.md index f174c58e..7e6dcb4f 100644 --- a/REPOSITORIES.md +++ b/REPOSITORIES.md @@ -30,8 +30,8 @@ MSB (msb) repository has one ChangeLog.txt file for three sub-repositories {1.14 Slonly repository don't support -current for x86 arch. -Alien's ktown (ktown), Alien's multilib (multi), Slacke E17 and E18, slack-n-free, csb, - mles and Alien's restricted repository has no reference dependencies. +Alien's ktown (ktown), Alien's multilib (multi), csb and Alien's restricted repository +has no reference dependencies. IMPORTANT: For Alien's (Eric Hameleers) repositories (alien, multi and ktown) should run '`slpkg upgrade`' instant '`slpkg update`', if you want to spend from -stable in -current or diff --git a/conf/default-repositories b/conf/default-repositories index cf5457cf..155c28c8 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -30,7 +30,7 @@ # # Default repositories names: # sbo, slack, rlw, alien, conrad, slonly, ktown, multi, salix, -# slackl, msb, csb, connos, mles +# slackl, msb, csb, connos # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- # @@ -47,4 +47,3 @@ msb http://slackware.org.uk/msb/ csb http://slackware.uk/csb/ connos https://connochaetos.org/slack-n-free/ - mles http://slackware.uk/microlinux/ diff --git a/conf/repositories.conf b/conf/repositories.conf index 71f3a65c..03f89de1 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -26,7 +26,6 @@ # conrad (Conraid's) repository must used from Slackware64 current. # ktown (Alien"s ktown: 4.14.3 and latest) repository. Default ktown{latest}. # msb (Mate: 1.14, 1.16, 1,18, latest) repository. Default msb{1.18} -# mles (Microlinux: desktop, extras, server) repository. Default mles{desktop} # # Slackware ARM users will must use only two repositories at the moment slack and sbo. # @@ -52,4 +51,3 @@ sbo # msb{1.18} # csb # connos -# mles{desktop} diff --git a/man/slpkg.8 b/man/slpkg.8 index 44e3b483..f19e45a3 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -334,7 +334,6 @@ For example: MATE Desktop Environment = "msb{1.18}" Cinnamon Desktop Environment = "csb" Connochaetos slack-n-free = "connos" - Microlinux mles = "mles" Default enable repository is "slack" and "sbo". Add or remove default repository in configuration file "/etc/slpkg/repositories.conf". diff --git a/man/slpkg.html b/man/slpkg.html index 9ae27c02..c8319107 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -602,7 +602,6 @@ Slackel.gr = "slackel"
MATE Desktop Environment = "msb{1.18}"
Cinnamon Desktop Environment = "csb"
Connochaetos slack-n-free = "connos"
-Microlinux mles = "mles"

Default enable repository is "slack" and "sbo".
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 08e61e92..0430c5bf 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -102,7 +102,7 @@ class MetaData: "REPOSITORIES": ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown{latest}", "multi", "salix", "slackl", "msb{1.18}", - "csb", "connos", "mles{desktop}"], + "csb", "connos"], "BUILD_PATH": "/tmp/slpkg/build/", "SBOSRCARCH": "off", "SBOSRCARCH_LINK": "http://slackware.uk/sbosrcarch/by-name/", @@ -130,7 +130,7 @@ class MetaData: default_repositories = ["slack", "sbo", "rlw", "alien", "conrad", "slonly", "ktown", "multi", "salix", - "slackl", "msb", "csb", "connos", "mles"] + "slackl", "msb", "csb", "connos"] # reads values from the configuration file repositories = [] @@ -187,7 +187,6 @@ class MetaData: # Grabs sub repositories ktown_kde_repo = grab_sub_repo(repositories, "ktown") msb_sub_repo = grab_sub_repo(repositories, "msb") - mles_sub_repo = grab_sub_repo(repositories, "mles") # removes no default repositories repositories = list(remove_repositories(repositories, diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index ce4dae80..a4f7c411 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -134,11 +134,3 @@ class RepoInit(Utils): arch = "64" self.mirror = (f"{self.def_repo_dict['connos']}slack-n-free" f"{arch}-{slack_ver()}/") - - def _init_mles(self): - arch = "32" - if self.meta.arch == "x86_64": - arch = "64" - self.mirror = (f"{self.def_repo_dict['mles']}" - f"{self.meta.mles_sub_repo[1:-1]}-" - f"{slack_ver()}-{arch}bit/") diff --git a/slpkg/checks.py b/slpkg/checks.py index 730f14f2..ba38a7c8 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -57,7 +57,6 @@ class Updates: "msb": self._init.msb, "csb": self._init.csb, "connos": self._init.msb, - "mles": self._init.mles } def status_bar(self): diff --git a/slpkg/init.py b/slpkg/init.py index e4e6438d..a27e3b66 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -264,7 +264,7 @@ class Init(Utils): FILELIST_TXT, repo_name) def conrad(self): - """Creating slackers local library + """Creating conrad local library """ repo = self.def_repos_dict["conrad"] log = self.log_path + "conrad/" @@ -293,7 +293,7 @@ class Init(Utils): FILELIST_TXT, repo_name) def slonly(self): - """Creating slackers local library + """Creating slonly local library """ ar = f"{self.slack_ver}-x86" repo = self.def_repos_dict["slonly"] @@ -576,41 +576,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def mles(self): - """Creating Microlinux local library - """ - ar = "32" - repo = self.def_repos_dict["mles"] - log = self.log_path + "mles/" - lib = self.lib_path + "mles_repo/" - repo_name = Init.mles.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - if self.arch == "x86_64": - ar = "64" - - version = self.meta.mles_sub_repo[1:-1] - PACKAGES_TXT = f"{repo}{version}-{self.slack_ver}-{ar}bit/{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{version}-{self.slack_ver}-{ar}bit/{md5_file}" - ChangeLog_txt = f"{repo}{version}-{self.slack_ver}-{ar}bit/{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def down(self, path, link, repo): """Downloads files """ From fd6380dfc26c98442dff94959cd8383833b31e42 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 31 May 2022 23:43:27 +0300 Subject: [PATCH 07/25] Removed rlw repository --- EXAMPLES.md | 6 ++-- REPOSITORIES.md | 5 --- conf/default-repositories | 5 ++- conf/repositories.conf | 1 - conf/rlworkman.deps | 35 --------------------- man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 4 +-- slpkg/binary/greps.py | 66 ++++++--------------------------------- slpkg/binary/repo_init.py | 3 -- slpkg/checks.py | 1 - slpkg/init.py | 30 ------------------ 12 files changed, 15 insertions(+), 143 deletions(-) delete mode 100644 conf/rlworkman.deps diff --git a/EXAMPLES.md b/EXAMPLES.md index 9c119bf5..fdc86417 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -59,11 +59,10 @@ $ slpkg --check slack No changes in ChangeLog.txt sbo News in ChangeLog.txt alien No changes in ChangeLog.txt - rlw No changes in ChangeLog.txt Summary =============================================================================== -From 5 repositories need 2 updating. Run the command 'slpkg update'. +From 3 repositories need 2 updating. Run the command 'slpkg update'. ``` Add and remove custom repositories: @@ -96,7 +95,6 @@ $ slpkg repo-list msb http://slackware.org.uk/msb/ yes enabled multi http://www.slackware.com/~alien/multilib/ yes disabled ponce http://ponce.cc/slackware/slackware64-14.2/packa~ no enabled - rlw http://rlworkman.net/pkgs/ yes disabled salix http://download.salixos.org/ yes disabled sbo http://slackbuilds.org/slackbuilds/ yes enabled slack http://ftp.cc.uoc.gr/mirrors/linux/slackware/ yes enabled @@ -106,7 +104,7 @@ $ slpkg repo-list Repositories summary =============================================================================== -3/12 enabled default repositories and 1 custom. +3/11 enabled default repositories and 1 custom. For enable or disable default repositories edit '/etc/slpkg/repositories.conf' file. diff --git a/REPOSITORIES.md b/REPOSITORIES.md index 7e6dcb4f..7f8b4fe8 100644 --- a/REPOSITORIES.md +++ b/REPOSITORIES.md @@ -11,11 +11,6 @@ For the -current users who they use the sbo repository: Slackware current is not supported, but as a general rule, the scripts should work on it as well. -Rworkman's (rlw) repository use dependencies where displayed in a central site - '`http://rlworkman.net/pkgs/`' and only those. Unfortunately there is no fixed reference - dependencies in the file PACKAGES.TXT. You can make changes in '`/etc/slpkg/rlworkman.deps`' - file. - Conraid's (conrad) repository must be used only from Slackware64 current users and it has no reference dependencies. diff --git a/conf/default-repositories b/conf/default-repositories index 155c28c8..15e8e271 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -29,14 +29,13 @@ # repository. # # Default repositories names: -# sbo, slack, rlw, alien, conrad, slonly, ktown, multi, salix, -# slackl, msb, csb, connos +# sbo, slack, alien, conrad, slonly, ktown, multi, salix, slackl, msb, +# csb, connos # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- # # NAME URL sbo http://slackbuilds.org/slackbuilds/ - rlw http://slackware.uk/people/rlworkman/ alien http://bear.alienbase.nl/mirrors/people/alien/sbrepos/ conrad http://slack.conraid.net/repository/slackware64-current/ slonly https://slackonly.com/pub/packages/ diff --git a/conf/repositories.conf b/conf/repositories.conf index 03f89de1..a1df7a98 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -41,7 +41,6 @@ slack sbo # alien -# rlw # conrad # slonly # ktown{latest} diff --git a/conf/rlworkman.deps b/conf/rlworkman.deps deleted file mode 100644 index 45f88cbe..00000000 --- a/conf/rlworkman.deps +++ /dev/null @@ -1,35 +0,0 @@ -# Rworkman's dependencies: -# -# rlworkman.deps file is part of slpkg. -# -# Copyright 2014-2022 Dimitris Zlatanidis -# All rights reserved. -# -# Slpkg is a user-friendly package manager for Slackware installations. -# -# https://gitlab.com/dslackw/slpkg -# -# Slpkg is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# END OF LEGAL NOTICE -# -# ---------------------------------------------------------------------------- -# Some notes about package dependencies (all deps are also found here): -# Rworkman's repository dependencies as shown in the central page -# http://rlworkman.net/pkgs/ -# ---------------------------------------------------------------------------- -# -# PACKAGE: DEPENDENCIES -abiword: wv -claws-mail: libetpan -inkscape: lxml numpy BeautifulSoup -xfburn: libburn libisofs diff --git a/man/slpkg.8 b/man/slpkg.8 index f19e45a3..994a020a 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -324,7 +324,6 @@ For example: slackware.com = "slack" SlackBuilds.org = "sbo" Alien's = "alien" - rworkman's = "rlw" Conraid's = "conrad" slackonly.com = "slonly" Alien's ktown = "ktown{latest}" diff --git a/man/slpkg.html b/man/slpkg.html index c8319107..22b0c6bc 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -592,7 +592,6 @@ slpkg −−help - display help for slpkg

"slack"
SlackBuilds.org = "sbo"
Alien’s = "alien"
-rworkman’s = "rlw"
Conraid’s = "conrad"
slackonly.com = "slonly"
Alien’s ktown = "ktown{latest}"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 0430c5bf..02807315 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -99,7 +99,7 @@ class MetaData: "RELEASE": STABLE, "SLACKWARE_VERSION": "off", "COMP_ARCH": "off", - "REPOSITORIES": ["slack", "sbo", "rlw", "alien", + "REPOSITORIES": ["slack", "sbo", "alien", "conrad", "slonly", "ktown{latest}", "multi", "salix", "slackl", "msb{1.18}", "csb", "connos"], @@ -128,7 +128,7 @@ class MetaData: "HTTP_PROXY": "", } - default_repositories = ["slack", "sbo", "rlw", "alien", "conrad", + default_repositories = ["slack", "sbo", "alien", "conrad", "slonly", "ktown", "multi", "salix", "slackl", "msb", "csb", "connos"] diff --git a/slpkg/binary/greps.py b/slpkg/binary/greps.py index 7e1c9c88..00bec4df 100644 --- a/slpkg/binary/greps.py +++ b/slpkg/binary/greps.py @@ -57,13 +57,6 @@ def repo_data(PACKAGES_TXT, repo, flag): runsize ) = slack_filter(name, location, size, unsize, flag) - elif repo == "rlw": - (rname, - rlocation, - rsize, - runsize - ) = rlw_filter(name, location, size, unsize) - elif repo == "alien": (rname, rlocation, @@ -112,29 +105,6 @@ def slack_filter(name, location, size, unsize, flag): return [fname, flocation, fsize, funsize] -def rlw_filter(name, location, size, unsize): - """Filter rlw repository data - """ - arch = _meta_.arch - - if arch.startswith("i") and arch.endswith("86"): - arch = "i486" - - (fname, flocation, fsize, funsize) = ([] for i in range(4)) - - for n, l, s, u in zip(name, location, size, unsize): - - loc = l.split("/") - - if arch == loc[-1]: - fname.append(n) - flocation.append(l) - fsize.append(s) - funsize.append(u) - - return [fname, flocation, fsize, funsize] - - def alien_filter(name, location, size, unsize): """Fix to avoid packages include in slackbuilds folder """ @@ -187,38 +157,20 @@ class Requires: def get_deps(self): """Grabs package requirements from repositories """ - if self.repo == "rlw": + PACKAGES_TXT = Utils().read_file(f"{_meta_.lib_path}" + f"{self.repo}_repo/PACKAGES.TXT") - dependencies = {} - rlw_deps = Utils().read_file(_meta_.conf_path + "rlworkman.deps") + for line in PACKAGES_TXT.splitlines(): - for line in rlw_deps.splitlines(): + if line.startswith("PACKAGE NAME:"): + pkg_name = split_package(line[14:].strip())[0] - if line and not line.startswith("#"): - pkgs = line.split(":") - dependencies[pkgs[0]] = pkgs[1] + if line.startswith("PACKAGE REQUIRED:"): - if self.name in dependencies.keys(): - return dependencies[self.name].split() + if pkg_name == self.name: - else: - return "" - - else: - PACKAGES_TXT = Utils().read_file(f"{_meta_.lib_path}" - f"{self.repo}_repo/PACKAGES.TXT") - - for line in PACKAGES_TXT.splitlines(): - - if line.startswith("PACKAGE NAME:"): - pkg_name = split_package(line[14:].strip())[0] - - if line.startswith("PACKAGE REQUIRED:"): - - if pkg_name == self.name: - - if line[18:].strip(): - return self._req_fix(line) + if line[18:].strip(): + return self._req_fix(line) @lru_cache def _req_fix(self, line): diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index a4f7c411..090631cb 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -57,9 +57,6 @@ class RepoInit(Utils): def _init_slack(self): self.mirror = mirrors(name="", location="") - def _init_rlw(self): - self.mirror = f"{self.def_repo_dict}{slack_ver()}/" - def _init_alien(self): ver = slack_ver() arch = "x86" diff --git a/slpkg/checks.py b/slpkg/checks.py index ba38a7c8..32ec3ab7 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -46,7 +46,6 @@ class Updates: self.all_repos = { "slack": self._init.slack, "sbo": self._init.sbo, - "rlw": self._init.rlw, "alien": self._init.alien, "conrad": self._init.conrad, "slonly": self._init.slonly, diff --git a/slpkg/init.py b/slpkg/init.py index a27e3b66..e2fd8129 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -195,36 +195,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, SLACKBUILDS_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def rlw(self): - """Creating rlw local library - """ - repo = self.def_repos_dict["rlw"] - log = self.log_path + "rlw/" - lib = self.lib_path + "rlw_repo/" - repo_name = Init.rlw.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - PACKAGES_TXT = f"{repo}{self.slack_ver}/{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{self.slack_ver}/{md5_file}" - ChangeLog_txt = f"{repo}{self.slack_ver}/{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def alien(self): """Creating alien local library """ From 1171f0e78d9049439ed4bcc407315428a5020a39 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 00:00:17 +0300 Subject: [PATCH 08/25] Removed ktown repository --- EXAMPLES.md | 17 +++++++---------- REPOSITORIES.md | 7 +++---- conf/default-repositories | 3 +-- conf/repositories.conf | 2 -- man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 6 ++---- slpkg/binary/greps.py | 34 ---------------------------------- slpkg/binary/repo_init.py | 3 --- slpkg/checks.py | 1 - slpkg/init.py | 30 ------------------------------ slpkg/pkg/manager.py | 2 +- 12 files changed, 14 insertions(+), 93 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index fdc86417..b71decac 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -23,7 +23,6 @@ Update repository [sbo] ... Done Update repository [alien] ... Done Update repository [conrad] ... Done Update repository [slonly] ... Done -Update repository [ktown] ... Done Update repository [salix] ... Done Update repository [slackl] ... Done Update repository [multi] ... Done @@ -91,7 +90,6 @@ $ slpkg repo-list | Repo id Repo URL Default Status +============================================================================== alien http://www.slackware.com/~alien/slackbuilds/ yes disabled - ktown http://alien.slackbook.org/ktown/ yes disabled msb http://slackware.org.uk/msb/ yes enabled multi http://www.slackware.com/~alien/multilib/ yes disabled ponce http://ponce.cc/slackware/slackware64-14.2/packa~ no enabled @@ -104,7 +102,7 @@ $ slpkg repo-list Repositories summary =============================================================================== -3/11 enabled default repositories and 1 custom. +3/10 enabled default repositories and 1 custom. For enable or disable default repositories edit '/etc/slpkg/repositories.conf' file. @@ -520,13 +518,12 @@ Would you like to continue [y/N]? Upgrade only distribution: ``` -$ slpkg -c slack --upgrade --skip="multi:*multilib*,ktown:*" // This upgrade -Checking... Done // distribution - // and skip all -Slackware64 'stable' v14.2 distribution is up to date // packages from - // ktown repository - // and multilib - // from multi. +$ slpkg -c slack --upgrade +Checking... Done + +Slackware64 'stable' v14.2 distribution is up to date + + ``` Skip packages when upgrading: diff --git a/REPOSITORIES.md b/REPOSITORIES.md index 7f8b4fe8..8e09ea9a 100644 --- a/REPOSITORIES.md +++ b/REPOSITORIES.md @@ -25,11 +25,10 @@ MSB (msb) repository has one ChangeLog.txt file for three sub-repositories {1.14 Slonly repository don't support -current for x86 arch. -Alien's ktown (ktown), Alien's multilib (multi), csb and Alien's restricted repository -has no reference dependencies. +Alien's multilib (multi), csb and Alien's restricted repository has no reference dependencie. -IMPORTANT: For Alien's (Eric Hameleers) repositories (alien, multi and ktown) should run - '`slpkg upgrade`' instant '`slpkg update`', if you want to spend from -stable in -current or +IMPORTANT: For Alien's (Eric Hameleers) repositories (alien and multi) should run + '`slpkg upgrade`' instant '`slpkg update`', if you want to pass from -stable in -current or not, because there is no different file '`ChangeLog.txt`' for each version. diff --git a/conf/default-repositories b/conf/default-repositories index 15e8e271..ed37d691 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -29,7 +29,7 @@ # repository. # # Default repositories names: -# sbo, slack, alien, conrad, slonly, ktown, multi, salix, slackl, msb, +# sbo, slack, alien, conrad, slonly, multi, salix, slackl, msb, # csb, connos # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- @@ -39,7 +39,6 @@ alien http://bear.alienbase.nl/mirrors/people/alien/sbrepos/ conrad http://slack.conraid.net/repository/slackware64-current/ slonly https://slackonly.com/pub/packages/ - ktown http://alien.slackbook.org/ktown/ multi http://bear.alienbase.nl/mirrors/people/alien/multilib/ salix http://download.salixos.org/ slackl http://www.slackel.gr/repo/ diff --git a/conf/repositories.conf b/conf/repositories.conf index a1df7a98..4706b044 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -24,7 +24,6 @@ # # ---------------------------------------------------------------------------- # conrad (Conraid's) repository must used from Slackware64 current. -# ktown (Alien"s ktown: 4.14.3 and latest) repository. Default ktown{latest}. # msb (Mate: 1.14, 1.16, 1,18, latest) repository. Default msb{1.18} # # Slackware ARM users will must use only two repositories at the moment slack and sbo. @@ -43,7 +42,6 @@ sbo # alien # conrad # slonly -# ktown{latest} # multi # salix # slackl diff --git a/man/slpkg.8 b/man/slpkg.8 index 994a020a..4f284884 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -326,7 +326,6 @@ For example: Alien's = "alien" Conraid's = "conrad" slackonly.com = "slonly" - Alien's ktown = "ktown{latest}" Alien's multilib = "multi" SalixOS = "salix" Slackel.gr = "slackel" diff --git a/man/slpkg.html b/man/slpkg.html index 22b0c6bc..c049a86b 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -594,7 +594,6 @@ SlackBuilds.org = "sbo"
Alien’s = "alien"
Conraid’s = "conrad"
slackonly.com = "slonly"
-Alien’s ktown = "ktown{latest}"
Alien’s multilib = "multi"
SalixOS = "salix"
Slackel.gr = "slackel"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 02807315..511b2949 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -99,8 +99,7 @@ class MetaData: "RELEASE": STABLE, "SLACKWARE_VERSION": "off", "COMP_ARCH": "off", - "REPOSITORIES": ["slack", "sbo", "alien", - "conrad", "slonly", "ktown{latest}", + "REPOSITORIES": ["slack", "sbo", "alien", "conrad", "slonly", "multi", "salix", "slackl", "msb{1.18}", "csb", "connos"], "BUILD_PATH": "/tmp/slpkg/build/", @@ -129,7 +128,7 @@ class MetaData: } default_repositories = ["slack", "sbo", "alien", "conrad", - "slonly", "ktown", "multi", "salix", + "slonly", "multi", "salix", "slackl", "msb", "csb", "connos"] # reads values from the configuration file @@ -185,7 +184,6 @@ class MetaData: slack_rel = select_slack_release(slack_rel) # Grabs sub repositories - ktown_kde_repo = grab_sub_repo(repositories, "ktown") msb_sub_repo = grab_sub_repo(repositories, "msb") # removes no default repositories diff --git a/slpkg/binary/greps.py b/slpkg/binary/greps.py index 00bec4df..4314a3b1 100644 --- a/slpkg/binary/greps.py +++ b/slpkg/binary/greps.py @@ -64,13 +64,6 @@ def repo_data(PACKAGES_TXT, repo, flag): runsize ) = alien_filter(name, location, size, unsize) - elif repo == "ktown": - (rname, - rlocation, - rsize, - runsize - ) = ktown_filter(name, location, size, unsize) - else: rname, rlocation, rsize, runsize = name, location, size, unsize @@ -121,33 +114,6 @@ def alien_filter(name, location, size, unsize): return [fname, flocation, fsize, funsize] -def ktown_filter(name, location, size, unsize): - """Filter Alien"s ktown repository data - """ - ver = slack_ver() - - if _meta_.slack_rel == "current": - ver = "current" - - path_pkg = "x86" - - if _meta_.arch == "x86_64": - path_pkg = _meta_.arch - - (fname, flocation, fsize, funsize) = ([] for i in range(4)) - - for n, l, s, u in zip(name, location, size, unsize): - - if (path_pkg in l and _meta_.ktown_kde_repo[1:-1] in l and - l.startswith(ver)): - fname.append(n) - flocation.append(l) - fsize.append(s) - funsize.append(u) - - return [fname, flocation, fsize, funsize] - - class Requires: def __init__(self, name, repo): diff --git a/slpkg/binary/repo_init.py b/slpkg/binary/repo_init.py index 090631cb..7edb00dd 100644 --- a/slpkg/binary/repo_init.py +++ b/slpkg/binary/repo_init.py @@ -87,9 +87,6 @@ class RepoInit(Utils): self.mirror = f"{self.def_repo_dict['slonly']}{arch}/" - def _init_ktown(self): - self.mirror = self.def_repo_dict["ktown"] - def _init_multi(self): ver = slack_ver() if self.meta.slack_rel == "current": diff --git a/slpkg/checks.py b/slpkg/checks.py index 32ec3ab7..adfab605 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -49,7 +49,6 @@ class Updates: "alien": self._init.alien, "conrad": self._init.conrad, "slonly": self._init.slonly, - "ktown": self._init.ktown, "multi": self._init.multi, "salix": self._init.salix, "slackl": self._init.slackl, diff --git a/slpkg/init.py b/slpkg/init.py index e2fd8129..85bf494e 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -302,36 +302,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def ktown(self): - """Creating alien ktown local library - """ - repo = self.def_repos_dict["ktown"] - log = self.log_path + "ktown/" - lib = self.lib_path + "ktown_repo/" - repo_name = Init.ktown.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - PACKAGES_TXT = f"{repo}{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{md5_file}" - ChangeLog_txt = f"{repo}{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def multi(self): """Creating alien multilib local library """ diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index 0ddbefb0..f4c3dd45 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -633,7 +633,7 @@ class PackageManager(Utils): if line.startswith("PACKAGE SIZE (compressed): "): pkg_size.append(line[26:].strip()) - if repo == "alien" or repo == "ktown": + if repo == "alien": return alien_filter(pkg_list, pkg_size) return pkg_list, pkg_size From 48a8a13b2ea6d4868fd8aaf9e480d1902e58b12d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 11:40:33 +0300 Subject: [PATCH 09/25] Switched to query --- slpkg/pkg/manager.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index f4c3dd45..fd8b476c 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -35,6 +35,7 @@ from slpkg.messages import Msg from slpkg.dialog_box import DialogUtil from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ +from slpkg.sbo.greps import SBoGrep from slpkg.slack.slackware_repo import slackware_repository @@ -617,15 +618,13 @@ class PackageManager(Utils): """Grabs packages """ pkg_list, pkg_size = [], [] - for line in packages.splitlines(): - if repo == "sbo": + if repo == "sbo": + pkg_list = SBoGrep(name="").names() - if line.startswith("SLACKBUILD NAME: "): - pkg_list.append(line[17:].strip()) - pkg_size.append("0 K") + else: - else: + for line in packages.splitlines(): if line.startswith("PACKAGE NAME: "): pkg_list.append(line[15:].strip()) @@ -649,7 +648,6 @@ class PackageManager(Utils): self.meta.lib_path + "sbo_repo/SLACKBUILDS.TXT")): packages = self.read_file(f"{self.meta.lib_path}" "sbo_repo/SLACKBUILDS.TXT") - else: if (os.path.isfile( From ec4582b48283f9e97649a9131512c6a8d7c764a6 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 15:48:19 +0300 Subject: [PATCH 10/25] Renamed method --- slpkg/desc.py | 4 ++-- slpkg/pkg/build.py | 4 ++-- slpkg/pkg/manager.py | 4 ++-- slpkg/pkg_find.py | 4 ++-- slpkg/sbo/autobuild.py | 4 ++-- slpkg/sbo/check.py | 6 +++--- slpkg/sbo/dependency.py | 6 +++--- slpkg/sbo/network.py | 7 ++++--- slpkg/sbo/{greps.py => queries.py} | 2 +- slpkg/sbo/queue.py | 8 ++++---- slpkg/sbo/slackbuild.py | 10 +++++----- slpkg/tracking.py | 4 ++-- 12 files changed, 32 insertions(+), 31 deletions(-) rename slpkg/sbo/{greps.py => queries.py} (99%) diff --git a/slpkg/desc.py b/slpkg/desc.py index 97e4a6f8..91cd4ea9 100644 --- a/slpkg/desc.py +++ b/slpkg/desc.py @@ -26,7 +26,7 @@ from slpkg.utils import Utils from slpkg.messages import Msg from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery class PkgDesc(Utils): @@ -57,7 +57,7 @@ class PkgDesc(Utils): description, count = "", 0 if self.repo == "sbo": - description = SBoGrep(self.name).description() + description = SboQuery(self.name).description() else: PACKAGES_TXT = self.read_file(self.lib) diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index 6bbfe032..36fd7591 100644 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -37,7 +37,7 @@ from slpkg.messages import Msg from slpkg.checksum import check_md5 from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery class BuildPackage(Utils): @@ -146,7 +146,7 @@ class BuildPackage(Utils): """ self.sbo_md5 = {} - md5_lists = SBoGrep(self.prgnam).checksum() + md5_lists = SboQuery(self.prgnam).checksum() for src, md5 in itertools.zip_longest(self.sources, md5_lists): self.sbo_md5[src] = md5 diff --git a/slpkg/pkg/manager.py b/slpkg/pkg/manager.py index fd8b476c..e67ec6a3 100644 --- a/slpkg/pkg/manager.py +++ b/slpkg/pkg/manager.py @@ -35,7 +35,7 @@ from slpkg.messages import Msg from slpkg.dialog_box import DialogUtil from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.slack.slackware_repo import slackware_repository @@ -620,7 +620,7 @@ class PackageManager(Utils): pkg_list, pkg_size = [], [] if repo == "sbo": - pkg_list = SBoGrep(name="").names() + pkg_list = SboQuery(name="").names() else: diff --git a/slpkg/pkg_find.py b/slpkg/pkg_find.py index 7b21d32a..e95124b9 100644 --- a/slpkg/pkg_find.py +++ b/slpkg/pkg_find.py @@ -23,7 +23,7 @@ from slpkg.messages import Msg -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.pkg.manager import PackageManager from slpkg.__metadata__ import MetaData as _meta_ @@ -91,6 +91,6 @@ class FindFromRepos: ver = "" if repo == "sbo": - ver = f"-{SBoGrep(find).version()}" + ver = f"-{SboQuery(find).version()}" return ver diff --git a/slpkg/sbo/autobuild.py b/slpkg/sbo/autobuild.py index 1eaba5e4..41ed597b 100644 --- a/slpkg/sbo/autobuild.py +++ b/slpkg/sbo/autobuild.py @@ -26,7 +26,7 @@ import os from slpkg.pkg.build import BuildPackage -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery class AutoBuild: @@ -58,7 +58,7 @@ class AutoBuild: def info_file(self): """Grabs sources from .info file and stores filename """ - sources = SBoGrep(self.prgnam).source().split() + sources = SboQuery(self.prgnam).source().split() for source in sources: self.sbo_sources.append(source.split("/")[-1]) diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index 3dd46c5e..025c5866 100644 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -31,7 +31,7 @@ from slpkg.splitting import split_package from slpkg.upgrade_checklist import choose_upg from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery def sbo_upgrade(skip, flag): @@ -41,7 +41,7 @@ def sbo_upgrade(skip, flag): black = BlackList() msg.checking() upgrade_names = [] - data = SBoGrep(name="").names() + data = SboQuery(name="").names() blacklist = list(black.get_black()) for pkg in sbo_list(): @@ -49,7 +49,7 @@ def sbo_upgrade(skip, flag): ver = split_package(pkg)[1] if (name in data and name not in skip and name not in blacklist): - sbo_package = f"{name}-{SBoGrep(name).version()}" + sbo_package = f"{name}-{SboQuery(name).version()}" package = f"{name}-{ver}" if parse_version(sbo_package) > parse_version(package): diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index ed83b74c..753844cb 100644 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -28,7 +28,7 @@ from functools import lru_cache from slpkg.blacklist import BlackList from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery class Requires(BlackList): @@ -38,7 +38,7 @@ class Requires(BlackList): super().__init__() self.flag = flag self.meta = _meta_ - self.SLACKBUILDS_TXT = SBoGrep(name="").names() + self.SLACKBUILDS_TXT = SboQuery(name="").names() self.blacklist = list(self.get_black()) self.dep_results = [] @@ -50,7 +50,7 @@ class Requires(BlackList): "--resolve-off" not in self.flag): sys.setrecursionlimit(10000) dependencies = [] - requires = SBoGrep(name).requires() + requires = SboQuery(name).requires() if requires: diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index fced7556..8cf7063e 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -39,7 +39,7 @@ from slpkg.pkg.build import BuildPackage from slpkg.pkg.manager import PackageManager from slpkg.sbo.read import ReadSBo -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.sbo.sbo_arch import SBoArch from slpkg.sbo.compressed import SBoLink from slpkg.sbo.search import sbo_search_pkg @@ -58,7 +58,7 @@ class SBoNetwork(BlackList, Utils): self.flag = flag self.meta = _meta_ self.msg = Msg() - self.data = SBoGrep(name="").names() + self.data = SboQuery(name="").names() self.check_pkg_exist() self.arch = SBoArch().get() self.comp_tar = ".tar.gz" @@ -78,7 +78,8 @@ class SBoNetwork(BlackList, Utils): if "--checklist" in self.flag: self.with_checklist() - grep = SBoGrep(self.name) + grep = SboQuery(self.name) + self.sbo_files = grep.files() self.sbo_url = sbo_search_pkg(self.name) diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/queries.py similarity index 99% rename from slpkg/sbo/greps.py rename to slpkg/sbo/queries.py index 99d19e59..387b182a 100644 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/queries.py @@ -27,7 +27,7 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.models.models import SBoTable, session -class SBoGrep(Utils): +class SboQuery(Utils): """Grabs data from sbo database """ def __init__(self, name): diff --git a/slpkg/sbo/queue.py b/slpkg/sbo/queue.py index dfb36dda..b13a1cb3 100644 --- a/slpkg/sbo/queue.py +++ b/slpkg/sbo/queue.py @@ -33,7 +33,7 @@ from slpkg.pkg.find import find_package from slpkg.pkg.build import BuildPackage from slpkg.pkg.manager import PackageManager -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.sbo.compressed import SBoLink from slpkg.sbo.search import sbo_search_pkg from slpkg.sbo.slack_find import slack_package @@ -145,7 +145,7 @@ class QueuePkgs(Utils): for pkg in packages: - if pkg not in SBoGrep(pkg).names(): + if pkg not in SboQuery(pkg).names(): raise SystemExit(f"\nPackage '{pkg}' was not found in " f"the SBo repository\n") @@ -157,7 +157,7 @@ class QueuePkgs(Utils): sbo_url = sbo_search_pkg(pkg) sbo_dwn = SBoLink(sbo_url).tar_gz() - source_dwn = SBoGrep(pkg).source().split() + source_dwn = SboQuery(pkg).source().split() os.chdir(self.meta.build_path) script = sbo_dwn.split("/")[-1] @@ -186,7 +186,7 @@ class QueuePkgs(Utils): for pkg in packages: - ver = SBoGrep(pkg).version() + ver = SboQuery(pkg).version() prgnam = f"{pkg}-{ver}" if find_package(prgnam, self.meta.output): diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 924c687a..70032cba 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -39,7 +39,7 @@ from slpkg.pkg.build import BuildPackage from slpkg.pkg.manager import PackageManager from slpkg.pkg.installed import GetFromInstalled -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.sbo.sbo_arch import SBoArch from slpkg.sbo.compressed import SBoLink from slpkg.sbo.dependency import Requires @@ -79,7 +79,7 @@ class SBoInstall(BlackList, Utils): self.count_upg = 0 self.count_uni = 0 self.msg.reading() - self.data = SBoGrep(name="").names() + self.data = SboQuery(name="").names() self.blacklist = list(self.get_black()) def init_flags(self): @@ -257,9 +257,9 @@ class SBoInstall(BlackList, Utils): sbo_versions, sources = [], [] for sbo in slackbuilds: - sbo_ver = f"{sbo}-{SBoGrep(sbo).version()}" + sbo_ver = f"{sbo}-{SboQuery(sbo).version()}" sbo_versions.append(sbo_ver) - sources.append(SBoGrep(sbo).source()) + sources.append(SboQuery(sbo).source()) return [sbo_versions, sources] @@ -376,7 +376,7 @@ class SBoInstall(BlackList, Utils): pkg = "-".join(prgnam.split("-")[:-1]) installed = "".join(find_package(prgnam, self.meta.pkg_path)) - src_link = SBoGrep(pkg).source().split() + src_link = SboQuery(pkg).source().split() if (installed and "--download-only" not in self.flag and "--rebuild" not in self.flag): diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 38f2d2f1..6b49e973 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -30,7 +30,7 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.pkg.find import find_package -from slpkg.sbo.greps import SBoGrep +from slpkg.sbo.queries import SboQuery from slpkg.sbo.dependency import Requires from slpkg.sbo.search import sbo_search_pkg @@ -171,7 +171,7 @@ class TrackingDeps(BlackList, Utils): lowercase for sbo repository """ if "--case-ins" in self.flag: - data = SBoGrep(name="").names() + data = SboQuery(name="").names() data_dict = self.case_sensitive(data) for key, value in data_dict.items(): From 6a01f0c9be3bb63ac574e06555df1cc43b7e7538 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 21:36:55 +0300 Subject: [PATCH 11/25] Updated resolving dependencies --- slpkg/sbo/dependencies.py | 45 +++++++++++++++++++++++ slpkg/sbo/dependency.py | 77 --------------------------------------- slpkg/sbo/slackbuild.py | 31 ++++++---------- slpkg/tracking.py | 16 +++----- slpkg/utils.py | 5 +-- 5 files changed, 64 insertions(+), 110 deletions(-) create mode 100644 slpkg/sbo/dependencies.py delete mode 100644 slpkg/sbo/dependency.py diff --git a/slpkg/sbo/dependencies.py b/slpkg/sbo/dependencies.py new file mode 100644 index 00000000..ae3ef877 --- /dev/null +++ b/slpkg/sbo/dependencies.py @@ -0,0 +1,45 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +# dependencies.py file is part of slpkg. + +# Copyright 2014-2022 Dimitris Zlatanidis +# All rights reserved. + +# Slpkg is a user-friendly package manager for Slackware installations + +# https://gitlab.com/dslackw/slpkg + +# Slpkg is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +from slpkg.utils import Utils +from slpkg.sbo.queries import SboQuery + + +class Requires(Utils): + + def __init__(self, name): + self.name = name + + def sbo(self): + requires = SboQuery(self.name).requires() + + for r in requires: + sub = SboQuery(r).requires() + for s in sub: + requires.append(s) + + requires.reverse() + requires = self.remove_dbs(requires) + + return requires diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py deleted file mode 100644 index 753844cb..00000000 --- a/slpkg/sbo/dependency.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - -# dependency.py file is part of slpkg. - -# Copyright 2014-2022 Dimitris Zlatanidis -# All rights reserved. - -# Slpkg is a user-friendly package manager for Slackware installations - -# https://gitlab.com/dslackw/slpkg - -# Slpkg is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -import sys -from functools import lru_cache - -from slpkg.blacklist import BlackList -from slpkg.__metadata__ import MetaData as _meta_ - -from slpkg.sbo.queries import SboQuery - - -class Requires(BlackList): - """Resolving SBo dependencies - """ - def __init__(self, flag): - super().__init__() - self.flag = flag - self.meta = _meta_ - self.SLACKBUILDS_TXT = SboQuery(name="").names() - self.blacklist = list(self.get_black()) - self.dep_results = [] - - @lru_cache - def sbo(self, name): - """Builds all dependencies of a package - """ - if (self.meta.rsl_deps in ["on", "ON"] and - "--resolve-off" not in self.flag): - sys.setrecursionlimit(10000) - dependencies = [] - requires = SboQuery(name).requires() - - if requires: - - for req in requires: - - # avoids adding %README% as dependency and if - # requires in the blacklist - if "%README%" not in req and req not in self.blacklist: - dependencies.append(req) - - self.deep_check(tuple(dependencies)) - - return self.dep_results - - else: - return [] - - @lru_cache - def deep_check(self, dependencies): - """Checking if dependencies are finished - """ - if dependencies: - self.dep_results.append(dependencies) - [self.sbo(dep) for dep in dependencies] diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 70032cba..923ffec5 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -42,8 +42,8 @@ from slpkg.pkg.installed import GetFromInstalled from slpkg.sbo.queries import SboQuery from slpkg.sbo.sbo_arch import SBoArch from slpkg.sbo.compressed import SBoLink -from slpkg.sbo.dependency import Requires from slpkg.sbo.search import sbo_search_pkg +from slpkg.sbo.dependencies import Requires from slpkg.sbo.slack_find import slack_package @@ -103,33 +103,37 @@ class SBoInstall(BlackList, Utils): for _sbo in self.slackbuilds: if _sbo in self.data and _sbo not in self.blacklist: - sbo_deps = Requires(self.flag).sbo(_sbo) + # sbo_deps = Requires(self.flag).sbo(_sbo) + sbo_deps = Requires(_sbo).sbo() self.deps += sbo_deps - self.deps_dict[_sbo] = self.one_for_all(sbo_deps) + # self.deps_dict[_sbo] = self.one_for_all(sbo_deps) + + self.deps_dict[_sbo] = sbo_deps + self.package_found.append(_sbo) else: self.package_not_found.append(_sbo) - self.update_deps() - if not self.package_found: self.match = True self.matching() self.master_packages, mas_src = self.sbo_version_source( self.package_found) + self.msg.done() if (self.meta.rsl_deps in ["on", "ON"] and self.flag != "--resolve-off" and not self.match): self.msg.resolving() - self.dependencies, dep_src = self.sbo_version_source( - self.one_for_all(self.deps)) + + self.dependencies, dep_src = self.sbo_version_source(self.deps) if (self.meta.rsl_deps in ["on", "ON"] and self.flag != "--resolve-off" and not self.match): self.msg.done() + self.clear_masters() if self.package_found: @@ -198,17 +202,6 @@ class SBoInstall(BlackList, Utils): if key == name.lower(): self.slackbuilds[index] = value - def update_deps(self): - """Update dependencies dictionary with all package - """ - onelist, dependencies = [], [] - onelist = self.dimensional_list(self.deps) - dependencies = self.remove_dbs(onelist) - - for dep in dependencies: - deps = Requires(self.flag).sbo(dep) - self.deps_dict[dep] = self.one_for_all(deps) - def continue_to_install(self): """Continue to install ? """ @@ -235,7 +228,7 @@ class SBoInstall(BlackList, Utils): """Clear master slackbuilds if already exist in dependencies or if added to install two or more times """ - self.master_packages = self.remove_dbs(self.master_packages) + # self.master_packages = self.remove_dbs(self.master_packages) for mas in self.master_packages: if mas in self.dependencies: diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 6b49e973..8d97584b 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -22,7 +22,6 @@ # along with this program. If not, see . -from slpkg.utils import Utils from slpkg.graph import Graph from slpkg.messages import Msg from slpkg.blacklist import BlackList @@ -31,14 +30,14 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.pkg.find import find_package from slpkg.sbo.queries import SboQuery -from slpkg.sbo.dependency import Requires +from slpkg.sbo.dependencies import Requires from slpkg.sbo.search import sbo_search_pkg from slpkg.binary.search import search_pkg from slpkg.binary.dependency import Dependencies -class TrackingDeps(BlackList, Utils): +class TrackingDeps(BlackList): """Views tree of dependencies and also highlights packages with the colour green if already installed and the colour red @@ -57,8 +56,6 @@ class TrackingDeps(BlackList, Utils): self.red = self.meta.color["RED"] self.endc = self.meta.color["ENDC"] self.requires = [] - self.dependencies = [] - self.dependencies_list = [] self.deps_dict = {} self.init_flags() @@ -78,9 +75,6 @@ class TrackingDeps(BlackList, Utils): self.repositories() if self.find_pkg: - self.dependencies_list.reverse() - self.requires = self.dimensional_list(self.dependencies_list) - self.dependencies = self.remove_dbs(self.requires) if self.dependencies == []: self.dependencies = ["No dependencies"] @@ -152,7 +146,7 @@ class TrackingDeps(BlackList, Utils): self.find_pkg = sbo_search_pkg(self.name) if self.find_pkg: - self.dependencies_list = Requires(self.flag).sbo(self.name) + self.dependencies = Requires(self.name).sbo() else: PACKAGES_TXT = self.read_file( @@ -163,7 +157,7 @@ class TrackingDeps(BlackList, Utils): if self.find_pkg: self.black = list(self.get_black()) - self.dependencies_list = Dependencies( + self.dependencies = Dependencies( self.repo, self.black).binary(self.name, self.flag) def sbo_case_insensitive(self): @@ -219,7 +213,7 @@ class TrackingDeps(BlackList, Utils): if self.repo == "sbo": for dep in dependencies: - deps = Requires(flag="").sbo(dep) + deps = Requires(dep).sbo() if dep not in self.deps_dict.values(): self.deps_dict[dep] = self.dimensional_list(deps) diff --git a/slpkg/utils.py b/slpkg/utils.py index db348080..ccf1e43b 100644 --- a/slpkg/utils.py +++ b/slpkg/utils.py @@ -23,7 +23,6 @@ import os -from collections import OrderedDict from slpkg.splitting import split_package @@ -51,9 +50,9 @@ class Utils: return one_list def remove_dbs(self, double): - """Removes double item from list + """Removes double items from list """ - return list(OrderedDict.fromkeys(double)) + return list(dict.fromkeys(double)) def read_file(self, registry): """Returns reading file From a62fef31d386ba248e6099460c17caa281536b27 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 23:25:25 +0300 Subject: [PATCH 12/25] Updated resolving dependencies --- slpkg/binary/dependency.py | 16 ++++++++-------- slpkg/binary/greps.py | 20 +------------------- slpkg/binary/install.py | 20 +++++++++++++------- slpkg/blacklist.py | 5 ++++- slpkg/pkg/find.py | 2 +- slpkg/sbo/dependencies.py | 15 ++++++++------- slpkg/sbo/slackbuild.py | 3 +-- slpkg/utils.py | 5 ----- 8 files changed, 36 insertions(+), 50 deletions(-) diff --git a/slpkg/binary/dependency.py b/slpkg/binary/dependency.py index 3045e208..21fcec5d 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binary/dependency.py @@ -26,23 +26,23 @@ import sys from functools import lru_cache from slpkg.__metadata__ import MetaData as _meta_ - +from slpkg.blacklist import BlackList from slpkg.binary.greps import Requires class Dependencies: """Resolving binary dependencies """ - def __init__(self, repo, black): + def __init__(self, repo): self.repo = repo - self.black = black + self.black = BlackList().get_black() self.dep_results = [] self.meta = _meta_ - def binary(self, name, flag): + def binary(self, name): """Builds all dependencies of a package """ - if self.meta.rsl_deps in ["on", "ON"] and "--resolve-off" not in flag: + if self.meta.rsl_deps in ["on", "ON"]: sys.setrecursionlimit(10000) dependencies = [] requires = Requires(name, self.repo).get_deps() @@ -54,7 +54,7 @@ class Dependencies: if req and req not in self.black: dependencies.append(req) - self.deep_check(tuple(dependencies), tuple(flag)) + self.deep_check(tuple(dependencies)) return self.dep_results @@ -62,9 +62,9 @@ class Dependencies: return [] @lru_cache - def deep_check(self, dependencies, flag): + def deep_check(self, dependencies): """Checking if dependencies are finnished """ if dependencies: self.dep_results.append(dependencies) - [self.binary(dep, flag) for dep in dependencies] + [self.binary(dep) for dep in dependencies] diff --git a/slpkg/binary/greps.py b/slpkg/binary/greps.py index 4314a3b1..16adad7b 100644 --- a/slpkg/binary/greps.py +++ b/slpkg/binary/greps.py @@ -22,7 +22,6 @@ # along with this program. If not, see . -from functools import lru_cache from slpkg.utils import Utils from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ @@ -136,21 +135,4 @@ class Requires: if pkg_name == self.name: if line[18:].strip(): - return self._req_fix(line) - - @lru_cache - def _req_fix(self, line): - """Fix salix requirements because many dependencies - splitting with "," - """ - deps = [] - - for dep in line[18:].strip().split(","): - if len(dep) > 1: - - for d in dep: - deps.append(d) - - deps.append(dep[0]) - - return deps + return line.replace("PACKAGE REQUIRED:", "").split(",") diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index 75b2f63d..aadce137 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -105,6 +105,7 @@ class BinaryInstall(BlackList, Utils): self.is_upgrade = is_upgrade mas_sum = dep_sum = sums = 0, 0, 0, 0 self.msg.done() + self.dependencies = self.resolving_deps() self.update_deps() @@ -237,12 +238,11 @@ class BinaryInstall(BlackList, Utils): self.packages[index] = value def update_deps(self): - """Updates dependencies dictionary with all package + """Updates dependencies dictionary with all packages """ for dep in self.dependencies: deps = self.dimensional_list(Dependencies( - self.repo, self.blacklist).binary( - dep, self.flag)) + self.repo).binary(dep)) self.deps_dict[dep] = deps @@ -310,15 +310,21 @@ class BinaryInstall(BlackList, Utils): """ requires = [] - if (self.meta.rsl_deps in ["on", "ON"] and - self.flag != "--resolve-off"): - self.msg.resolving() + if (self.meta.rsl_deps in ["off", "OFF"] and + "--resolve-off" not in self.flag): + return requires + + self.msg.resolving() for dep in self.packages: + dependencies = [] + dependencies = self.dimensional_list(Dependencies( - self.repo, self.blacklist).binary(dep, self.flag)) + self.repo).binary(dep)) + requires += list(self._fix_deps_repos(dependencies)) + self.deps_dict[dep] = self.remove_dbs(requires) return self.remove_dbs(requires) diff --git a/slpkg/blacklist.py b/slpkg/blacklist.py index e22f2d13..a91dcd21 100644 --- a/slpkg/blacklist.py +++ b/slpkg/blacklist.py @@ -43,7 +43,10 @@ class BlackList(Utils): if os.path.isfile(self.blackfile): self.black_conf = self.read_file(self.blackfile) - def get_black(self): + def get(self): + return list(self.black_list()) + + def black_list(self): """Return blacklist packages from /etc/slpkg/blacklist configuration file.""" blacklist = list(self.black_filter()) diff --git a/slpkg/pkg/find.py b/slpkg/pkg/find.py index 8c4bd149..5448817f 100644 --- a/slpkg/pkg/find.py +++ b/slpkg/pkg/find.py @@ -34,7 +34,7 @@ def searching(find_pkg, directory): if os.path.isdir(directory): installed = os.listdir(directory) - blacklist = list(black.get_black()) + blacklist = black.get() if os.path.exists(directory): diff --git a/slpkg/sbo/dependencies.py b/slpkg/sbo/dependencies.py index ae3ef877..39907374 100644 --- a/slpkg/sbo/dependencies.py +++ b/slpkg/sbo/dependencies.py @@ -22,24 +22,25 @@ # along with this program. If not, see . -from slpkg.utils import Utils from slpkg.sbo.queries import SboQuery +from slpkg.blacklist import BlackList -class Requires(Utils): +class Requires: def __init__(self, name): self.name = name + self.black = BlackList().get() def sbo(self): requires = SboQuery(self.name).requires() for r in requires: - sub = SboQuery(r).requires() - for s in sub: - requires.append(s) + if r not in self.black and r != "%README%": + sub = SboQuery(r).requires() + for s in sub: + requires.append(s) requires.reverse() - requires = self.remove_dbs(requires) - return requires + return list(dict.fromkeys(requires)) diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 923ffec5..05013395 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -80,7 +80,7 @@ class SBoInstall(BlackList, Utils): self.count_uni = 0 self.msg.reading() self.data = SboQuery(name="").names() - self.blacklist = list(self.get_black()) + self.blacklist = list(self.get()) def init_flags(self): """Flags initialization @@ -228,7 +228,6 @@ class SBoInstall(BlackList, Utils): """Clear master slackbuilds if already exist in dependencies or if added to install two or more times """ - # self.master_packages = self.remove_dbs(self.master_packages) for mas in self.master_packages: if mas in self.dependencies: diff --git a/slpkg/utils.py b/slpkg/utils.py index ccf1e43b..ba6b6ebe 100644 --- a/slpkg/utils.py +++ b/slpkg/utils.py @@ -49,11 +49,6 @@ class Utils: return one_list - def remove_dbs(self, double): - """Removes double items from list - """ - return list(dict.fromkeys(double)) - def read_file(self, registry): """Returns reading file """ From 1531b7d6dc44f2281139c04cac119e4d553306ec Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 1 Jun 2022 23:41:59 +0300 Subject: [PATCH 13/25] Fixed blacklist --- slpkg/binary/dependency.py | 2 +- slpkg/binary/install.py | 4 ++-- slpkg/binary/search.py | 2 +- slpkg/main.py | 5 +++-- slpkg/sbo/check.py | 2 +- slpkg/sbo/network.py | 4 ++-- slpkg/sbo/slackbuild.py | 4 ++-- slpkg/slack/patches.py | 9 +++++---- slpkg/tracking.py | 6 ++++-- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/slpkg/binary/dependency.py b/slpkg/binary/dependency.py index 21fcec5d..a2928b15 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binary/dependency.py @@ -35,7 +35,7 @@ class Dependencies: """ def __init__(self, repo): self.repo = repo - self.black = BlackList().get_black() + self.black = BlackList().get() self.dep_results = [] self.meta = _meta_ diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index aadce137..aa2a781a 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -48,7 +48,7 @@ from slpkg.binary.repo_init import RepoInit from slpkg.binary.dependency import Dependencies -class BinaryInstall(BlackList, Utils): +class BinaryInstall(Utils): """Installs binaries packages with all dependencies from repository """ @@ -83,7 +83,7 @@ class BinaryInstall(BlackList, Utils): for name in self.data[0]: self.repo_pkg_names.append(split_package(name)[0]) - self.blacklist = list(self.get_black()) + self.blacklist = BlackList().get() self.matching = False def init_flags(self): diff --git a/slpkg/binary/search.py b/slpkg/binary/search.py index 31f24b2b..1b609a94 100644 --- a/slpkg/binary/search.py +++ b/slpkg/binary/search.py @@ -37,7 +37,7 @@ def search_pkg(name, repo): text = utils.read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT") PACKAGES_TXT = list(utils.package_name(text)) - blacklist = list(black.get_black()) + blacklist = black.get() if name in PACKAGES_TXT and name not in blacklist: return name diff --git a/slpkg/main.py b/slpkg/main.py index a197928e..fb0e31b7 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -66,13 +66,14 @@ from slpkg.binary.check import pkg_upgrade from slpkg.binary.install import BinaryInstall -class ArgParse(BlackList): +class ArgParse: def __init__(self, args): super().__init__() self.args = args self.meta = _meta_ self.msg = Msg() + self.blacklist = BlackList().get() self.commands = [ "update", "upgrade", @@ -584,7 +585,7 @@ class ArgParse(BlackList): elif (len(self.args) == 2 and self.args[0] in options and flag[1] in self.args): self.args.remove(flag[1]) - self.black_remove(list(self.get_black())) + self.black_remove(self.blacklist) elif (len(self.args) > 2 and self.args[0] in options and flag[1] in self.args): diff --git a/slpkg/sbo/check.py b/slpkg/sbo/check.py index 025c5866..f70adb9a 100644 --- a/slpkg/sbo/check.py +++ b/slpkg/sbo/check.py @@ -42,7 +42,7 @@ def sbo_upgrade(skip, flag): msg.checking() upgrade_names = [] data = SboQuery(name="").names() - blacklist = list(black.get_black()) + blacklist = black.get() for pkg in sbo_list(): name = split_package(pkg)[0] diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index 8cf7063e..019e9a04 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -48,7 +48,7 @@ from slpkg.sbo.slack_find import slack_package from slpkg.slack.slack_version import slack_ver -class SBoNetwork(BlackList, Utils): +class SBoNetwork(Utils): """View SBo site in the terminal and also read, build or install packages """ @@ -103,7 +103,7 @@ class SBoNetwork(BlackList, Utils): """View SlackBuild package, read or install them from slackbuilds.org """ - if self.sbo_url and self.name not in self.get_black(): + if self.sbo_url and self.name not in BlackList().get(): self.prgnam = f"{self.name}-{self.sbo_version}" self.view_sbo() diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 05013395..e6a12daf 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -47,7 +47,7 @@ from slpkg.sbo.dependencies import Requires from slpkg.sbo.slack_find import slack_package -class SBoInstall(BlackList, Utils): +class SBoInstall(Utils): """Build and install SBo packages with all dependencies """ def __init__(self, slackbuilds, flag): @@ -80,7 +80,7 @@ class SBoInstall(BlackList, Utils): self.count_uni = 0 self.msg.reading() self.data = SboQuery(name="").names() - self.blacklist = list(self.get()) + self.blacklist = BlackList().get() def init_flags(self): """Flags initialization diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index f5dbaf59..797042a2 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -52,7 +52,7 @@ from slpkg.slack.mirrors import mirrors from slpkg.slack.slack_version import slack_ver -class Patches(BlackList, Utils): +class Patches(Utils): """Upgrades distribution from the official Slackware mirrors """ def __init__(self, skip, flag): @@ -78,6 +78,7 @@ class Patches(BlackList, Utils): self.comp_sum = [] self.uncomp_sum = [] self.msg.checking() + self.blacklist = BlackList().get() if self.version == "stable": self.PACKAGES_TXT = URL(mirrors("PACKAGES.TXT", @@ -153,7 +154,7 @@ class Patches(BlackList, Utils): """Stores and returns packages for upgrading """ data = repo_data(self.PACKAGES_TXT, "slack", self.flag) - black = list(self.get_black()) + for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]): repo_pkg_name = split_package(name)[0] @@ -162,7 +163,7 @@ class Patches(BlackList, Utils): pkg_ver = split_package(name)[1] if (GetFromInstalled(pkg_name).name() and - repo_pkg_name not in black and + repo_pkg_name not in self.blacklist and repo_pkg_name not in self.skip and parse_version(pkg_ver) > parse_version( GetFromInstalled(pkg_name).version())): @@ -178,7 +179,7 @@ class Patches(BlackList, Utils): self.count_upg -= 1 elif (not os.path.isfile(self.meta.pkg_path + name[:-4]) and - repo_pkg_name not in black and + repo_pkg_name not in self.blacklist and repo_pkg_name not in self.skip): self.dwn_links.append(f"{mirrors('', '')}{loc}/{name}") self.comp_sum.append(comp) diff --git a/slpkg/tracking.py b/slpkg/tracking.py index 8d97584b..a7b7dc67 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -37,12 +37,13 @@ from slpkg.binary.search import search_pkg from slpkg.binary.dependency import Dependencies -class TrackingDeps(BlackList): +class TrackingDeps: """Views tree of dependencies and also highlights packages with the colour green if already installed and the colour red if not installed. """ + def __init__(self, name, repo, flag): super().__init__() self.name = name @@ -57,6 +58,7 @@ class TrackingDeps(BlackList): self.endc = self.meta.color["ENDC"] self.requires = [] self.deps_dict = {} + self.blacklist = BlackList() self.init_flags() def init_flags(self): @@ -156,7 +158,7 @@ class TrackingDeps(BlackList): self.find_pkg = search_pkg(self.name, self.repo) if self.find_pkg: - self.black = list(self.get_black()) + self.black = list(self.blacklist.get()) self.dependencies = Dependencies( self.repo, self.black).binary(self.name, self.flag) From 3e4dea096662a6274e861ef963f95052ad9c069b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 00:06:57 +0300 Subject: [PATCH 14/25] Updated for version 4.0.2 --- ChangeLog.txt | 5 +++++ README.rst | 8 ++++---- man/slpkg.8 | 2 -- man/slpkg.html | 4 ---- slpkg/__metadata__.py | 2 +- slpkg/arguments.py | 2 -- slpkg/binary/install.py | 12 ------------ slpkg/main.py | 1 - slpkg/sbo/dependencies.py | 2 ++ slpkg/sbo/slackbuild.py | 12 ------------ 10 files changed, 12 insertions(+), 38 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index afff4620..489a39d9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,8 @@ +4.0.2 - 30/05/2022 +Removed: +- Repositories rlw, mles, ktown, rested, slacke, slacky +- Option --directory-prefix + 4.0.1 - 30/05/2022 Added: - SQLAlchemy Object Relational Mapper diff --git a/README.rst b/README.rst index c0a3f2cc..5e91b8f9 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ *********** -slpkg 4.0.1 +slpkg 4.0.2 *********** Slpkg is a powerful software package manager that installs, updates, and removes packages on @@ -35,9 +35,9 @@ Install from the official third party `SBo repository : Download packages without install.

-

--directory-prefix=[path/to/dir/] -: Download packages in specific directory.

- -

--case-ins : Search package name in repository with case insensitive.

diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 511b2949..ea4852dd 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -77,7 +77,7 @@ class MetaData: __all__ = "slpkg" __author__ = "dslackw" - __version_info__ = (4, 0, 1) + __version_info__ = (4, 0, 2) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com" diff --git a/slpkg/arguments.py b/slpkg/arguments.py index 3f5a5429..e97d6387 100644 --- a/slpkg/arguments.py +++ b/slpkg/arguments.py @@ -119,7 +119,6 @@ Optional arguments: -s | --sync, [repository] [package...], Sync packages. Install packages --rebuild, --reinstall, directly from remote repositories --resolve-off, --download-only, with all dependencies. - --directory-prefix=[dir], --case-ins, --patches -t | --tracking, [repository] [package], Tracking package dependencies and @@ -201,7 +200,6 @@ def usage(repo, stderr): --resolve-off, --checklist] [-s [repository] [package...], --rebuild, --reinstall, --resolve-off, --download-only, - --directory-prefix=[dir], --case-ins, --patches] [-t [repository] [package], --check-deps, --graph=[type], --case-ins] diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index aa2a781a..251cb4ce 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -67,7 +67,6 @@ class BinaryInstall(Utils): self.msg = Msg() self.version = self.meta.slack_rel self.tmp_path = self.meta.slpkg_tmp_packages - self.init_flags() self.dwn, self.dep_dwn = [], [] self.install, self.dep_install = [], [] self.comp_sum, self.dep_comp_sum = [], [] @@ -86,17 +85,6 @@ class BinaryInstall(Utils): self.blacklist = BlackList().get() self.matching = False - def init_flags(self): - """Flags initiliazation - """ - for fl in self.flag: - - if fl.startswith("--directory-prefix="): - self.tmp_path = fl.split("=")[1] - - if not self.tmp_path.endswith("/"): - self.tmp_path += "/" - def start(self, is_upgrade): """Installs packages from official Slackware distribution """ diff --git a/slpkg/main.py b/slpkg/main.py index fb0e31b7..995820ae 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -438,7 +438,6 @@ class ArgParse: additional_options = [ "--resolve-off", "--download-only", - "--directory-prefix=", "--case-ins", "--rebuild", "--reinstall", diff --git a/slpkg/sbo/dependencies.py b/slpkg/sbo/dependencies.py index 39907374..b6423592 100644 --- a/slpkg/sbo/dependencies.py +++ b/slpkg/sbo/dependencies.py @@ -27,6 +27,8 @@ from slpkg.blacklist import BlackList class Requires: + """Creates a list of dependencies with + the right order to install""" def __init__(self, name): self.name = name diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index e6a12daf..155e095a 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -65,7 +65,6 @@ class SBoInstall(Utils): self.arch = SBoArch().get() self.build_folder = self.meta.build_path self._SOURCES = self.meta.SBo_SOURCES - self.init_flags() self.unst = ["UNSUPPORTED", "UNTESTED"] self.master_packages = [] self.deps = [] @@ -82,17 +81,6 @@ class SBoInstall(Utils): self.data = SboQuery(name="").names() self.blacklist = BlackList().get() - def init_flags(self): - """Flags initialization - """ - for fl in self.flag: - - if fl.startswith("--directory-prefix="): - self.build_folder = fl.split("=")[1] - - if not self.build_folder.endswith("/"): - self.build_folder += "/" - def start(self, is_upgrade): """Start view, build and install SBo packages """ From d5e4be67b2e7937d4d60b791dce27d902adbb98b Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 00:11:29 +0300 Subject: [PATCH 15/25] Removed --autobuild option --- ChangeLog.txt | 1 + slpkg/arguments.py | 7 ---- slpkg/main.py | 17 ---------- slpkg/sbo/autobuild.py | 76 ------------------------------------------ 4 files changed, 1 insertion(+), 100 deletions(-) delete mode 100644 slpkg/sbo/autobuild.py diff --git a/ChangeLog.txt b/ChangeLog.txt index 489a39d9..98bdce7b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ Removed: - Repositories rlw, mles, ktown, rested, slacke, slacky - Option --directory-prefix +- Option --autobuild 4.0.1 - 30/05/2022 Added: diff --git a/slpkg/arguments.py b/slpkg/arguments.py index e97d6387..d1ab2989 100644 --- a/slpkg/arguments.py +++ b/slpkg/arguments.py @@ -85,12 +85,6 @@ Optional arguments: -v | --version Print program version and exit. - -a | --autobuild, [script] [source...] Auto build SBo packages. - If you have already downloaded the - script and the source code you can - build a new package with this - command. - -b | --blacklist, [package...] --add, Manage packages in the blacklist. --remove, list Add or remove packages and print the list. Each package is added @@ -189,7 +183,6 @@ def usage(repo, stderr): Optional arguments: [-h] [-v] - [-a [script] [sources...]] [-b [package...] --add, --remove, [list]] [-q [package...] --add, --remove, diff --git a/slpkg/main.py b/slpkg/main.py index 995820ae..28a3161c 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -58,7 +58,6 @@ from slpkg.pkg.manager import PackageManager from slpkg.sbo.queue import QueuePkgs from slpkg.sbo.check import sbo_upgrade from slpkg.sbo.network import SBoNetwork -from slpkg.sbo.autobuild import AutoBuild from slpkg.sbo.slackbuild import SBoInstall from slpkg.slack.patches import Patches @@ -293,20 +292,6 @@ class ArgParse: else: usage("", 1) - def auto_build(self): - """Auto built tool - """ - options = [ - "-a", - "--autobuild" - ] - - if len(self.args) >= 3 and self.args[0] in options: - AutoBuild(self.args[1], self.args[2:], self.meta.path).run() - - else: - usage("", 1) - def pkg_list(self): """List of packages by repository """ @@ -998,8 +983,6 @@ def main(): "deps-status": argparse.command_deps_status, "new-config": argparse.command_new_config, "clean-tmp": argparse.command_clean_tmp, - "-a": argparse.auto_build, - "--autobuild": argparse.auto_build, "-l": argparse.pkg_list, "--list": argparse.pkg_list, "-c": argparse.pkg_upgrade, diff --git a/slpkg/sbo/autobuild.py b/slpkg/sbo/autobuild.py deleted file mode 100644 index 41ed597b..00000000 --- a/slpkg/sbo/autobuild.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - -# autobuild.py file is part of slpkg. - -# Copyright 2014-2022 Dimitris Zlatanidis -# All rights reserved. - -# Slpkg is a user-friendly package manager for Slackware installations - -# https://gitlab.com/dslackw/slpkg - -# Slpkg is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -import os - -from slpkg.pkg.build import BuildPackage - -from slpkg.sbo.queries import SboQuery - - -class AutoBuild: - """Autobuild package if sources and script is already - downloaded - """ - def __init__(self, script, sources, path): - self.script = script - self.sources = sources - self.prgnam = self.script[:-7] - self.path = path - self.sbo_sources = [] - - def run(self): - """Builds package and fix ordelist per checksum - """ - self.files_exist() - self.info_file() - sources = self.sources - - if len(sources) > 1 and self.sbo_sources != sources: - sources = self.sbo_sources - # If the list does not have the same order uses from .info - # order. - BuildPackage(self.script, sources, self.path, auto=True).build() - - raise SystemExit() - - def info_file(self): - """Grabs sources from .info file and stores filename - """ - sources = SboQuery(self.prgnam).source().split() - for source in sources: - self.sbo_sources.append(source.split("/")[-1]) - - def files_exist(self): - """Check if SlackBuild archive.tar.gz and sources exist - """ - if not os.path.isfile(self.path + self.script): - raise SystemExit("\nslpkg: Error: SlackBuild archive.tar.gz " - "not found\n") - - for src in self.sources: - - if not os.path.isfile(self.path + src): - raise SystemExit(f"\nslpkg: Error: Source file '{src}' " - f"not found\n") From 3a84be2752d2662f8274a2d1adb81fad3a92de90 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 00:30:19 +0300 Subject: [PATCH 16/25] Removed unused --- slpkg/sbo/slackbuild.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 155e095a..827c57b4 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -91,10 +91,8 @@ class SBoInstall(Utils): for _sbo in self.slackbuilds: if _sbo in self.data and _sbo not in self.blacklist: - # sbo_deps = Requires(self.flag).sbo(_sbo) sbo_deps = Requires(_sbo).sbo() self.deps += sbo_deps - # self.deps_dict[_sbo] = self.one_for_all(sbo_deps) self.deps_dict[_sbo] = sbo_deps From 13cb4c7fc82645a16e1f1aae0c8e130c005ff6d6 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 00:39:01 +0300 Subject: [PATCH 17/25] Renamed to binaries --- slpkg/{binary => binaries}/__init__.py | 0 slpkg/{binary => binaries}/check.py | 4 ++-- slpkg/{binary => binaries}/dependency.py | 2 +- slpkg/{binary => binaries}/greps.py | 0 slpkg/{binary => binaries}/install.py | 6 +++--- slpkg/{binary => binaries}/repo_init.py | 0 slpkg/{binary => binaries}/search.py | 0 slpkg/main.py | 4 ++-- slpkg/slack/patches.py | 2 +- slpkg/slack/slackware_repo.py | 2 +- slpkg/tracking.py | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) rename slpkg/{binary => binaries}/__init__.py (100%) rename slpkg/{binary => binaries}/check.py (96%) rename slpkg/{binary => binaries}/dependency.py (98%) rename slpkg/{binary => binaries}/greps.py (100%) rename slpkg/{binary => binaries}/install.py (99%) rename slpkg/{binary => binaries}/repo_init.py (100%) rename slpkg/{binary => binaries}/search.py (100%) diff --git a/slpkg/binary/__init__.py b/slpkg/binaries/__init__.py similarity index 100% rename from slpkg/binary/__init__.py rename to slpkg/binaries/__init__.py diff --git a/slpkg/binary/check.py b/slpkg/binaries/check.py similarity index 96% rename from slpkg/binary/check.py rename to slpkg/binaries/check.py index 2d64a64c..418b763b 100644 --- a/slpkg/binary/check.py +++ b/slpkg/binaries/check.py @@ -31,8 +31,8 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.pkg.find import find_package -from slpkg.binary.greps import repo_data -from slpkg.binary.repo_init import RepoInit +from slpkg.binaries.greps import repo_data +from slpkg.binaries.repo_init import RepoInit def pkg_upgrade(repo, skip, flag): diff --git a/slpkg/binary/dependency.py b/slpkg/binaries/dependency.py similarity index 98% rename from slpkg/binary/dependency.py rename to slpkg/binaries/dependency.py index a2928b15..64bcee6f 100644 --- a/slpkg/binary/dependency.py +++ b/slpkg/binaries/dependency.py @@ -27,7 +27,7 @@ from functools import lru_cache from slpkg.__metadata__ import MetaData as _meta_ from slpkg.blacklist import BlackList -from slpkg.binary.greps import Requires +from slpkg.binaries.greps import Requires class Dependencies: diff --git a/slpkg/binary/greps.py b/slpkg/binaries/greps.py similarity index 100% rename from slpkg/binary/greps.py rename to slpkg/binaries/greps.py diff --git a/slpkg/binary/install.py b/slpkg/binaries/install.py similarity index 99% rename from slpkg/binary/install.py rename to slpkg/binaries/install.py index 251cb4ce..25a5708e 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binaries/install.py @@ -43,9 +43,9 @@ from slpkg.pkg.find import find_package from slpkg.pkg.manager import PackageManager from slpkg.pkg.installed import GetFromInstalled -from slpkg.binary.greps import repo_data -from slpkg.binary.repo_init import RepoInit -from slpkg.binary.dependency import Dependencies +from slpkg.binaries.greps import repo_data +from slpkg.binaries.repo_init import RepoInit +from slpkg.binaries.dependency import Dependencies class BinaryInstall(Utils): diff --git a/slpkg/binary/repo_init.py b/slpkg/binaries/repo_init.py similarity index 100% rename from slpkg/binary/repo_init.py rename to slpkg/binaries/repo_init.py diff --git a/slpkg/binary/search.py b/slpkg/binaries/search.py similarity index 100% rename from slpkg/binary/search.py rename to slpkg/binaries/search.py diff --git a/slpkg/main.py b/slpkg/main.py index 28a3161c..b61f419b 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -61,8 +61,8 @@ from slpkg.sbo.network import SBoNetwork from slpkg.sbo.slackbuild import SBoInstall from slpkg.slack.patches import Patches -from slpkg.binary.check import pkg_upgrade -from slpkg.binary.install import BinaryInstall +from slpkg.binaries.check import pkg_upgrade +from slpkg.binaries.install import BinaryInstall class ArgParse: diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index 797042a2..d7d27b3e 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -46,7 +46,7 @@ from slpkg.pkg.find import find_package from slpkg.pkg.manager import PackageManager from slpkg.pkg.installed import GetFromInstalled -from slpkg.binary.greps import repo_data +from slpkg.binaries.greps import repo_data from slpkg.slack.mirrors import mirrors from slpkg.slack.slack_version import slack_ver diff --git a/slpkg/slack/slackware_repo.py b/slpkg/slack/slackware_repo.py index f8968db3..06564934 100644 --- a/slpkg/slack/slackware_repo.py +++ b/slpkg/slack/slackware_repo.py @@ -23,7 +23,7 @@ from slpkg.utils import Utils -from slpkg.binary.greps import repo_data +from slpkg.binaries.greps import repo_data from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ diff --git a/slpkg/tracking.py b/slpkg/tracking.py index a7b7dc67..64e62728 100644 --- a/slpkg/tracking.py +++ b/slpkg/tracking.py @@ -33,8 +33,8 @@ from slpkg.sbo.queries import SboQuery from slpkg.sbo.dependencies import Requires from slpkg.sbo.search import sbo_search_pkg -from slpkg.binary.search import search_pkg -from slpkg.binary.dependency import Dependencies +from slpkg.binaries.search import search_pkg +from slpkg.binaries.dependency import Dependencies class TrackingDeps: From 8842aebfb980304635ef62cf12ab61582eb0bcd2 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 00:43:39 +0300 Subject: [PATCH 18/25] Fixed resolving dependencies --- slpkg/binaries/install.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index 25a5708e..2ce9aa72 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -239,7 +239,7 @@ class BinaryInstall(Utils): or if added to install two or more times """ packages = [] - for mas in self.remove_dbs(self.packages): + for mas in self.packages: if mas not in self.dependencies: packages.append(mas) @@ -313,9 +313,9 @@ class BinaryInstall(Utils): requires += list(self._fix_deps_repos(dependencies)) - self.deps_dict[dep] = self.remove_dbs(requires) + self.deps_dict[dep] = requires - return self.remove_dbs(requires) + return requires def _fix_deps_repos(self, dependencies): """Fixes store deps include in the repository From ddaf64c20c3f75e6404eac3605979344828f3893 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 01:11:05 +0300 Subject: [PATCH 19/25] Updated urls to https --- conf/default-repositories | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/default-repositories b/conf/default-repositories index ed37d691..2994a8fb 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -35,13 +35,13 @@ # ----------------------------------------------------------------------------- # # NAME URL - sbo http://slackbuilds.org/slackbuilds/ - alien http://bear.alienbase.nl/mirrors/people/alien/sbrepos/ - conrad http://slack.conraid.net/repository/slackware64-current/ - slonly https://slackonly.com/pub/packages/ - multi http://bear.alienbase.nl/mirrors/people/alien/multilib/ - salix http://download.salixos.org/ + sbo https://slackbuilds.org/slackbuilds/ + alien https://bear.alienbase.nl/mirrors/people/alien/sbrepos/ + conrad https://slack.conraid.net/repository/slackware64-current/ + slonly httpss://slackonly.com/pub/packages/ + multi https://bear.alienbase.nl/mirrors/people/alien/multilib/ + salix https://download.salixos.org/ slackl http://www.slackel.gr/repo/ - msb http://slackware.org.uk/msb/ - csb http://slackware.uk/csb/ + msb https://slackware.uk/msb/ + csb https://slackware.uk/csb/ connos https://connochaetos.org/slack-n-free/ From c94af21089b86bd08dafd52ce540e3c86a17564e Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 01:17:44 +0300 Subject: [PATCH 20/25] Updated msb repository --- slpkg/__metadata__.py | 2 +- slpkg/init.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index ea4852dd..d7036c06 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -100,7 +100,7 @@ class MetaData: "SLACKWARE_VERSION": "off", "COMP_ARCH": "off", "REPOSITORIES": ["slack", "sbo", "alien", "conrad", "slonly", - "multi", "salix", "slackl", "msb{1.18}", + "multi", "salix", "slackl", "msb{1.26}", "csb", "connos"], "BUILD_PATH": "/tmp/slpkg/build/", "SBOSRCARCH": "off", diff --git a/slpkg/init.py b/slpkg/init.py index 85bf494e..e4e425a2 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -533,7 +533,6 @@ class Init(Utils): CHECKSUMS_MD5 = args[4] FILELIST_TXT = args[5] repo = args[6] - if self.checks_logs(log_path, ChangeLog_txt): # remove old files self.file_remove(log_path, ChangeLog_txt.split("/")[-1]) @@ -600,7 +599,6 @@ class Init(Utils): if os.path.isfile(log_path + filename): local = FileSize(log_path + filename).local() - if server != local: return True From c86e536df5450e03aa2f1c1a5e457e049de4dc99 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 01:30:44 +0300 Subject: [PATCH 21/25] Removed slackl repository --- EXAMPLES.md | 4 +--- REPOSITORIES.md | 2 -- conf/default-repositories | 4 +--- conf/repositories.conf | 5 ++--- man/slpkg.8 | 1 - man/slpkg.html | 1 - slpkg/__metadata__.py | 7 +++---- slpkg/binaries/repo_init.py | 7 ------- slpkg/checks.py | 1 - slpkg/init.py | 34 ---------------------------------- slpkg/repoinfo.py | 2 +- 11 files changed, 8 insertions(+), 60 deletions(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index b71decac..1c67a747 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -24,7 +24,6 @@ Update repository [alien] ... Done Update repository [conrad] ... Done Update repository [slonly] ... Done Update repository [salix] ... Done -Update repository [slackl] ... Done Update repository [multi] ... Done Update repository [msb] ... Done @@ -96,13 +95,12 @@ $ slpkg repo-list salix http://download.salixos.org/ yes disabled sbo http://slackbuilds.org/slackbuilds/ yes enabled slack http://ftp.cc.uoc.gr/mirrors/linux/slackware/ yes enabled - slackl http://www.slackel.gr/repo/ yes disabled conrad http://slack.conraid.net/repository/slackware64-~ yes disabled slonly https://slackonly.com/pub/packages/ yes disabled Repositories summary =============================================================================== -3/10 enabled default repositories and 1 custom. +3/9 enabled default repositories and 1 custom. For enable or disable default repositories edit '/etc/slpkg/repositories.conf' file. diff --git a/REPOSITORIES.md b/REPOSITORIES.md index 8e09ea9a..08f3cad5 100644 --- a/REPOSITORIES.md +++ b/REPOSITORIES.md @@ -14,8 +14,6 @@ For the -current users who they use the sbo repository: Conraid's (conrad) repository must be used only from Slackware64 current users and it has no reference dependencies. -Slackel.gr (slackl) repository must be used only from Slackware{x86, x86_64} -current users. - MSB (msb) repository has one ChangeLog.txt file for three sub-repositories {1.14, 1.16, latest}. So if you have updated the list of packages with the version 1.14 and you want to switch to version 1.16 you must run '`slpkg upgrade`' instead of '`slpkg update`'. MSB (msb) repository diff --git a/conf/default-repositories b/conf/default-repositories index 2994a8fb..a4a5c131 100644 --- a/conf/default-repositories +++ b/conf/default-repositories @@ -29,8 +29,7 @@ # repository. # # Default repositories names: -# sbo, slack, alien, conrad, slonly, multi, salix, slackl, msb, -# csb, connos +# sbo, slack, alien, conrad, slonly, multi, salix, msb, csb, connos # NOTE: Slackware repository (slack) served from file slackware-mirros # ----------------------------------------------------------------------------- # @@ -41,7 +40,6 @@ slonly httpss://slackonly.com/pub/packages/ multi https://bear.alienbase.nl/mirrors/people/alien/multilib/ salix https://download.salixos.org/ - slackl http://www.slackel.gr/repo/ msb https://slackware.uk/msb/ csb https://slackware.uk/csb/ connos https://connochaetos.org/slack-n-free/ diff --git a/conf/repositories.conf b/conf/repositories.conf index 4706b044..6e98dc27 100644 --- a/conf/repositories.conf +++ b/conf/repositories.conf @@ -24,7 +24,7 @@ # # ---------------------------------------------------------------------------- # conrad (Conraid's) repository must used from Slackware64 current. -# msb (Mate: 1.14, 1.16, 1,18, latest) repository. Default msb{1.18} +# msb (Mate: 1,26, latest) repository. Default msb{1.26} # # Slackware ARM users will must use only two repositories at the moment slack and sbo. # @@ -44,7 +44,6 @@ sbo # slonly # multi # salix -# slackl -# msb{1.18} +# msb{1.26} # csb # connos diff --git a/man/slpkg.8 b/man/slpkg.8 index 8b83dad8..bfd16472 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -326,7 +326,6 @@ For example: slackonly.com = "slonly" Alien's multilib = "multi" SalixOS = "salix" - Slackel.gr = "slackel" MATE Desktop Environment = "msb{1.18}" Cinnamon Desktop Environment = "csb" Connochaetos slack-n-free = "connos" diff --git a/man/slpkg.html b/man/slpkg.html index e2e404b1..b8bdc38b 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -592,7 +592,6 @@ Conraid’s = "conrad"
slackonly.com = "slonly"
Alien’s multilib = "multi"
SalixOS = "salix"
-Slackel.gr = "slackel"
MATE Desktop Environment = "msb{1.18}"
Cinnamon Desktop Environment = "csb"
Connochaetos slack-n-free = "connos"
diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index d7036c06..b012a9a2 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -100,8 +100,7 @@ class MetaData: "SLACKWARE_VERSION": "off", "COMP_ARCH": "off", "REPOSITORIES": ["slack", "sbo", "alien", "conrad", "slonly", - "multi", "salix", "slackl", "msb{1.26}", - "csb", "connos"], + "multi", "salix", "msb{1.26}", "csb", "connos"], "BUILD_PATH": "/tmp/slpkg/build/", "SBOSRCARCH": "off", "SBOSRCARCH_LINK": "http://slackware.uk/sbosrcarch/by-name/", @@ -128,8 +127,8 @@ class MetaData: } default_repositories = ["slack", "sbo", "alien", "conrad", - "slonly", "multi", "salix", - "slackl", "msb", "csb", "connos"] + "slonly", "multi", "salix", "msb", + "csb", "connos"] # reads values from the configuration file repositories = [] diff --git a/slpkg/binaries/repo_init.py b/slpkg/binaries/repo_init.py index 7edb00dd..7885bc93 100644 --- a/slpkg/binaries/repo_init.py +++ b/slpkg/binaries/repo_init.py @@ -101,13 +101,6 @@ class RepoInit(Utils): self.mirror = f"{self.def_repo_dict['salix']}{arch}/{slack_ver()}/" - def _init_slackl(self): - arch = "i486" - if self.meta.arch == "x86_64": - arch = "x86_64" - - self.mirror = f"{self.def_repo_dict['slackl']}{arch}/current/" - def _init_msb(self): arch = "x86" if self.meta.arch == "x86_64": diff --git a/slpkg/checks.py b/slpkg/checks.py index adfab605..c0cb4c2c 100644 --- a/slpkg/checks.py +++ b/slpkg/checks.py @@ -51,7 +51,6 @@ class Updates: "slonly": self._init.slonly, "multi": self._init.multi, "salix": self._init.salix, - "slackl": self._init.slackl, "msb": self._init.msb, "csb": self._init.csb, "connos": self._init.msb, diff --git a/slpkg/init.py b/slpkg/init.py index e4e425a2..37f2f076 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -370,40 +370,6 @@ class Init(Utils): self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, FILELIST_TXT, repo_name) - def slackl(self): - """Creating slackel.gr local library - """ - ar = "i486" - repo = self.def_repos_dict["slackl"] - log = self.log_path + "slackl/" - lib = self.lib_path + "slackl_repo/" - repo_name = Init.slackl.__name__ - - lib_file = "PACKAGES.TXT" - # lst_file = "" - md5_file = "CHECKSUMS.md5" - log_file = "ChangeLog.txt" - - self.make_dir([log, lib]) - - if self.arch == "x86_64": - ar = "x86_64" - - PACKAGES_TXT = f"{repo}{ar}/current/{lib_file}" - FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{ar}/current/{md5_file}" - ChangeLog_txt = f"{repo}{ar}/current/{log_file}" - - if self.check: - return self.checks_logs(log, ChangeLog_txt) - - self.down(lib, PACKAGES_TXT, repo_name) - self.down(lib, CHECKSUMS_MD5, repo_name) - self.down(log, ChangeLog_txt, repo_name) - - self.remote(log, ChangeLog_txt, lib, PACKAGES_TXT, CHECKSUMS_MD5, - FILELIST_TXT, repo_name) - def msb(self): """Creating MATE local library """ diff --git a/slpkg/repoinfo.py b/slpkg/repoinfo.py index c1a17f5b..33d61ef0 100644 --- a/slpkg/repoinfo.py +++ b/slpkg/repoinfo.py @@ -132,7 +132,7 @@ class RepoInfo(Utils): if line.startswith("PACKAGE SIZE (uncompressed): "): unsize.append(line[30:-2].strip()) - if repo in ["salix", "slackl"]: + if repo == "salix": log = self.read_file( f"{self.meta.log_path}{repo}/ChangeLog.txt") From 082cbeea9620792cdb63fb0e9b8706befc2f563f Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 01:45:54 +0300 Subject: [PATCH 22/25] Removed --network option --- ChangeLog.txt | 3 +- conf/slpkg.bash-completion | 2 +- conf/slpkg.fish | 2 - man/slpkg.8 | 13 -- man/slpkg.html | 23 -- slpkg/arguments.py | 6 - slpkg/main.py | 37 ---- slpkg/sbo/network.py | 419 ------------------------------------- 8 files changed, 3 insertions(+), 502 deletions(-) delete mode 100644 slpkg/sbo/network.py diff --git a/ChangeLog.txt b/ChangeLog.txt index 98bdce7b..b7d3ac55 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,8 +1,9 @@ 4.0.2 - 30/05/2022 Removed: -- Repositories rlw, mles, ktown, rested, slacke, slacky +- Repositories rlw, mles, ktown, rested, slacke, slacky, slackl - Option --directory-prefix - Option --autobuild +- Option --network 4.0.1 - 30/05/2022 Added: diff --git a/conf/slpkg.bash-completion b/conf/slpkg.bash-completion index 1ad16262..63f36205 100644 --- a/conf/slpkg.bash-completion +++ b/conf/slpkg.bash-completion @@ -4,7 +4,7 @@ _slpkg() cur=${COMP_WORDS[COMP_CWORD]} if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "--autobuild --blacklist --queue --list --check --sync --tracking --print --network --FIND --find --installpkg --upgradepkg --removepkg --display" -- $cur )) + COMPREPLY=( $( compgen -W "--blacklist --queue --list --check --sync --tracking --print --FIND --find --installpkg --upgradepkg --removepkg --display" -- $cur )) else _filedir diff --git a/conf/slpkg.fish b/conf/slpkg.fish index 3bcaa55f..6b80d70b 100644 --- a/conf/slpkg.fish +++ b/conf/slpkg.fish @@ -1,6 +1,5 @@ complete --command slpkg --long-option help --short-option h --description 'Print this help message and exit.' complete --command slpkg --long-option version --short-option v --description 'Print program version and exit.' -complete --command slpkg --long-option autobuild --short-option a --description 'Auto build SBo packages. If you already have downloaded the script and the source code you can build a new package with this command.' complete --command slpkg --long-option blacklist --short-option b --description 'Manage packages in the blacklist. Add or remove packages and print the list. Each package is added here will not be accessible by the program.' complete --command slpkg --long-option queue --short-option q --description 'Manage SBo packages in the queue. Add or remove and print the list build-install of packages. Build and then install the packages from the queue.' complete --command slpkg --long-option config --short-option g --description 'Configuration file management. Print the configuration file or edit.' @@ -9,7 +8,6 @@ complete --command slpkg --long-option check --short-option c --description 'Che complete --command slpkg --long-option sync --short-option s --description 'Sync packages. Install packages directly from remote repositories with all dependencies.' complete --command slpkg --long-option tracking --short-option t --description 'Tracking package dependencies and print package dependenies tree with highlight if packages is installed.' complete --command slpkg --long-option print --short-option p --description 'Print description of a package directly from the repository and change color text.' -complete --command slpkg --long-option network --short-option n --description 'View a standard of SBo page in terminal and manage multiple options like reading downloading building installation etc.' complete --command slpkg --long-option find --short-option f --description 'Find and print installed packages reporting the size and the sum.' complete --command slpkg --long-option FIND --short-option F --description 'Find packages from repositories and search at each enabled repository and prints results.' complete --command slpkg --long-option installpkg --short-option i --description 'Installs single or multiple Slackware binary packages.' diff --git a/man/slpkg.8 b/man/slpkg.8 index bfd16472..2e1cefd1 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -257,19 +257,6 @@ Additional options: .PP \fB--third-party\fP : View all the third-party packages. -.SS -n, --network, view SBo packages -\fBslpkg\fP \fB-n\fP <\fIname of package\fP>, <\fI[pattern], --checklist\fP>, \fB--case-ins\fP -.PP -View complete slackbuilds.org site in your terminal. Read file, download, -build or install etc. Use "--checklist" additional option to load all repository, example: -"# slpkg -n --checklist". -.PP -Additional options: -.PP -\fB--checklist\fP : Enable dialog utility and checklist option. (Require python3-pythondialog) -.PP -\fB--case-ins\fP : Search package name in repository with case insensitive. - .SS -i, --installpkg, install Slackware binary packages \fBslpkg\fP \fB-i\fP \fB[--warn, --md5sum, --root /otherroot, --infobox, --menu, --terse, --ask, --priority ADD|REC|OPT|SKP, --tagfile /somedir/tagfile]\fP <\fIpackages.t?z\fP> diff --git a/man/slpkg.html b/man/slpkg.html index b8bdc38b..d6e624d0 100644 --- a/man/slpkg.html +++ b/man/slpkg.html @@ -470,29 +470,6 @@ options:

--third-party : View all the third-party packages.

-

-n, ---network, view SBo packages
-slpkg -n
<name of package>, -<[pattern], --checklist>, --case-ins

- -

View complete -slackbuilds.org site in your terminal. Read file, download, -build or install etc. Use "--checklist" additional -option to load all repository, example: "# slpkg -n ---checklist".

- -

Additional -options:

- - -

--checklist -: Enable dialog utility and checklist option. (Require -python3-pythondialog)

- - -

--case-ins -: Search package name in repository with case -insensitive.

-i, --installpkg, install Slackware binary packages
diff --git a/slpkg/arguments.py b/slpkg/arguments.py index d1ab2989..31ceb221 100644 --- a/slpkg/arguments.py +++ b/slpkg/arguments.py @@ -126,11 +126,6 @@ Optional arguments: --color=[] directly from the repository and change color text. - -n | --network, [package], --checklist, View a standard of SBo page in - --case-ins terminal and manage multiple - options like reading, downloading, - building, installation, etc. - -F | --FIND, [package...], --case-ins Find packages from each enabled repository and view results. @@ -197,7 +192,6 @@ def usage(repo, stderr): [-t [repository] [package], --check-deps, --graph=[type], --case-ins] [-p [repository] [package], --color=[]] - [-n [SBo package], --checklist, --case-ins] [-F [package...], --case-ins] [-f [package...], --case-ins, --third-party] [-i [options] [package...]] diff --git a/slpkg/main.py b/slpkg/main.py index b61f419b..3c35e93b 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -57,7 +57,6 @@ from slpkg.pkg.manager import PackageManager from slpkg.sbo.queue import QueuePkgs from slpkg.sbo.check import sbo_upgrade -from slpkg.sbo.network import SBoNetwork from slpkg.sbo.slackbuild import SBoInstall from slpkg.slack.patches import Patches @@ -509,40 +508,6 @@ class ArgParse: else: usage("", 1) - def sbo_network(self): - """Views slackbuilds packages - """ - flag = [] - options = [ - "-n", - "--network" - ] - additional_options = [ - "--checklist", - "--case-ins" - ] - - for add in additional_options: - - if add in self.args: - flag.append(add) - self.args.remove(add) - - if "--checklist" in flag: - self.if_checklist() - - if (len(self.args) == 2 and self.args[0] in options and - "sbo" in self.meta.repositories): - SBoNetwork(self.args[1], flag).view() - - elif (len(self.args) == 1 and self.args[0] in options and - "sbo" in self.meta.repositories and - additional_options[0] in flag): - SBoNetwork("", flag).view() - - else: - usage("sbo", 1) - def pkg_blacklist(self): """Manages blacklist packages """ @@ -991,8 +956,6 @@ def main(): "--sync": argparse.pkg_install, "-t": argparse.pkg_tracking, "--tracking": argparse.pkg_tracking, - "-n": argparse.sbo_network, - "--netwotk": argparse.sbo_network, "-b": argparse.pkg_blacklist, "--blacklist": argparse.pkg_blacklist, "-q": argparse.pkg_queue, diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py deleted file mode 100644 index 019e9a04..00000000 --- a/slpkg/sbo/network.py +++ /dev/null @@ -1,419 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - -# network.py file is part of slpkg. - -# Copyright 2014-2022 Dimitris Zlatanidis -# All rights reserved. - -# Slpkg is a user-friendly package manager for Slackware installations - -# https://gitlab.com/dslackw/slpkg - -# Slpkg is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - - -import os -import pydoc - -from slpkg.utils import Utils -from slpkg.messages import Msg -from slpkg.blacklist import BlackList -from slpkg.downloader import Download -from slpkg.remove import delete_folder -from slpkg.dialog_box import DialogUtil -from slpkg.security import pkg_security -from slpkg.__metadata__ import MetaData as _meta_ - -from slpkg.pkg.find import find_package -from slpkg.pkg.build import BuildPackage -from slpkg.pkg.manager import PackageManager - -from slpkg.sbo.read import ReadSBo -from slpkg.sbo.queries import SboQuery -from slpkg.sbo.sbo_arch import SBoArch -from slpkg.sbo.compressed import SBoLink -from slpkg.sbo.search import sbo_search_pkg -from slpkg.sbo.slack_find import slack_package - -from slpkg.slack.slack_version import slack_ver - - -class SBoNetwork(Utils): - """View SBo site in the terminal and also read, build or - install packages - """ - def __init__(self, name, flag): - super().__init__() - self.name = name - self.flag = flag - self.meta = _meta_ - self.msg = Msg() - self.data = SboQuery(name="").names() - self.check_pkg_exist() - self.arch = SBoArch().get() - self.comp_tar = ".tar.gz" - self.choice = "" - self.FAULT = "" - self.green = self.meta.color["GREEN"] - self.red = self.meta.color["RED"] - self.yellow = self.meta.color["YELLOW"] - self.cyan = self.meta.color["CYAN"] - self.grey = self.meta.color["GREY"] - self.endc = self.meta.color["ENDC"] - self.build_folder = self.meta.build_path - self._SOURCES = self.meta.SBo_SOURCES - self.msg.reading() - self.case_insensitive() - - if "--checklist" in self.flag: - self.with_checklist() - - grep = SboQuery(self.name) - - self.sbo_files = grep.files() - self.sbo_url = sbo_search_pkg(self.name) - - if self.sbo_url: - self.sbo_desc = grep.description()[len(self.name) + 2:-1] - self.source_dwn = grep.source().split() - self.sbo_req = grep.requires() - self.sbo_dwn = SBoLink(self.sbo_url).tar_gz() - self.sbo_version = grep.version() - self.dwn_srcs = self.sbo_dwn.split() + self.source_dwn - - if "--checklist" not in self.flag or not self.sbo_url and self.name: - self.msg.done() - - def check_pkg_exist(self): - if self.name not in self.data: - self.msg.pkg_not_found("\n", self.name, "can't find", "\n") - raise SystemExit(1) - - def view(self): - """View SlackBuild package, read or install them - from slackbuilds.org - """ - if self.sbo_url and self.name not in BlackList().get(): - self.prgnam = f"{self.name}-{self.sbo_version}" - self.view_sbo() - - while True: - - self.read_choice() - - choice = { - "r": self.choice_README, - "R": self.choice_README, - "s": self.choice_SlackBuild, - "S": self.choice_SlackBuild, - "f": self.choice_info, - "F": self.choice_info, - "o": self.choice_doinst, - "O": self.choice_doinst, - "d": self.choice_download, - "D": self.choice_download, - "download": self.choice_download, - "b": self.choice_build, - "B": self.choice_build, - "build": self.choice_build, - "i": self.choice_install, - "I": self.choice_install, - "install": self.choice_install, - "c": self.choice_clear_screen, - "C": self.choice_clear_screen, - "clear": self.choice_clear_screen, - "q": self.choice_quit, - "quit": self.choice_quit, - "Q": self.choice_quit - } - - try: - choice[self.choice]() - except KeyError: - pass - - else: - self.msg.pkg_not_found("\n", self.name, "Can't view", "\n") - raise SystemExit(1) - - def case_insensitive(self): - """Matching packages distinguish between uppercase and - lowercase - """ - - if "--case-ins" in self.flag: - data_dict = self.case_sensitive(self.data) - - for key, value in data_dict.items(): - - if key == self.name.lower(): - self.name = value - - def read_choice(self): - """Return choice - """ - commands = { - "r": "README", - "R": "README", - "s": f"{self.name}.SlackBuild", - "S": f"{self.name}.SlackBuild", - "f": f"{self.name}.info", - "F": f"{self.name}.info", - "o": "doinst.sh", - "O": "doinst.sh", - "d": "download", - "D": "download", - "download": "download", - "b": "build", - "B": "build", - "build": "build", - "i": "install", - "I": "install", - "install": "install", - "c": "clear", - "C": "clear", - "clear": "clear", - "q": "quit", - "quit": "quit", - "Q": "quit" - } - - try: - message = " Choose an option > " - self.choice = input(f"{self.grey}{message}{self.endc}") - except EOFError: - raise SystemExit('\n') - - try: - print("{0}\x1b[1A{1}{2}{3}\n".format( - " " * len(message), self.cyan, commands[self.choice], - self.endc), end="") - print(end="", flush=True) - except KeyError: - pass - - def choice_README(self): - """View README file - """ - README = ReadSBo(self.sbo_url).readme("README") - fill = self.fill_pager(README) - self.pager(README + fill) - - def choice_SlackBuild(self): - """View .SlackBuild file - """ - SlackBuild = ReadSBo(self.sbo_url).slackbuild(self.name, ".SlackBuild") - fill = self.fill_pager(SlackBuild) - self.pager(SlackBuild + fill) - - def choice_info(self): - """View .info file - """ - info = ReadSBo(self.sbo_url).info(self.name, ".info") - fill = self.fill_pager(info) - self.pager(info + fill) - - def choice_doinst(self): - """View doinst.sh file - """ - if "doinst.sh" in self.sbo_files.split(): - doinst_sh = ReadSBo(self.sbo_url).doinst("doinst.sh") - fill = self.fill_pager(doinst_sh) - self.pager(doinst_sh + fill) - - def choice_download(self): - """Download script.tar.gz and sources - """ - Download(path="", url=self.dwn_srcs, repo="sbo").start() - raise SystemExit() - - def choice_build(self): - """Build package - """ - self.build() - delete_folder(self.build_folder) - raise SystemExit() - - def choice_install(self): - """Download, build and install the package - """ - pkg_security([self.name]) - - if not find_package(self.prgnam, self.meta.pkg_path): - self.build() - self.install() - delete_folder(self.build_folder) - - raise SystemExit() - - else: - self.msg.template(78) - self.msg.pkg_found(self.prgnam) - self.msg.template(78) - - raise SystemExit() - - def choice_clear_screen(self): - """Clear screen - """ - os.system("clear") - self.view() - - def choice_quit(self): - """Quit from choices - """ - raise SystemExit() - - def view_sbo(self): - """View slackbuild.org - """ - sbo_url = self.sbo_url.replace("/slackbuilds/", "/repository/") - br1, br2, fix_sp = "", "", " " - - if self.meta.use_colors in ["off", "OFF"]: - br1 = "(" - br2 = ")" - fix_sp = "" - - print() # new line at start - self.msg.template(78) - print(f"| {' ' * 28}{self.grey}SlackBuilds Repository{self.endc}") - self.msg.template(78) - print(f"| {slack_ver()} > {sbo_url.split('/')[-3].title()} > {self.cyan}{self.name}{self.endc}") - self.msg.template(78) - print(f"| {self.green}Package url{self.endc}: {sbo_url}") - self.msg.template(78) - print(f"| {self.green}Description: {self.endc}{self.sbo_desc}") - print(f"| {self.green}SlackBuild: {self.endc}{self.sbo_dwn.split('/')[-1]}") - print(f"| {self.green}Sources: {self.endc}{', '.join([src.split('/')[-1] for src in self.source_dwn])}") - print(f"| {self.yellow}Requirements: {self.endc}{', '.join(self.sbo_req)}") - self.msg.template(78) - print(f"| {self.red}R{self.endc}{br2}EADME View the README file") - print(f"| {self.red}S{self.endc}{br2}lackBuild View the .SlackBuild file") - print(f"| In{br1}{self.red}f{self.endc}{br2}o{fix_sp} View the .info file") - - if "doinst.sh" in self.sbo_files.split(): - print(f"| D{br1}{self.red}o{self.endc}{br2}inst.sh{fix_sp} View the doinst.sh file") - - print(f"| {self.red}D{self.endc}{br2}ownload Download this package") - print(f"| {self.red}B{self.endc}{br2}uild Download and build") - print(f"| {self.red}I{self.endc}{br2}nstall Download/Build/Install") - print(f"| {self.red}C{self.endc}{br2}lear Clear screen") - print(f"| {self.red}Q{self.endc}{br2}uit Quit") - self.msg.template(78) - - def with_checklist(self): - """Using dialog and checklist option - """ - data = [] - - if not self.name: - data = self.data - - else: - for name in self.data: - if self.name in name: - data.append(name) - - if data: - text = "Press 'spacebar' to choose SlackBuild for view" - title = " SlackBuilds.org " - backtitle = f"{_meta_.__all__} {_meta_.__version__}" - status = False - pkg = DialogUtil(data, text, title, backtitle, status).checklist() - - if pkg and len(pkg) > 1: - os.system("clear") - raise SystemExit("\nslpkg: Error: Choose only one package\n") - - if pkg is None: - raise SystemExit(1) - - self.name = "".join(pkg) - os.system("clear") - - def pager(self, text): - """Read text - """ - pydoc.pager(text) - - def fill_pager(self, page): - """Fixes pager spaces - """ - tty_size = os.popen("stty size", "r").read().split() - rows = int(tty_size[0]) - 1 - lines = sum(1 for line in page.splitlines()) - diff = rows - lines - fill = "\n" * diff - - if diff > 0: - return fill - - else: - return "" - - def error_uns(self): - """Checks if the package supported by an arch - before proceeding to install - """ - self.FAULT = "" - UNST = ["UNSUPPORTED", "UNTESTED"] - - if "".join(self.source_dwn) in UNST: - self.FAULT = "".join(self.source_dwn) - - def build(self): - """Builds slackware package - """ - pkg_security([self.name]) - self.error_uns() - - if self.FAULT: - print() - self.msg.template(78) - print(f"| Package {self.prgnam} {self.red} {self.FAULT} " - f"{self.endc}") - self.msg.template(78) - - else: - sources = [] - - if not os.path.exists(self.meta.build_path): - os.makedirs(self.meta.build_path) - - if not os.path.exists(self._SOURCES): - os.makedirs(self._SOURCES) - - os.chdir(self.meta.build_path) - - Download(self.meta.build_path, self.sbo_dwn.split(), - repo="sbo").start() - - Download(self._SOURCES, self.source_dwn, repo="sbo").start() - - script = self.sbo_dwn.split("/")[-1] - - for src in self.source_dwn: - sources.append(src.split("/")[-1]) - - BuildPackage(script, sources, self.meta.build_path, - auto=False).build() - - slack_package(self.prgnam) # check if build - - def install(self): - """Installs SBo package found in /tmp directory. - """ - binary = slack_package(self.prgnam) - print(f"[ {self.green}Installing{self.endc} ] --> {self.name}") - PackageManager(binary).upgrade(flag="--install-new") From 1e59c78dcc0451386cabdcee69490be9b1a79367 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 12:42:56 +0300 Subject: [PATCH 23/25] Added alien table --- slpkg/binaries/check.py | 2 +- slpkg/binaries/dependency.py | 2 +- slpkg/binaries/install.py | 2 +- slpkg/binaries/{greps.py => queries.py} | 0 slpkg/init.py | 24 ++++++++---- slpkg/models/data.py | 50 +++++++++++++++++++++++-- slpkg/models/models.py | 15 ++++++++ slpkg/slack/patches.py | 2 +- slpkg/slack/slackware_repo.py | 2 +- 9 files changed, 82 insertions(+), 17 deletions(-) rename slpkg/binaries/{greps.py => queries.py} (100%) diff --git a/slpkg/binaries/check.py b/slpkg/binaries/check.py index 418b763b..09b14f3f 100644 --- a/slpkg/binaries/check.py +++ b/slpkg/binaries/check.py @@ -31,7 +31,7 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.pkg.find import find_package -from slpkg.binaries.greps import repo_data +from slpkg.binaries.queries import repo_data from slpkg.binaries.repo_init import RepoInit diff --git a/slpkg/binaries/dependency.py b/slpkg/binaries/dependency.py index 64bcee6f..d0159f61 100644 --- a/slpkg/binaries/dependency.py +++ b/slpkg/binaries/dependency.py @@ -27,7 +27,7 @@ from functools import lru_cache from slpkg.__metadata__ import MetaData as _meta_ from slpkg.blacklist import BlackList -from slpkg.binaries.greps import Requires +from slpkg.binaries.queries import Requires class Dependencies: diff --git a/slpkg/binaries/install.py b/slpkg/binaries/install.py index 2ce9aa72..4ff06aea 100644 --- a/slpkg/binaries/install.py +++ b/slpkg/binaries/install.py @@ -43,7 +43,7 @@ from slpkg.pkg.find import find_package from slpkg.pkg.manager import PackageManager from slpkg.pkg.installed import GetFromInstalled -from slpkg.binaries.greps import repo_data +from slpkg.binaries.queries import repo_data from slpkg.binaries.repo_init import RepoInit from slpkg.binaries.dependency import Dependencies diff --git a/slpkg/binaries/greps.py b/slpkg/binaries/queries.py similarity index 100% rename from slpkg/binaries/greps.py rename to slpkg/binaries/queries.py diff --git a/slpkg/init.py b/slpkg/init.py index 37f2f076..a9311d70 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -34,7 +34,7 @@ from slpkg.__metadata__ import MetaData as _meta_ from slpkg.slack.mirrors import mirrors from slpkg.slack.slack_version import slack_ver -from slpkg.models.models import SBoTable, session +from slpkg.models.models import SBoTable, AlienTable, session class Init(Utils): @@ -527,9 +527,7 @@ class Init(Utils): self.down(lib_path, FILELIST_TXT, repo) self.down(log_path, ChangeLog_txt, repo) - if repo == 'sbo': - self.session.query(SBoTable).delete() # delete all data - self.session.commit() + delete_table_data(repo) def merge(self, path, outfile, infiles): """Merging files @@ -612,10 +610,7 @@ class Upgrade: update = Update() update.run(repos) - def del_tables(self, repo): - if repo == 'sbo': - self.session.query(SBoTable).delete() # delete all data - self.session.commit() + delete_table_data(repo) class Update: @@ -675,12 +670,25 @@ class Update: if self.session.query(SBoTable).first() is None: db.insert_sbo_table() + if self.session.query(AlienTable).first() is None: + db.insert_alien_table() + def done_msg(self, repo): print(f"{self.grey}Checking repository " f"[{self.cyan}{repo}{self.grey}] ... " f"{self.endc}", end="", flush=True) +def delete_table_data(repo): + if repo == 'sbo': + session.query(SBoTable).delete() + session.commit() + + if repo == 'alien': + session.query(AlienTable).delete() + session.commit() + + def check_exists_repositories(repo): """Checking if repositories exists by PACKAGES.TXT file """ diff --git a/slpkg/models/data.py b/slpkg/models/data.py index 53fcf214..3f6c11bd 100644 --- a/slpkg/models/data.py +++ b/slpkg/models/data.py @@ -24,7 +24,7 @@ from progress.bar import Bar from slpkg.__metadata__ import MetaData as _meta_ -from slpkg.models.models import SBoTable, session +from slpkg.models.models import SBoTable, AlienTable, session class Database: @@ -33,6 +33,21 @@ class Database: self.lib_path = _meta_.lib_path self.session = session + self.pkg_tags = [ + "PACKAGE NAME:", + "PACKAGE LOCATION:", + "PACKAGE SIZE (compressed):", + "PACKAGE SIZE (uncompressed):", + "PACKAGE REQUIRED:", + "PACKAGE CONFLICTS:", + "PACKAGE SUGGESTS:", + "PACKAGE DESCRIPTION:" + ] + + def open_file(self, file): + with open(file, "r", encoding="utf-8") as f: + return f.readlines() + def insert_sbo_table(self): """Grabbing data line by line and inserting them into the database """ @@ -80,6 +95,33 @@ class Database: self.session.commit() - def open_file(self, file): - with open(file, "r", encoding="utf-8") as f: - return f.readlines() + def insert_alien_table(self): + pkg_file = self.open_file(f"{self.lib_path}alien_repo/PACKAGES.TXT") + + bar = Bar("Creating alien database", max=len(pkg_file), + suffix="%(percent)d%% - %(eta)ds") + + cache = [] # init cache + + for i, line in enumerate(pkg_file, 1): + + for p in self.pkg_tags: + if line.startswith(p): + line = line.replace(p, "").strip() + cache.append(line) + + if (i % 20) == 0: + data = AlienTable(name=cache[0], + location=cache[1][2:], + comp_size=cache[2][:-2], + uncomp_size=cache[3][:-2], + required=cache[4], conflicts=cache[5], + suggests=cache[6], description=cache[7]) + self.session.add(data) + + cache = [] # reset cache after 11 lines + + bar.next() + bar.finish() + + self.session.commit() diff --git a/slpkg/models/models.py b/slpkg/models/models.py index 5dfd0958..a278b0d5 100644 --- a/slpkg/models/models.py +++ b/slpkg/models/models.py @@ -55,4 +55,19 @@ class SBoTable(Base): short_description = Column(Text) +class AlienTable(Base): + + __tablename__ = "alientable" + + id = Column(Integer, primary_key=True) + name = Column(Text) + location = Column(Text) + comp_size = Column(Integer) + uncomp_size = Column(Integer) + required = Column(Text) + conflicts = Column(Text) + suggests = Column(Text) + description = Column(Text) + + Base.metadata.create_all(engine) diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index d7d27b3e..df8e1a80 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -46,7 +46,7 @@ from slpkg.pkg.find import find_package from slpkg.pkg.manager import PackageManager from slpkg.pkg.installed import GetFromInstalled -from slpkg.binaries.greps import repo_data +from slpkg.binaries.queries import repo_data from slpkg.slack.mirrors import mirrors from slpkg.slack.slack_version import slack_ver diff --git a/slpkg/slack/slackware_repo.py b/slpkg/slack/slackware_repo.py index 06564934..1234e520 100644 --- a/slpkg/slack/slackware_repo.py +++ b/slpkg/slack/slackware_repo.py @@ -23,7 +23,7 @@ from slpkg.utils import Utils -from slpkg.binaries.greps import repo_data +from slpkg.binaries.queries import repo_data from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ From 91a2016026b86da28ba7c4452ff5c9d4f0ef124a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 12:58:06 +0300 Subject: [PATCH 24/25] Removed unused --- slpkg/sbo/queries.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/slpkg/sbo/queries.py b/slpkg/sbo/queries.py index 387b182a..f090bc69 100644 --- a/slpkg/sbo/queries.py +++ b/slpkg/sbo/queries.py @@ -22,18 +22,16 @@ # along with this program. If not, see . -from slpkg.utils import Utils from slpkg.__metadata__ import MetaData as _meta_ from slpkg.models.models import SBoTable, session -class SboQuery(Utils): +class SboQuery: """Grabs data from sbo database """ def __init__(self, name): self.name = name self.meta = _meta_ - self.db = self.meta.db self.arch64 = "x86_64" self.session = session From 7927e3e7eee895af36aa15cc5dcd1c78f2c1af4d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 2 Jun 2022 15:39:03 +0300 Subject: [PATCH 25/25] Added package query --- slpkg/binaries/queries.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/slpkg/binaries/queries.py b/slpkg/binaries/queries.py index 16adad7b..2f431655 100644 --- a/slpkg/binaries/queries.py +++ b/slpkg/binaries/queries.py @@ -27,6 +27,21 @@ from slpkg.splitting import split_package from slpkg.__metadata__ import MetaData as _meta_ from slpkg.slack.slack_version import slack_ver +from slpkg.models.models import AlienTable, session + + +class PkgQuery: + + def __init__(self, name): + self.name = name + self.session = session + + def location(self): + + location = self.session.query(AlienTable).filter( + AlienTable.location == self.name).first() + + return location[0] def repo_data(PACKAGES_TXT, repo, flag): @@ -36,7 +51,6 @@ def repo_data(PACKAGES_TXT, repo, flag): rname, rlocation, rsize, runsize) = ([] for i in range(8)) for line in PACKAGES_TXT.splitlines(): - if line.startswith("PACKAGE NAME:"): name.append(line[15:].strip())