diff --git a/bootstrapvz/base/manifest-schema.json b/bootstrapvz/base/manifest-schema.json index 36fc166..15bb1aa 100644 --- a/bootstrapvz/base/manifest-schema.json +++ b/bootstrapvz/base/manifest-schema.json @@ -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"] }, diff --git a/bootstrapvz/common/task_groups.py b/bootstrapvz/common/task_groups.py index 1bc7303..c10c177 100644 --- a/bootstrapvz/common/task_groups.py +++ b/bootstrapvz/common/task_groups.py @@ -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 diff --git a/bootstrapvz/common/tasks/bootstrap.py b/bootstrapvz/common/tasks/bootstrap.py index 3d5e26d..cc7de40 100644 --- a/bootstrapvz/common/tasks/bootstrap.py +++ b/bootstrapvz/common/tasks/bootstrap.py @@ -74,3 +74,29 @@ 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 = \ + info.include_packages.union( + 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 = \ + info.exclude_packages.union( + set(info.manifest.bootstrapper['exclude_packages']) + )