From b6ffa5dde49c7dc873b3eb22d395929a2ee4f29a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 9 May 2022 08:46:57 +0300 Subject: [PATCH] Pass slack version to self Signed-off-by: Dimitris Zlatanidis --- slpkg/init.py | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/slpkg/init.py b/slpkg/init.py index 2249d82b..fc6666ba 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -43,6 +43,7 @@ class Initialization(Utils): self.check = check self.meta = _meta_ self.arch = _meta_.arch + self.slack_ver = slack_ver() self.def_repos_dict = Repo().default_repository() self.conf_path = self.meta.conf_path self.log_path = self.meta.log_path @@ -161,10 +162,10 @@ class Initialization(Utils): # md5_file = "" log_file = "ChangeLog.txt" self.make_dir([log, lib]) - SLACKBUILDS_TXT = f"{repo}{slack_ver()}/{lib_file}" + SLACKBUILDS_TXT = f"{repo}{self.slack_ver}/{lib_file}" FILELIST_TXT = "" CHECKSUMS_MD5 = "" - ChangeLog_txt = f"{repo}{slack_ver()}/{log_file}" + ChangeLog_txt = f"{repo}{self.slack_ver}/{log_file}" if self.check: return self.checks_logs(log, ChangeLog_txt) self.down(lib, SLACKBUILDS_TXT, repo_name) @@ -184,10 +185,10 @@ class Initialization(Utils): md5_file = "CHECKSUMS.md5" log_file = "ChangeLog.txt" self.make_dir([log, lib]) - PACKAGES_TXT = f"{repo}{slack_ver()}/{lib_file}" + PACKAGES_TXT = f"{repo}{self.slack_ver}/{lib_file}" FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{slack_ver()}/{md5_file}" - ChangeLog_txt = f"{repo}{slack_ver()}/{log_file}" + 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) @@ -200,7 +201,7 @@ class Initialization(Utils): """Creating alien local library """ ar = "x86" - ver = slack_ver() + ver = self.slack_ver repo = self.def_repos_dict["alien"] log = self.log_path + "alien/" lib = self.lib_path + "alien_repo/" @@ -241,11 +242,11 @@ class Initialization(Utils): self.make_dir([log, lib]) if self.arch == "x86_64": ar = "64" - PACKAGES_TXT = f"{repo}slackware{ar}-{slack_ver()}/{lib_file}" + PACKAGES_TXT = f"{repo}slackware{ar}-{self.slack_ver}/{lib_file}" FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}slackware{ar}-{slack_ver()}/{md5_file}" + CHECKSUMS_MD5 = f"{repo}slackware{ar}-{self.slack_ver}/{md5_file}" - ChangeLog_txt = f"{repo}slackware{ar}-{slack_ver()}/{log_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) @@ -281,8 +282,7 @@ class Initialization(Utils): def slonly(self): """Creating slackers local library """ - ver = slack_ver() - ar = f"{ver}-x86" + ar = f"{self.slack_ver}-x86" repo = self.def_repos_dict["slonly"] log = self.log_path + "slonly/" lib = self.lib_path + "slonly_repo/" @@ -293,7 +293,7 @@ class Initialization(Utils): log_file = "ChangeLog.txt" self.make_dir([log, lib]) if self.arch == "x86_64": - ar = f"{ver}-x86_64" + ar = f"{self.slack_ver}-x86_64" if self.meta.slack_rel == "current": ar = f"{self.meta.slack_rel}-x86" if self.meta.slack_rel == "current" and self.arch == "x86_64": @@ -337,7 +337,7 @@ class Initialization(Utils): def multi(self): """Creating alien multilib local library """ - ver = slack_ver() + ver = self.slack_ver repo = self.def_repos_dict["multi"] log = self.log_path + "multi/" lib = self.lib_path + "multi_repo/" @@ -378,12 +378,12 @@ class Initialization(Utils): ar = "64" version = self.meta.slacke_sub_repo[1:-1] PACKAGES_TXT = (f"{repo}slacke{version}/slackware{ar}-" - f"{slack_ver()}/{lib_file}") + f"{self.slack_ver}/{lib_file}") FILELIST_TXT = "" CHECKSUMS_MD5 = (f"{repo}slacke{version}/slackware{ar}-" - f"{slack_ver()}/{md5_file}") + f"{self.slack_ver}/{md5_file}") ChangeLog_txt = (f"{repo}slacke{version}/slackware{ar}-" - f"{slack_ver()}/{log_file}") + f"{self.slack_ver}/{log_file}") if self.check: return self.checks_logs(log, ChangeLog_txt) self.down(lib, PACKAGES_TXT, repo_name) @@ -407,10 +407,10 @@ class Initialization(Utils): self.make_dir([log, lib]) if self.arch == "x86_64": ar = "x86_64" - PACKAGES_TXT = f"{repo}{ar}/{slack_ver()}/{lib_file}" + PACKAGES_TXT = f"{repo}{ar}/{self.slack_ver}/{lib_file}" FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{ar}/{slack_ver()}/{md5_file}" - ChangeLog_txt = f"{repo}{ar}/{slack_ver()}/{log_file}" + CHECKSUMS_MD5 = f"{repo}{ar}/{self.slack_ver}/{md5_file}" + ChangeLog_txt = f"{repo}{ar}/{self.slack_ver}/{log_file}" if self.check: return self.checks_logs(log, ChangeLog_txt) self.down(lib, PACKAGES_TXT, repo_name) @@ -474,7 +474,7 @@ class Initialization(Utils): """Creating MATE local library """ ar = "x86" - ver_slack = slack_ver() + ver_slack = self.slack_ver repo = self.def_repos_dict["msb"] log = self.log_path + "msb/" lib = self.lib_path + "msb_repo/" @@ -505,7 +505,7 @@ class Initialization(Utils): """Creating Cinnamon local library """ ar = "x86" - ver_slack = slack_ver() + ver_slack = self.slack_ver repo = self.def_repos_dict["csb"] log = self.log_path + "csb/" lib = self.lib_path + "csb_repo/" @@ -547,10 +547,10 @@ class Initialization(Utils): self.make_dir([log, lib]) if self.arch == "x86_64": ar = "64" - PACKAGES_TXT = f"{repo}{nickname}{ar}-{slack_ver()}/{lib_file}" + PACKAGES_TXT = f"{repo}{nickname}{ar}-{self.slack_ver}/{lib_file}" FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{nickname}{ar}-{slack_ver()}/{md5_file}" - ChangeLog_txt = f"{repo}{nickname}{ar}-{slack_ver()}/{log_file}" + CHECKSUMS_MD5 = f"{repo}{nickname}{ar}-{self.slack_ver}/{md5_file}" + ChangeLog_txt = f"{repo}{nickname}{ar}-{self.slack_ver}/{log_file}" if self.check: return self.checks_logs(log, ChangeLog_txt) self.down(lib, PACKAGES_TXT, repo_name) @@ -575,10 +575,10 @@ class Initialization(Utils): if self.arch == "x86_64": ar = "64" version = self.meta.mles_sub_repo[1:-1] - PACKAGES_TXT = f"{repo}{version}-{slack_ver()}-{ar}bit/{lib_file}" + PACKAGES_TXT = f"{repo}{version}-{self.slack_ver}-{ar}bit/{lib_file}" FILELIST_TXT = "" - CHECKSUMS_MD5 = f"{repo}{version}-{slack_ver()}-{ar}bit/{md5_file}" - ChangeLog_txt = f"{repo}{version}-{slack_ver()}-{ar}bit/{log_file}" + 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)