Пример #1
0
 def continue_to_install(self):
     """Continue to install ?
     """
     if self.master_packages and self.msg.answer() in ["y", "Y"]:
         installs, upgraded = self.build_install()
         self.msg.reference(installs, upgraded)
         write_deps(self.deps_dict)
         delete(self.build_folder)
Пример #2
0
 def continue_to_install(self):
     """Continue to install ?
     """
     if (self.count_uni > 0 or self.count_upg > 0
             or "--download-only" in self.flag or "--rebuild" in self.flag):
         if self.master_packages and self.msg.answer() in ["y", "Y"]:
             installs, upgraded = self.build_install()
             if "--download-only" in self.flag:
                 raise SystemExit()
             self.msg.reference(installs, upgraded)
             write_deps(self.deps_dict)
             delete(self.build_folder)
Пример #3
0
 def continue_to_install(self):
     """Continue to install ?
     """
     if (self.count_uni > 0 or self.count_upg > 0 or
             "--download-only" in self.flag):
         if self.master_packages and self.msg.answer() in ["y", "Y"]:
             installs, upgraded = self.build_install()
             if "--download-only" in self.flag:
                 raise SystemExit()
             self.msg.reference(installs, upgraded)
             write_deps(self.deps_dict)
             delete(self.build_folder)
Пример #4
0
 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)
Пример #5
0
 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)