Add option to install packages from tasksel

This commit is contained in:
Tiago Ilieve 2014-04-01 13:31:07 -03:00
parent f315915a73
commit 60dbbee731
3 changed files with 21 additions and 0 deletions

View file

@ -71,6 +71,9 @@
]
},
"minItems": 1
},
"install_standard": {
"type": "boolean"
}
},
"additionalProperties": false

View file

@ -65,6 +65,8 @@ def get_apt_set(manifest):
base.append(apt.InstallTrustedKeys)
if 'install' in manifest.packages:
base.append(packages.AddManifestPackages)
if manifest.packages.get('install_standard', False):
base.append(packages.AddTaskselStandardPackages)
return base

View file

@ -97,3 +97,19 @@ class InstallPackages(Task):
for path in absolute_package_paths:
os.remove(path)
class AddTaskselStandardPackages(Task):
description = 'Adding standard packages from tasksel'
phase = phases.package_installation
predecessors = [apt.AptUpdate]
successors = [InstallPackages]
@classmethod
def run(cls, info):
import subprocess
tasksel_packages = subprocess.check_output(['chroot', info.root,
'tasksel', '--task-packages',
'standard']).strip().split('\n')
for pkg in tasksel_packages:
info.packages.add(pkg)