mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
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:
parent
6302d5d962
commit
2982bfc629
3 changed files with 47 additions and 1 deletions
|
@ -11,7 +11,23 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"workspace": { "$ref": "#/definitions/path" },
|
"workspace": { "$ref": "#/definitions/path" },
|
||||||
"mirror": { "type": "string", "format": "uri" },
|
"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"]
|
"required": ["workspace"]
|
||||||
},
|
},
|
||||||
|
|
|
@ -44,6 +44,10 @@ def get_base_group(manifest):
|
||||||
]
|
]
|
||||||
if manifest.bootstrapper.get('tarball', False):
|
if manifest.bootstrapper.get('tarball', False):
|
||||||
group.append(bootstrap.MakeTarball)
|
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
|
return group
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,3 +74,29 @@ class Bootstrap(Task):
|
||||||
|
|
||||||
from ..tools import log_check_call
|
from ..tools import log_check_call
|
||||||
log_check_call(executable + options + arguments)
|
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'])
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue