diff --git a/slpkg/sbo/greps.py b/slpkg/sbo/greps.py index 0fea5411..9a9c8d81 100644 --- a/slpkg/sbo/greps.py +++ b/slpkg/sbo/greps.py @@ -116,4 +116,4 @@ class SBoGrep(Utils): """ if self.meta.arch == self.arch64 and arch64: return arch64 - return arch \ No newline at end of file + return arch diff --git a/slpkg/sbo/network.py b/slpkg/sbo/network.py index 75ce1ddf..27ab1d4a 100644 --- a/slpkg/sbo/network.py +++ b/slpkg/sbo/network.py @@ -58,6 +58,8 @@ class SBoNetwork(BlackList, Utils): self.flag = flag self.meta = _meta_ self.msg = Msg() + self.data = SBoGrep(name="").names() + self.check_pkg_exist() self.arch = SBoArch().get() self.comp_tar = ".tar.gz" self.choice = "" @@ -71,7 +73,6 @@ class SBoNetwork(BlackList, Utils): self.build_folder = self.meta.build_path self._SOURCES = self.meta.SBo_SOURCES self.msg.reading() - self.data = SBoGrep(name="").names() self.case_insensitive() if "--checklist" in self.flag: self.with_checklist() @@ -88,6 +89,11 @@ class SBoNetwork(BlackList, Utils): 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 @@ -326,7 +332,7 @@ class SBoNetwork(BlackList, Utils): return "" def error_uns(self): - """Check if the package is supported by an arch + """Checks if the package supported by an arch before proceeding to install """ self.FAULT = ""