|
|
@ -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) |
|
|
|