|
577 |
|
577 |
|
578 |
return pkglist |
578 |
return pkglist |
579 |
|
579 |
|
580 |
def get_installed_packages(): |
|
|
581 |
'''Returns a list of all installed packages on the system.''' |
582 |
cache = apt.Cache() |
583 |
return [ p.name for p in cache if p.is_installed ] |
584 |
|
585 |
def get_installed_components(): |
580 |
def get_installed_components(): |
586 |
'''Returns a list of components that are currently fully installed on the system.''' |
581 |
'''Returns a list of components that are currently fully installed on the system.''' |
587 |
allPackages = set(get_installed_packages()) |
582 |
# get all component packages that are installed |
588 |
allComponents = get_components() |
583 |
allComponents = get_components() |
|
|
584 |
cache = apt.Cache() |
585 |
allPackages = set([ |
586 |
ipackage |
587 |
for icomp in allComponents |
588 |
for ipackage in icomp['Packages'] |
589 |
if cache[ipackage].is_installed |
590 |
]) |
591 |
|
592 |
# return installed components |
589 |
return [ icomp for icomp in allComponents if not len(set(icomp['Packages']) - allPackages) ] |
593 |
return [ icomp for icomp in allComponents if not len(set(icomp['Packages']) - allPackages) ] |
590 |
|
594 |
|
591 |
# from univention-installer/installer/modules/70_net.py |
595 |
# from univention-installer/installer/modules/70_net.py |