Ejemplo n.º 1
0
	def uninstall(self, pkgs, config, dep, force_yes):
		if self.ver3 == True:
			raw_input = input

		if force_yes != True:
			try:
				print("\n Packages (" + str(len(pkgs)) + ") " + " ".join(pkgs))
				choice = raw_input("\n [+] Remove these packages? [Y/n] ").lower()
			except KeyboardInterrupt:
				print("\n [-] 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:
			# REMOVE PROCESS ###################################################
			import cleaner

			u = cleaner.uninstall(config, dep, self.ver3)
			for package in pkgs:
				u.pkg(package, self.distro)

				add2installed = abdala.local(self.ver3)
				add2installed.remove(package)
Ejemplo n.º 2
0
 def tools(self):
     pkgs = abdala.local(self.ver3).listing()
     for i in pkgs:
         print(green + " [+]" + default + " Attemping to update %s" % i[0])
         if i[1] == "git":
             path = "/usr/share/%s" % i[0]
             check_call("cd %s && sudo git pull" % path, shell=True)
         else:
             ver = connect(self.ver3).dependencies(i[0], True)
             if ver == i[1]:
                 print("Already up to date")
             else:
                 atom.actions(self.ver3).uninstall(i, False, False, True)
                 atom.actions(self.ver3).install(i, True)
Ejemplo n.º 3
0
	def tools(self):
		pkgs = abdala.local(self.ver3).listing()
		for i in pkgs:
			print(green + " [+]" + default + " Attemping to update %s" % i[0])
			if i[1] == "git":
				path = "/usr/share/%s" % i[0]
				check_call("cd %s && sudo git pull" % path, shell = True)
			else:
				ver = connect(self.ver3).dependencies(i[0], True)
				if ver == i[1]:
					print("Already up to date")
				else:
					atom.actions(self.ver3).uninstall(i, False, False, True)
					atom.actions(self.ver3).install(i, True)
Ejemplo n.º 4
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.º 5
0
	def installed(self):
		itens = abdala.local(self.ver3).listing()
		
		for i in itens:
			print(i[0] + " ==> " + i[1])