def start(self): """ Install new patches from official Slackware mirrors """ self.store() self.msg.done() if self.upgrade_all: if "--checklist" in self.flag: self.dialog_checklist() print("\nThese packages need upgrading:\n") self.msg.template(78) print("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}".format( "| Package", " " * 17, "New Version", " " * 8, "Arch", " " * 4, "Build", " " * 2, "Repos", " " * 10, "Size")) self.msg.template(78) print("Upgrading:") self.views() unit, size = units(self.comp_sum, self.uncomp_sum) print("\nInstalling summary") print("=" * 79) print("{0}Total {1} {2} will be upgraded and {3} will be " "installed.".format(self.meta.color["GREY"], self.count_upg, self.msg.pkg(self.upgrade_all), self.count_added)) print("Need to get {0} {1} of archives.".format(size[0], unit[0])) print("After this process, {0} {1} of additional disk space " "will be used.{2}".format(size[1], unit[1], self.meta.color["ENDC"])) print("") if self.msg.answer() in ["y", "Y"]: Download(self.patch_path, self.dwn_links, repo="slack").start() self.upgrade_all = self.utils.check_downloaded( self.patch_path, self.upgrade_all) self.upgrade() self.kernel() if self.meta.slackpkg_log in ["on", "ON"]: self.slackpkg_update() self.msg.reference(self.installed, self.upgraded) delete_package(self.patch_path, self.upgrade_all) self.update_lists() else: slack_arch = "" if self.meta.arch == "x86_64": slack_arch = "64" print("\nSlackware{0} '{1}' v{2} distribution is up to " "date\n".format(slack_arch, self.version, slack_ver()))
def start(self, if_upgrade): """ Install packages from official Slackware distribution """ self.case_insensitive() # fix if packages is for upgrade self.if_upgrade = if_upgrade mas_sum = dep_sum = sums = [0, 0, 0] self.msg.done() self.dependencies = self.resolving_deps() self.update_deps() (self.dep_dwn, self.dep_install, self.dep_comp_sum, self.dep_uncomp_sum) = self.store(self.dependencies) self.clear_masters() (self.dwn, self.install, self.comp_sum, self.uncomp_sum) = self.store(self.packages) if (self.meta.rsl_deps in ["on", "ON"] and "--resolve-off" not in self.flag): self.msg.done() if self.install: print("\nThe following packages will be automatically " "installed or upgraded \nwith new version:\n") self.top_view() self.msg.upg_inst(self.if_upgrade) mas_sum = self.views(self.install, self.comp_sum) if self.dependencies: print("Installing for dependencies:") dep_sum = self.views(self.dep_install, self.dep_comp_sum) # sums[0] --> installed # sums[1] --> upgraded # sums[2] --> uninstall sums = [sum(i) for i in zip(mas_sum, dep_sum)] unit, size = units(self.comp_sum + self.dep_comp_sum, self.uncomp_sum + self.dep_uncomp_sum) print("\nInstalling summary") print("=" * 79) print("{0}Total {1} {2}.".format(self.meta.color["GREY"], sum(sums), self.msg.pkg(sum(sums)))) print("{0} {1} will be installed, {2} will be upgraded and " "{3} will be reinstalled.".format(sums[2], self.msg.pkg(sums[2]), sums[1], sums[0])) print("Need to get {0} {1} of archives.".format(size[0], unit[0])) print("After this process, {0} {1} of additional disk " "space will be used.{2}".format(size[1], unit[1], self.meta.color["ENDC"])) print("") if self.msg.answer() in ["y", "Y"]: self.install.reverse() Download(self.tmp_path, self.dep_dwn + self.dwn, self.repo).start() if "--download-only" in self.flag: raise SystemExit() self.dep_install = Utils().check_downloaded( self.tmp_path, self.dep_install) self.install = Utils().check_downloaded( self.tmp_path, self.install) ins, upg = self.install_packages() self.msg.reference(ins, upg) write_deps(self.deps_dict) delete_package(self.tmp_path, self.install) else: self.msg.not_found(self.if_upgrade)
def start(self, is_upgrade): """ Install packages from official Slackware distribution """ self.case_insensitive() # fix if packages is for upgrade self.is_upgrade = is_upgrade mas_sum = dep_sum = sums = [0, 0, 0] self.msg.done() self.dependencies = self.resolving_deps() self.update_deps() (self.dep_dwn, self.dep_install, self.dep_comp_sum, self.dep_uncomp_sum) = self.store(self.dependencies) self.clear_masters() (self.dwn, self.install, self.comp_sum, self.uncomp_sum) = self.store(self.packages) if (self.meta.rsl_deps in ["on", "ON"] and "--resolve-off" not in self.flag): self.msg.done() if self.install: print("\nThe following packages will be automatically " "installed or upgraded \nwith new version:\n") if self.matching: self.msg.matching(self.packages) self.top_view() self.msg.upg_inst(self.is_upgrade) mas_sum = self.views(self.install, self.comp_sum) if self.dependencies: print("Installing for dependencies:") dep_sum = self.views(self.dep_install, self.dep_comp_sum) # sums[0] --> installed # sums[1] --> upgraded # sums[2] --> uninstall sums = [sum(i) for i in zip(mas_sum, dep_sum)] unit, size = units(self.comp_sum + self.dep_comp_sum, self.uncomp_sum + self.dep_uncomp_sum) print("\nInstalling summary") print("=" * 79) print("{0}Total {1} {2}.".format(self.meta.color["GREY"], sum(sums), self.msg.pkg(sum(sums)))) print("{0} {1} will be installed, {2} will be upgraded and " "{3} will be reinstalled.".format(sums[2], self.msg.pkg(sums[2]), sums[1], sums[0])) print("Need to get {0} {1} of archives.".format(size[0], unit[0])) print("After this process, {0} {1} of additional disk " "space will be used.{2}".format(size[1], unit[1], self.meta.color["ENDC"])) print("") self.if_all_installed() if self.msg.answer() in ["y", "Y"]: for inst, dwn in zip(self.dep_install + self.install, self.dep_dwn + self.dwn): if (self.meta.not_downgrade == "on" and self.not_downgrade(inst) is True): continue if (not os.path.isfile(self.meta.pkg_path + inst[:-4]) or "--download-only" in self.flag or "--reinstall" in self.flag): Download(self.tmp_path, dwn.split(), self.repo).start() else: self.msg.template(78) self.msg.pkg_found(inst) self.msg.template(78) if "--download-only" in self.flag: raise SystemExit() self.dep_install = Utils().check_downloaded( self.tmp_path, self.dep_install) self.install = Utils().check_downloaded( self.tmp_path, self.install) ins, upg = self.install_packages() self.msg.reference(ins, upg) write_deps(self.deps_dict) delete_package(self.tmp_path, self.dep_install + self.install) else: self.msg.not_found(self.is_upgrade) raise SystemExit(1)