Browse Source

Add function for get version information about package.

develop
Mike Hiretsky 11 years ago
parent
commit
9cde04ea00
  1. 14
      pym/cl_utils.py

14
pym/cl_utils.py

@ -1018,6 +1018,20 @@ def isPkgInstalled(pkg,prefix='/'):
listDirectory(x))),
listDirectory(pkgDir,fullPath=True)))
def getPkgInstalled(pkg,prefix='/'):
"""Check is package installed"""
pkgDir = path.join(prefix,'var/db/pkg')
if "/" in pkg:
category,op,pkg = pkg.partition('/')
return filter(lambda x:x['PN'] == pkg,
map(reVerSplitToPV,
listDirectory(path.join(pkgDir,category))))
else:
return filter(lambda x: filter(lambda y:y['PN'] == pkg,
map(reVerSplitToPV,
listDirectory(x))),
listDirectory(pkgDir,fullPath=True))
def getPkgActiveUses(fullpkg):
"""Get active uses from package"""
res = getPkgUses(fullpkg)

Loading…
Cancel
Save