Merge pull request #82 from dbalan/expose_debootstrap_include

Expose debootstrap include/exclude in manifest.
This commit is contained in:
Anders Ingemann 2014-05-08 22:14:21 +02:00
commit 2cf6e8cbbd
3 changed files with 45 additions and 1 deletions

View file

@ -11,7 +11,23 @@
"properties": {
"workspace": { "$ref": "#/definitions/path" },
"mirror": { "type": "string", "format": "uri" },
"tarball": { "type": "boolean" }
"tarball": { "type": "boolean" },
"include_packages": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[^/]+(/[^/]+)?$"
},
"minItems": 1
},
"exclude_packages": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[^/]+(/[^/]+)?$"
},
"minItems": 1
}
},
"required": ["workspace"]
},

View file

@ -44,6 +44,10 @@ def get_base_group(manifest):
]
if manifest.bootstrapper.get('tarball', False):
group.append(bootstrap.MakeTarball)
if manifest.bootstrapper.get('include_packages', False):
group.append(bootstrap.IncludePackagesInBootstrap)
if manifest.bootstrapper.get('exclude_packages', False):
group.append(bootstrap.ExcludePackagesInBootstrap)
return group

View file

@ -74,3 +74,27 @@ class Bootstrap(Task):
from ..tools import log_check_call
log_check_call(executable + options + arguments)
class IncludePackagesInBootstrap(Task):
description = 'Add packages in the bootstrap phase'
phase = phases.preparation
successors = [Bootstrap]
@classmethod
def run(cls, info):
info.include_packages.update(
set(info.manifest.bootstrapper['include_packages'])
)
class ExcludePackagesInBootstrap(Task):
description = 'Remove packages from bootstrap phase'
phase = phases.preparation
successors = [Bootstrap]
@classmethod
def run(cls, info):
info.exclude_packages.update(
set(info.manifest.bootstrapper['exclude_packages'])
)