本文整理匯總了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)))