How to use the pyalpm.sync_newversion function in pyalpm

To help you get started, we’ve selected a few pyalpm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github archlinux / pyalpm / test / test_alpm.py View on Github external
def test_sync_newversion_error():
    with pytest.raises(TypeError) as excinfo:
        pyalpm.sync_newversion()
    assert 'takes a Package and a list of DBs' in str(excinfo.value)
github archlinux / pyalpm / test / test_alpm.py View on Github external
def test_sync_newversion(syncdb, package):
    assert pyalpm.sync_newversion(package, [syncdb]) is None
github Antergos / Cnchi / src / pacman / original / transaction.py View on Github external
def get_updates():
	"""Return a list of package objects in local db which can be updated"""
	global do_syncfirst
	global list_first
	if config.syncfirst:
		for name in config.syncfirst:
			pkg = config.handle.get_localdb().get_pkg(name)
			candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
			if candidate:
				list_first.append(candidate)
		if list_first:
			do_syncfirst = True
			return list_first
	result = []
	installed_pkglist = config.handle.get_localdb().pkgcache
	for pkg in installed_pkglist:
		candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
		if candidate:
			result.append(candidate)
	return result
github Antergos / Cnchi / src / pacman / original / transaction.py View on Github external
"""Return a list of package objects in local db which can be updated"""
	global do_syncfirst
	global list_first
	if config.syncfirst:
		for name in config.syncfirst:
			pkg = config.handle.get_localdb().get_pkg(name)
			candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
			if candidate:
				list_first.append(candidate)
		if list_first:
			do_syncfirst = True
			return list_first
	result = []
	installed_pkglist = config.handle.get_localdb().pkgcache
	for pkg in installed_pkglist:
		candidate = pyalpm.sync_newversion(pkg, config.handle.get_syncdbs())
		if candidate:
			result.append(candidate)
	return result
github archlinux / pyalpm / pycman / action_query.py View on Github external
def filter_pkglist(pkglist, options):
	result = []
	if options.foreign:
		syncpkgs = set()
		for db in handle.get_syncdbs():
			syncpkgs |= set(p.name for p in db.pkgcache)
	for pkg in pkglist:
		if options.deps and pkg.reason == pyalpm.PKG_REASON_EXPLICIT:
			continue
		if options.explicit and pkg.reason == pyalpm.PKG_REASON_DEPEND:
			continue
		if options.unrequired and len(pkg.compute_requiredby()) > 0:
			continue
		if options.foreign and pkg.name in syncpkgs:
			continue
		if options.upgrades and pyalpm.sync_newversion(pkg, handle.get_syncdbs()) is None:
			continue
		result.append(pkg)
	return result