示例#1
0
	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)
示例#2
0
    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)
示例#3
0
	def aur_add(names, force=False):
		''' Downloads, makes and adds packages from the AUR '''
		Msg.process(_('Retrieving package info from the AUR'))
		pkgs, errors = Aur.packages(names)

		for e in errors:
			Msg.error(e)

		for pkg in pkgs.values():
			if not force and pkg['name'] in LocalRepo._repo:
				Msg.error(_('Package is already in the repo: {0}').format(pkg['name']))
				LocalRepo.shutdown(1)

			LocalRepo.add([pkg['uri']], force=force)
示例#4
0
	def aur_add(self, names):
		''' Download, make and add packages from the AUR '''
		Msg.process(_('Retrieving package info from the AUR'))

		try:
			pkgs = Aur.packages(names)
		except Exception as e:
			Msg.error(str(e))
			return False

		for pkg in pkgs.values():
			if self.repo.has_package(pkg['name']):
				Msg.error(_('Package is already in the repo:'), pkg['name'])
				return False

			if not self.add([pkg['uri']]):
				return False

		return True
示例#5
0
    def aur_add(self, names):
        ''' Download, make and add packages from the AUR '''
        Msg.process(_('Retrieving package info from the AUR'))

        try:
            pkgs = Aur.packages(names)
        except Exception as e:
            Msg.error(str(e))
            return False

        for pkg in pkgs.values():
            if self.repo.has_package(pkg['name']):
                Msg.error(_('Package is already in the repo:'), pkg['name'])
                return False

            if not self.add([pkg['uri']]):
                return False

        return True
示例#6
0
    def aur_add(names, force=False):
        ''' Downloads, makes and adds packages from the AUR '''
        Msg.process(_('Retrieving package info from the AUR'))
        pkgs, errors = Aur.packages(names)

        for e in errors:
            Msg.error(e)

        pkgs_uri = []
        for pkg in pkgs.values():
            if not force and pkg['name'] in LocalRepo._repo:
                Msg.error(
                    _('Package is already in the repo: {0}').format(
                        pkg['name']))
            else:
                pkgs_uri.append(pkg['uri'])

        if pkgs_uri:
            LocalRepo.add(pkgs_uri, force=force)
示例#7
0
    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
	def aur_upgrade(self):
		''' Upgrades all packages from the AUR '''
		Msg.info(_('{0} packages found').format(self.repo.size))

		if self.repo.size is 0:
			Msg.info(_('Nothing to do'))
			return True

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

		try:
			pkgs = Aur.packages(self.repo.packages)
		except Exception as e:
			Msg.error(str(e))
			return False

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

		for name in (pkg for pkg in pkgs if self.repo.has_package(pkg)):
			if pkgs[name]['version'] > self.repo.package(name).version:
				updates.append(pkgs[name])

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

		for pkg in updates:
			Msg.result('{0} ({1} -> {2})'.format(pkg['name'],
			                                     self.repo.package(pkg['name']).version,
			                                     pkg['version']))

		if not Msg.yes(_('Upgrade')):
			Msg.info(_('Bye'))
			return True

		return self.add([pkg['uri'] for pkg in updates], True)
示例#9
0
    def aur_upgrade(self):
        ''' Upgrades all packages from the AUR '''
        Msg.info(_('{0} packages found').format(self.repo.size))

        if self.repo.size is 0:
            Msg.info(_('Nothing to do'))
            return True

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

        try:
            pkgs = Aur.packages(self.repo.packages)
        except Exception as e:
            Msg.error(str(e))
            return False

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

        for name in (pkg for pkg in pkgs if self.repo.has_package(pkg)):
            if pkgs[name]['version'] > self.repo.package(name).version:
                updates.append(pkgs[name])

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

        for pkg in updates:
            Msg.result('{0} ({1} -> {2})'.format(
                pkg['name'],
                self.repo.package(pkg['name']).version, pkg['version']))

        if not Msg.yes(_('Upgrade')):
            Msg.info(_('Bye'))
            return True

        return self.add([pkg['uri'] for pkg in updates], True)
示例#10
0
	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)
示例#11
0
	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)
示例#12
0
	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)