本文整理汇总了Python中apt.cache.Cache.get_providing_packages方法的典型用法代码示例。如果您正苦于以下问题:Python Cache.get_providing_packages方法的具体用法?Python Cache.get_providing_packages怎么用?Python Cache.get_providing_packages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apt.cache.Cache
的用法示例。
在下文中一共展示了Cache.get_providing_packages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _test
# 需要导入模块: from apt.cache import Cache [as 别名]
# 或者: from apt.cache.Cache import get_providing_packages [as 别名]
def _test():
"""Test function"""
from apt.cache import Cache
from apt.progress import DpkgInstallProgress
cache = Cache()
vp = "www-browser"
#print "%s virtual: %s" % (vp, cache.isVirtualPackage(vp))
providers = cache.get_providing_packages(vp)
print "Providers for %s :" % vp
for pkg in providers:
print " %s" % pkg.name
d = DebPackage(sys.argv[1], cache)
print "Deb: %s" % d.pkgname
if not d.check():
print "can't be satified"
print d._failure_string
print "missing deps: %s" % d.missing_deps
print d.required_changes
print "Installing ..."
ret = d.install(DpkgInstallProgress())
print ret
#s = DscSrcPackage(cache, "../tests/3ddesktop_0.2.9-6.dsc")
#s.check_dep()
#print "Missing deps: ",s.missingDeps
#print "Print required changes: ", s.requiredChanges
s = DscSrcPackage(cache=cache)
d = "libc6 (>= 2.3.2), libaio (>= 0.3.96) | libaio1 (>= 0.3.96)"
print s._satisfy_depends(apt_pkg.parse_depends(d))
示例2: _test
# 需要导入模块: from apt.cache import Cache [as 别名]
# 或者: from apt.cache.Cache import get_providing_packages [as 别名]
def _test():
# type: () -> None
"""Test function"""
from apt.cache import Cache
from apt.progress.base import InstallProgress
cache = Cache()
vp = "www-browser"
print("%s virtual: %s" % (vp, cache.is_virtual_package(vp)))
providers = cache.get_providing_packages(vp)
print("Providers for %s :" % vp)
for pkg in providers:
print(" %s" % pkg.name)
d = DebPackage(sys.argv[1], cache)
print("Deb: %s" % d.pkgname)
if not d.check():
print("can't be satified")
print(d._failure_string)
print("missing deps: %s" % d.missing_deps)
print(d.required_changes)
print(d.filelist)
print("Installing ...")
ret = d.install(InstallProgress())
print(ret)
#s = DscSrcPackage(cache, "../tests/3ddesktop_0.2.9-6.dsc")
#s.check_dep()
#print "Missing deps: ",s.missingDeps
#print "Print required changes: ", s.requiredChanges
s = DscSrcPackage(cache=cache)
ds = "libc6 (>= 2.3.2), libaio (>= 0.3.96) | libaio1 (>= 0.3.96)"
print(s._satisfy_depends(apt_pkg.parse_depends(ds, False)))