def __init__(self, slackbuilds, flag): self.slackbuilds = slackbuilds pkg_security(self.slackbuilds) self.flag = flag self.meta = _meta_ self.msg = Msg() 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.unst = ["UNSUPPORTED", "UNTESTED"] self.master_packages = [] self.deps = [] self.dependencies = [] self.package_not_found = [] self.package_found = [] self.deps_dict = {} self.answer = "" self.match = False self.count_ins = 0 self.count_upg = 0 self.count_uni = 0 self.msg.reading() self.data = SBoGrep(name="").names() self.blacklist = BlackList().packages(pkgs=self.data, repo="sbo")
def build(self): """Only build and create Slackware package """ pkg_security([self.name]) self.error_uns() if self.FAULT: print("") self.msg.template(78) print("| Package {0} {1} {2} {3}".format(self.prgnam, self.red, self.FAULT, 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 __init__(self, packages, repo, flag): self.packages = packages pkg_security(packages) self.repo = repo self.flag = flag self.meta = _meta_ self.msg = Msg() self.version = self.meta.slack_rel self.tmp_path = self.meta.slpkg_tmp_packages 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 += "/" self.dwn, self.dep_dwn = [], [] self.install, self.dep_install = [], [] self.comp_sum, self.dep_comp_sum = [], [] self.uncomp_sum, self.dep_uncomp_sum = [], [] self.dependencies = [] self.deps_dict = {} self.answer = "" self.msg.reading() self.PACKAGES_TXT, self.mirror = RepoInit(self.repo).fetch() self.data = repo_data(self.PACKAGES_TXT, self.repo, self.flag) self.repo_pkg_names = [] for name in self.data[0]: self.repo_pkg_names.append(split_package(name)[0]) self.blacklist = BlackList().packages(self.data[0], self.repo) self.matching = False
def choice_install(self): """Download, build and install package """ pkg_security([self.name]) if not find_package(self.prgnam, self.meta.pkg_path): self.build() self.install() delete(self.build_folder) raise SystemExit() else: self.msg.template(78) self.msg.pkg_found(self.prgnam) self.msg.template(78) raise SystemExit()