diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/greps.py index 09dbf4c4..21be0426 100644 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/greps.py @@ -47,14 +47,18 @@ class SBoGrep: self.unst = ["UNSUPPORTED", "UNTESTED"] self.SLACKBUILDS_TXT = Utils().read_file(self.sbo_txt) - def names(self): - """Grab all packages name + def _names_grabbing(self): + """Generator that collecting all packages names """ - pkg_names = [] for line in self.SLACKBUILDS_TXT.splitlines(): if line.startswith(self.line_name): - pkg_names.append(line[17:].strip()) - return pkg_names + yield line[17:].strip() + + def names(self): + """Alias method convert generator and return + a list + """ + return list(self._names_grabbing()) def source(self): """Grab sources downloads links @@ -138,7 +142,7 @@ class SBoGrep: return md5sum64 def description(self): - """Grab package verion + """Grab package version """ for line in self.SLACKBUILDS_TXT.splitlines(): if line.startswith(self.line_name): diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 2643c1be..ccbe13bb 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -65,11 +65,7 @@ class SBoInstall: self.arch = SBoArch().get() self.build_folder = self.meta.build_path self._SOURCES = self.meta.SBo_SOURCES - 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 += "/" + self.init_flags() self.unst = ["UNSUPPORTED", "UNTESTED"] self.master_packages = [] self.deps = [] @@ -86,6 +82,15 @@ class SBoInstall: self.data = SBoGrep(name="").names() self.blacklist = BlackList().packages(pkgs=self.data, repo="sbo") + 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 """