From 6dba505b84e372c8b05dc667550e079bac3da5dc Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Tue, 4 Feb 2020 23:23:12 +0100 Subject: [PATCH] Updated code Signed-off-by: Dimitris Zlatanidis --- slpkg/init.py | 5 +++++ slpkg/load.py | 8 ++++---- slpkg/main.py | 6 +++--- slpkg/pkg_find.py | 2 +- slpkg/sbo/dependency.py | 3 +-- slpkg/sbo/network.py | 1 - slpkg/sbo/slackbuild.py | 1 - 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/slpkg/init.py b/slpkg/init.py index 7fc867b5..8e5be858 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -51,6 +51,11 @@ class Initialization: self._SOURCES = self.meta.SBo_SOURCES self.slpkg_tmp_packages = self.meta.slpkg_tmp_packages self.slpkg_tmp_patches = self.meta.slpkg_tmp_patches + self.constructing() + + def constructing(self): + """Creating the all necessary directories + """ if not os.path.exists(self.conf_path): os.mkdir(self.conf_path) if not os.path.exists(self.log_path): diff --git a/slpkg/load.py b/slpkg/load.py index 93f69152..44a93be5 100644 --- a/slpkg/load.py +++ b/slpkg/load.py @@ -37,12 +37,12 @@ def library(repo): pkg_list, packages = [], "" if repo == "sbo": if (os.path.isfile( - _meta_.lib_path + f"{repo}_repo/SLACKBUILDS.TXT")): - packages = Utils().read_file(_meta_.lib_path + f"{repo}_repo/SLACKBUILDS.TXT") + f"{_meta_.lib_path}{repo}_repo/SLACKBUILDS.TXT")): + packages = Utils().read_file(f"{_meta_.lib_path}{repo}_repo/SLACKBUILDS.TXT") else: if (os.path.isfile( - _meta_.lib_path + f"{repo}_repo/PACKAGES.TXT")): - packages = Utils().read_file(_meta_.lib_path + f"{repo}_repo/PACKAGES.TXT") + f"{_meta_.lib_path}{repo}_repo/PACKAGES.TXT")): + packages = Utils().read_file(f"{_meta_.lib_path}{repo}_repo/PACKAGES.TXT") for line in packages.splitlines(): if repo == "sbo": if line.startswith("SLACKBUILD NAME: "): diff --git a/slpkg/main.py b/slpkg/main.py index 8f0ea335..fc144b0e 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -324,11 +324,11 @@ class ArgParse: else: usage(self.args[1]) elif len(self.args) == 1 and self.args[0] in options: - Updates(repo="").ALL() + Updates(repo="").ALL() elif len(self.args) == 2 and self.args[0] in options: - Updates(self.args[1]).run() + Updates(self.args[1]).run() elif (len(self.args) >= 2 and self.args[0] in options and - self.args[1] not in self.meta.repositories): + self.args[1] not in self.meta.repositories): usage(self.args[1]) else: usage("") diff --git a/slpkg/pkg_find.py b/slpkg/pkg_find.py index 6e8c2d65..bac334e1 100644 --- a/slpkg/pkg_find.py +++ b/slpkg/pkg_find.py @@ -80,5 +80,5 @@ class FindFromRepos: """ ver = "" if repo == "sbo": - ver = "-" + SBoGrep(find).version() + ver = f"-{SBoGrep(find).version()}" return ver diff --git a/slpkg/sbo/dependency.py b/slpkg/sbo/dependency.py index 5fac7330..7401ee2c 100644 --- a/slpkg/sbo/dependency.py +++ b/slpkg/sbo/dependency.py @@ -68,5 +68,4 @@ class Requires: """ if dependencies: self.dep_results.append(dependencies) - for dep in dependencies: - self.sbo(dep) \ No newline at end of file + [self.sbo(dep) for dep in dependencies] \ No newline at end of file diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index 7b9fd1a0..411b8580 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -23,7 +23,6 @@ import os -import sys import pydoc from slpkg.utils import Utils diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 4a6b161d..79d0d2ce 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -353,7 +353,6 @@ class SBoInstall: if "--download-only" in self.flag: continue sources = list(self.filenames(src_link)) - print(sources) BuildPackage(script, sources, self.build_folder, auto=False).build() binary = slack_package(prgnam)