def install_repo_file(self, url): print("Installing repo file from: %s" % url) dst_path = os.path.join(self._yum_repos_path, url[url.rindex('/')+1:]) dst_path = downloadFile(url, dst_path) if not os.path.exists(dst_path): print "Error downloading file." return 1
def install_repo_file(self, url): print("Installing repo file from: %s" % url) dst_path = os.path.join(self._yum_repos_path, url[url.rindex('/') + 1:]) dst_path = downloadFile(url, dst_path) if not os.path.exists(dst_path): print "Error downloading file." return 1
def install_repo_rpm(self, url, package): print("Installing repo, via RPM, from: %s" % url) ts = rpm.TransactionSet() # trim the file name from the URL rpm_file = url[url.rindex('/')+1:] mi = ts.dbMatch('name', package) if ( mi ): if len(mi) > 1: print("Ambiguous package name: %s" % package) else: print("INSTALLED: %s" % package) else: print("Package NOT installed: %s" % package) return dst_path = downloadFile(url) if not os.path.exists(dst_path): print "Error downloading file." return 1 # fetch the file and store locally if required fd = os.open(dst_path, os.O_RDONLY) ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) try: h = ts.hdrFromFdno(fd) except rpm.error, e: print(e) os.close(fd) ts.addInstall(h, rpm_file, 'i') ts.check() ts.order() ts.run(install_repo_rpm_callback, '')
def install_repo_rpm(self, url, package): print("Installing repo, via RPM, from: %s" % url) ts = rpm.TransactionSet() # trim the file name from the URL rpm_file = url[url.rindex('/') + 1:] mi = ts.dbMatch('name', package) if (mi): if len(mi) > 1: print("Ambiguous package name: %s" % package) else: print("INSTALLED: %s" % package) else: print("Package NOT installed: %s" % package) return dst_path = downloadFile(url) if not os.path.exists(dst_path): print "Error downloading file." return 1 # fetch the file and store locally if required fd = os.open(dst_path, os.O_RDONLY) ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) try: h = ts.hdrFromFdno(fd) except rpm.error, e: print(e) os.close(fd) ts.addInstall(h, rpm_file, 'i') ts.check() ts.order() ts.run(install_repo_rpm_callback, '')