コード例 #1
0
ファイル: network.py プロジェクト: ninetyfivenorth/slpkg
 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
コード例 #2
0
ファイル: network.py プロジェクト: fabioalvaro/slpkg
 def build(self):
     """Only build and create Slackware package
     """
     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
コード例 #3
0
ファイル: network.py プロジェクト: fabioalvaro/slpkg
 def install(self):
     """Install SBo package found in /tmp directory.
     """
     binary = slack_package(self.prgnam)
     print("[ {0}Installing{1} ] --> {2}".format(self.green, self.endc,
                                                 self.name))
     PackageManager(binary).upgrade(flag="--install-new")
コード例 #4
0
ファイル: slackbuild.py プロジェクト: metemaddar/slpkg
 def build_install(self):
     """Build and install packages if not already installed
     """
     slackbuilds = self.dependencies + self.master_packages
     installs, upgraded, = [], []
     if not os.path.exists(self.build_folder):
         os.makedirs(self.build_folder)
     if not os.path.exists(self._SOURCES):
         os.makedirs(self._SOURCES)
     os.chdir(self.build_folder)
     for prgnam in slackbuilds:
         if (self.meta.not_downgrade == "on"
                 and self.not_downgrade(prgnam) is True):
             continue
         pkg = "-".join(prgnam.split("-")[:-1])
         installed = "".join(find_package(prgnam, self.meta.pkg_path))
         src_link = SBoGrep(pkg).source().split()
         if (installed and "--download-only" not in self.flag
                 and "--rebuild" not in self.flag):
             self.msg.template(78)
             self.msg.pkg_found(prgnam)
             self.msg.template(78)
         elif self.unst[0] in src_link or self.unst[1] in src_link:
             self.msg.template(78)
             print("| Package {0} {1}{2}{3}".format(
                 prgnam, self.meta.color["RED"], "".join(src_link),
                 self.meta.color["ENDC"]))
             self.msg.template(78)
         else:
             sbo_url = sbo_search_pkg(pkg)
             sbo_link = SBoLink(sbo_url).tar_gz()
             script = sbo_link.split("/")[-1]
             if self.meta.sbosrcarch in ["on", "ON"]:
                 src_link = self.sbosrcarsh(prgnam, sbo_link, src_link)
             Download(self.build_folder, sbo_link.split(),
                      repo="sbo").start()
             Download(self._SOURCES, src_link, repo="sbo").start()
             if "--download-only" in self.flag:
                 continue
             sources = self.filenames(src_link)
             BuildPackage(script, sources, self.build_folder,
                          auto=False).build()
             binary = slack_package(prgnam)
             if os.path.isfile("".join(binary)):
                 if GetFromInstalled(pkg).name() == pkg:
                     print("[ {0}Upgrading{1} ] --> {2}".format(
                         self.meta.color["YELLOW"], self.meta.color["ENDC"],
                         prgnam))
                     upgraded.append(prgnam)
                 else:
                     print("[ {0}Installing{1} ] --> {2}".format(
                         self.meta.color["GREEN"], self.meta.color["ENDC"],
                         prgnam))
                     installs.append(prgnam)
                 if ("--rebuild" in self.flag
                         and GetFromInstalled(pkg).name() == pkg):
                     PackageManager(binary).upgrade(flag="--reinstall")
                 else:
                     PackageManager(binary).upgrade(flag="--install-new")
     return installs, upgraded
コード例 #5
0
ファイル: slackbuild.py プロジェクト: dslackw/slpkg
 def build_install(self):
     """Build and install packages if not already installed
     """
     slackbuilds = self.dependencies + self.master_packages
     installs, upgraded, = [], []
     if not os.path.exists(self.build_folder):
         os.makedirs(self.build_folder)
     if not os.path.exists(self._SOURCES):
         os.makedirs(self._SOURCES)
     os.chdir(self.build_folder)
     for prgnam in slackbuilds:
         if (self.meta.not_downgrade == "on" and
                 self.not_downgrade(prgnam) is True):
             continue
         pkg = "-".join(prgnam.split("-")[:-1])
         installed = "".join(find_package(prgnam, self.meta.pkg_path))
         src_link = SBoGrep(pkg).source().split()
         if (installed and "--download-only" not in self.flag and
                 "--rebuild" not in self.flag):
             self.msg.template(78)
             self.msg.pkg_found(prgnam)
             self.msg.template(78)
         elif self.unst[0] in src_link or self.unst[1] in src_link:
             self.msg.template(78)
             print("| Package {0} {1}{2}{3}".format(
                 prgnam, self.meta.color["RED"], "".join(src_link),
                 self.meta.color["ENDC"]))
             self.msg.template(78)
         else:
             sbo_url = sbo_search_pkg(pkg)
             sbo_link = SBoLink(sbo_url).tar_gz()
             script = sbo_link.split("/")[-1]
             if self.meta.sbosrcarch in ["on", "ON"]:
                 src_link = self.sbosrcarsh(prgnam, sbo_link, src_link)
             Download(self.build_folder, sbo_link.split(),
                      repo="sbo").start()
             Download(self._SOURCES, src_link, repo="sbo").start()
             if "--download-only" in self.flag:
                 continue
             sources = self.filenames(src_link)
             BuildPackage(script, sources, self.build_folder,
                          auto=False).build()
             binary = slack_package(prgnam)
             if os.path.isfile("".join(binary)):
                 if GetFromInstalled(pkg).name() == pkg:
                     print("[ {0}Upgrading{1} ] --> {2}".format(
                         self.meta.color["YELLOW"],
                         self.meta.color["ENDC"], prgnam))
                     upgraded.append(prgnam)
                 else:
                     print("[ {0}Installing{1} ] --> {2}".format(
                         self.meta.color["GREEN"],
                         self.meta.color["ENDC"], prgnam))
                     installs.append(prgnam)
                 if ("--rebuild" in self.flag and
                         GetFromInstalled(pkg).name() == pkg):
                     PackageManager(binary).upgrade(flag="--reinstall")
                 else:
                     PackageManager(binary).upgrade(flag="--install-new")
     return installs, upgraded
コード例 #6
0
ファイル: network.py プロジェクト: ninetyfivenorth/slpkg
 def install(self):
     """Install SBo package found in /tmp directory.
     """
     binary = slack_package(self.prgnam)
     print("[ {0}Installing{1} ] --> {2}".format(self.green, self.endc,
                                                 self.name))
     PackageManager(binary).upgrade(flag="--install-new")
コード例 #7
0
ファイル: queue.py プロジェクト: websafe/slpkg
 def install(self):
     """Install packages from queue
     """
     packages = self.packages()
     if packages:
         print("")   # new line at start
         for pkg in packages:
             ver = SBoGrep(pkg).version()
             prgnam = "{0}-{1}".format(pkg, ver)
             if find_package(prgnam + self.meta.sp, self.meta.output):
                 binary = slack_package(prgnam)
                 PackageManager(binary).upgrade(flag="--install-new")
             else:
                 print("\nPackage {0} not found in the {1} for "
                       "installation\n".format(prgnam, self.meta.output))
     else:
         print("\nPackages not found in the queue for installation\n")
コード例 #8
0
ファイル: queue.py プロジェクト: powerlinuxer1/slpkg
 def install(self):
     """Install packages from queue
     """
     packages = self.packages()
     if packages:
         print("")   # new line at start
         for pkg in packages:
             ver = SBoGrep(pkg).version()
             prgnam = "{0}-{1}".format(pkg, ver)
             if find_package(prgnam, self.meta.output):
                 binary = slack_package(prgnam)
                 PackageManager(binary).upgrade(flag="--install-new")
             else:
                 print("\nPackage {0} not found in the {1} for "
                       "installation\n".format(prgnam, self.meta.output))
     else:
         print("\nPackages not found in the queue for installation\n")
         raise SystemExit(1)
コード例 #9
0
ファイル: slackbuild.py プロジェクト: websafe/slpkg
 def build_install(self):
     """Build and install packages if not already installed
     """
     slackbuilds = self.dependencies + self.master_packages
     installs, upgraded, = [], []
     if not os.path.exists(self.build_folder):
         os.makedirs(self.build_folder)
     os.chdir(self.build_folder)
     for prgnam in slackbuilds:
         pkg = "-".join(prgnam.split("-")[:-1])
         installed = "".join(find_package(prgnam + self.meta.sp,
                                          self.meta.pkg_path))
         src_link = SBoGrep(pkg).source().split()
         if installed:
             self.msg.template(78)
             self.msg.pkg_found(prgnam)
             self.msg.template(78)
         elif self.unst[0] in src_link or self.unst[1] in src_link:
             self.msg.template(78)
             print("| Package {0} {1}{2}{3}".format(
                 prgnam, self.meta.color["RED"], "".join(src_link),
                 self.meta.color["ENDC"]))
             self.msg.template(78)
         else:
             sbo_url = sbo_search_pkg(pkg)
             sbo_link = SBoLink(sbo_url).tar_gz()
             script = sbo_link.split("/")[-1]
             dwn_srcs = sbo_link.split() + src_link
             Download(self.build_folder, dwn_srcs, repo="sbo").start()
             sources = self.filenames(src_link)
             BuildPackage(script, sources, self.build_folder).build()
             binary = slack_package(prgnam)
             if GetFromInstalled(pkg).name() == pkg:
                 print("[ {0}Upgrading{1} ] --> {2}".format(
                     self.meta.color["YELLOW"],
                     self.meta.color["ENDC"], prgnam))
                 upgraded.append(prgnam)
             else:
                 print("[ {0}Installing{1} ] --> {2}".format(
                     self.meta.color["GREEN"],
                     self.meta.color["ENDC"], prgnam))
                 installs.append(prgnam)
             PackageManager(binary).upgrade(flag="--install-new")
     return installs, upgraded