Expose debootstrap include/exclude in manifest.

This is useful in many cases in which the next steps of bootstrapping the image depends on the packages, for e.g to use a non-conventional repository transports like https.
This commit is contained in:
Dhananjay Balan 2014-05-04 21:50:32 +05:30 committed by Dhananjay Balan
parent 6302d5d962
commit 2982bfc629
3 changed files with 47 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,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'])
)