コード例 #1
0
ファイル: localrepo.py プロジェクト: yunchih/local-repo
    def _install_deps(names):
        ''' Installs missing dependencies '''
        aurs, officials = [], names
        Msg.info(_('Need following packages as dependencies:'))
        if Config.get('check-deps-from-aur', True):
            aur_checks = Pacman.check_from_aur(names)
            aurs = list(filter(lambda k: aur_checks[k], aur_checks))
            officials = list(filter(lambda k: not aur_checks[k], aur_checks))
            for i in [("AUR", aurs), ("Official", officials)]:
                if i[1]:
                    Msg.info(
                        _('{0} repository: [{1}]'.format(
                            i[0], ', '.join(i[1]))))
        else:
            Msg.info(_('[{0}]'.format(', '.join(names))))

        if not Msg.ask(_('Install?')):
            if Msg.ask(_('Try without installing dependencies?')):
                return False

            Msg.info(_('Bye'))
            LocalRepo.shutdown(1)

        try:
            if aurs:
                LocalRepo.aur_add(aurs)
            Pacman.install(officials, as_deps=True)
            return True
        except LocalRepoError as e:
            LocalRepo.error(e)
コード例 #2
0
ファイル: localrepo.py プロジェクト: feuri/local-repo
	def _install_deps(names):
		''' Installs missing dependencies '''
		Msg.info(_('Need following packages as dependencies:\n[{0}]').format(', '.join(names)))

		if not Msg.ask(_('Install?')):
			if Msg.ask(_('Try without installing dependencies?')):
				return

			Msg.info(_('Bye'))
			LocalRepo.shutdown(1)

		try:
			Pacman.install(names, as_deps=True)
		except LocalRepoError as e:
			LocalRepo.error(e)
コード例 #3
0
ファイル: localrepo.py プロジェクト: managarm/local-repo
	def vcs_upgrade():
		''' Upgrades all VCS packages from the AUR '''
		Msg.process(_('Updating all VCS packages'))
		Log.log(_('Starting a VCS upgrade'))
		vcs = [pkg for pkg in LocalRepo._repo if LocalRepo._repo[pkg].is_vcs]

		if not vcs:
			Msg.info(_('No VCS packages found'))
			return

		Msg.process(_('Retrieving package info from the AUR'))
		updates, errors = Aur.packages(vcs)

		for e in errors:
			Msg.error(e)

		if not updates:
			Msg.info(_('No updates found'))
			return

		Msg.result('\n'.join(updates))

		if not Msg.ask(_('Upgrade?')):
			Msg.info(_('Bye'))
			return

		LocalRepo.add([pkg['uri'] for pkg in updates.values()], force=True)
コード例 #4
0
ファイル: localrepo.py プロジェクト: yunchih/local-repo
    def vcs_upgrade():
        ''' Upgrades all VCS packages from the AUR '''
        Msg.process(_('Updating all VCS packages'))
        Log.log(_('Starting a VCS upgrade'))
        vcs = [pkg for pkg in LocalRepo._repo if LocalRepo._repo[pkg].is_vcs]

        if not vcs:
            Msg.info(_('No VCS packages found'))
            return

        Msg.process(_('Retrieving package info from the AUR'))
        updates, errors = Aur.packages(vcs)

        for e in errors:
            Msg.error(e)

        if not updates:
            Msg.info(_('No updates found'))
            return

        Msg.result('\n'.join(updates))

        if not Msg.ask(_('Upgrade?')):
            Msg.info(_('Bye'))
            return

        LocalRepo.add([pkg['uri'] for pkg in updates.values()], force=True)
コード例 #5
0
ファイル: localrepo.py プロジェクト: managarm/local-repo
	def _uninstall_deps(names):
		''' Uninstalls previoulsy installed dependencies '''
		Msg.info(_('Installed following packages as dependencies:\n[{0}]').format(', '.join(names)))

		if Msg.ask(_('Uninstall?')):
			try:
				Pacman.uninstall(names)
			except LocalRepoError as e:
				LocalRepo.error(e)
コード例 #6
0
ファイル: localrepo.py プロジェクト: yunchih/local-repo
    def _uninstall_deps(names):
        ''' Uninstalls previoulsy installed dependencies '''
        Msg.info(
            _('Installed following packages as dependencies:\n[{0}]').format(
                ', '.join(names)))

        if Msg.ask(_('Uninstall?')):
            try:
                Pacman.uninstall(names)
            except LocalRepoError as e:
                LocalRepo.error(e)
コード例 #7
0
ファイル: localrepo.py プロジェクト: yunchih/local-repo
    def aur_upgrade():
        ''' Upgrades all packages from the AUR '''
        pkgs = [
            pkg for pkg in LocalRepo._repo
            if pkg not in Config.get('no-aur-upgrade', [])
        ]
        Msg.info(_('{0} packages found').format(len(pkgs)))
        Log.log(_('Starting an AUR upgrade'))

        if len(pkgs) is 0:
            Msg.info(_('Nothing to do'))
            return

        Msg.process(_('Retrieving package info from the AUR'))
        pkgs, errors = Aur.packages(pkgs)

        for e in errors:
            Msg.error(e)

        Msg.info(_('{0} packages found').format(len(pkgs)))
        Msg.process(_('Checking for updates'))
        updates = []

        for name, pkg in ((name, pkg) for name, pkg in pkgs.items()
                          if name in LocalRepo._repo):
            oldpkg = LocalRepo._repo[name]

            if oldpkg.has_smaller_version_than(pkg['version']):
                updates.append(pkg)
                Msg.result('{0} ({1} -> {2})'.format(name, oldpkg.version,
                                                     pkg['version']))

        if not updates:
            Msg.info(_('All packages are up to date'))
            return

        if not Msg.ask(_('Upgrade?')):
            Msg.info(_('Bye'))
            LocalRepo.shutdown(1)

        LocalRepo.add([pkg['uri'] for pkg in updates], force=True)
コード例 #8
0
ファイル: localrepo.py プロジェクト: feuri/local-repo
	def vcs_upgrade():
		''' Upgrades all VCS packages from the AUR '''
		Msg.process(_('Updating all VCS packages'))
		Log.log(_('Starting a VCS upgrade'))
		vcs = LocalRepo._repo.vcs_packages

		if not vcs:
			Msg.info(_('No VCS packages found'))
			return

		Msg.process(_('Retrieving package info from the AUR'))

		try:
			updates = Aur.packages(vcs)
		except LocalRepoError as e:
			LocalRepo.error(e)

		Msg.result('\n'.join(updates))

		if not Msg.ask(_('Upgrade?')):
			Msg.info(_('Bye'))
			return

		LocalRepo.add([pkg['uri'] for pkg in updates.values()], force=True)
コード例 #9
0
ファイル: localrepo.py プロジェクト: feuri/local-repo
	def aur_upgrade():
		''' Upgrades all packages from the AUR '''
		Msg.info(_('{0} packages found').format(LocalRepo._repo.size))
		Log.log(_('Starting an AUR upgrade'))

		if LocalRepo._repo.size is 0:
			Msg.info(_('Nothing to do'))
			return

		Msg.process(_('Retrieving package info from the AUR'))

		try:
			pkgs = Aur.packages(LocalRepo._repo.packages)
		except LocalRepoError as e:
			LocalRepo.error(e)

		Msg.info(_('{0} packages found').format(len(pkgs)))
		Msg.process(_('Checking for updates'))
		updates = []

		for name, pkg in ((name, pkg) for name, pkg in pkgs.items() if LocalRepo._repo.has(name)):
			oldpkg = LocalRepo._repo.package(name)

			if oldpkg.has_smaller_version_than(pkg['version']):
				updates.append(pkg)
				Msg.result('{0} ({1} -> {2})'.format(name, oldpkg.version, pkg['version']))

		if not updates:
			Msg.info(_('All packages are up to date'))
			return

		if not Msg.ask(_('Upgrade?')):
			Msg.info(_('Bye'))
			LocalRepo.shutdown(1)

		LocalRepo.add([pkg['uri'] for pkg in updates], force=True)
コード例 #10
0
ファイル: localrepo.py プロジェクト: managarm/local-repo
	def aur_upgrade():
		''' Upgrades all packages from the AUR '''
		pkgs = [pkg for pkg in LocalRepo._repo if pkg not in Config.get('no-aur-upgrade', [])]
		Msg.info(_('{0} packages found').format(len(pkgs)))
		Log.log(_('Starting an AUR upgrade'))

		if len(pkgs) is 0:
			Msg.info(_('Nothing to do'))
			return

		Msg.process(_('Retrieving package info from the AUR'))
		pkgs, errors = Aur.packages(pkgs)

		for e in errors:
			Msg.error(e)

		Msg.info(_('{0} packages found').format(len(pkgs)))
		Msg.process(_('Checking for updates'))
		updates = []

		for name, pkg in ((name, pkg) for name, pkg in pkgs.items() if name in LocalRepo._repo):
			oldpkg = LocalRepo._repo[name]

			if oldpkg.has_smaller_version_than(pkg['version']):
				updates.append(pkg)
				Msg.result('{0} ({1} -> {2})'.format(name, oldpkg.version, pkg['version']))

		if not updates:
			Msg.info(_('All packages are up to date'))
			return

		if not Msg.ask(_('Upgrade?')):
			Msg.info(_('Bye'))
			LocalRepo.shutdown(1)

		LocalRepo.add([pkg['uri'] for pkg in updates], force=True)