def update(args=None, quite=False): from pip2pkgbuild import InstallData, Pip2Pkgbuild packages = InstallData().check_updates(quiet) from colorama import Fore, Style print() if not packages: print('there\'s nothing to do') return print('The following packages will be updated:') for package in packages: print("%s%s %s%s%s -> %s%s%s" % ( Style.BRIGHT, package, Fore.RED, packages[package]['current'], Fore.RESET, Fore.GREEN, packages[package]['next'], Fore.RESET, )) print(Style.NORMAL + 'Do you wish to continue? [Y/n] ', end='') answer = input() if answer == 'n': return Pip2Pkgbuild(packages.keys(), quiet=quiet).install_all()
def _generate(self): Pip2Pkgbuild([self.package], quiet=True).generate_all(self.dest) working_dir = os.path.join(self.dest, self.package_name) return subprocess.call(['makepkg -sf'], cwd=working_dir, shell=True, stdout=DEVNULL, stderr=subprocess.STDOUT)
def install(args, quiet=False): from pip2pkgbuild import Pip2Pkgbuild dir = args['--target-dir'] if dir is False: dir = '.' packages = args['<packages>'] Pip2Pkgbuild(packages, quiet=quiet).install_all(dir)
def test_config_file(self): InstallData.DATA_DIR = '/tmp/pipman-test/' try: os.remove('/tmp/pipman-test/data.json') except FileNotFoundError: pass data = InstallData() pack = Pip2Pkgbuild.compile_package_info(self.package) data.add_package(pack) data.save_to_file() data = InstallData() self.assertEqual(data.data, { "installedPackages": {pack['pkgname']: data._get_package_data(pack)} })