Ejemplo n.º 1
0
	def install(self, pkgs, force_yes):
		#PYTHON 2 AND 3 SUPPORT
		if self.ver3 == True:
			raw_input = input

		if force_yes != True:
			# RESUME ACTIONS TO BE DONE
			try:
				print("\n Packages (" + str(len(pkgs)) + ") " + " ".join(pkgs))
				choice = raw_input("\n %s[+]%s Continue the installation? [Y/n] " % \
				(green, default)).lower()
			except KeyboardInterrupt:
				print(" [-] Aborted")
				exit()
		else:
			choice = "y"

		# CHECK IF USER WANT TO CONTINUE
		if choice != "y" and len(choice) != 0:
			print(" [-] Aborted")
			exit()
		elif choice == "y" or len(choice) == 0:
			for package in pkgs:
				# CHECK IF ALREADY INSTALLED
				if package in listdir("/usr/bin"):
					print(" [!] %s already installed" % package)
				elif package in listdir("/usr/local/bin"):
					print(" [!] %s already installed" % package)
				else:
					#call module responsable to download package
					down = retrieve.download(package, self.distro, self.arch, self.ver3)
					#define server to be used
					down.get_mirror()
					#download source em pkgconfig
					server_pkgname = down.pkgconfig()
					install = retrieve.install(package, self.ver3)
					s = install.read()
					down.source(s[0])
					install.install_deps(self.distro, force_yes)
					install.make(server_pkgname, s[1])
					install.symlink()

					add2installed = abdala.local(self.ver3)
					itens = add2installed.listing()
					add2installed.add(package, s[2], itens)
Ejemplo n.º 2
0
	def sync_db(self):
		sync = retrieve.download(None, self.distro, self.arch, self.ver3)
		sync.get_mirror()
		sync.sync()