Disable locale generation when no locales selected

This commit is contained in:
Anders Ingemann 2015-12-13 12:19:17 +01:00
parent 31f7c70237
commit 9d0356f4fa
3 changed files with 7 additions and 5 deletions

View file

@ -2,6 +2,7 @@ import tasks.mounts
import tasks.shrink import tasks.shrink
import tasks.apt import tasks.apt
import tasks.dpkg import tasks.dpkg
from bootstrapvz.common.tasks import locale
def validate_manifest(data, validator, error): def validate_manifest(data, validator, error):
@ -42,6 +43,10 @@ def resolve_tasks(taskset, manifest):
if 'locales' in dpkg: if 'locales' in dpkg:
taskset.update(filter_tasks) taskset.update(filter_tasks)
taskset.add(tasks.dpkg.FilterLocales) taskset.add(tasks.dpkg.FilterLocales)
# If no locales are selected, we don't need the locale package
if len(dpkg['locales']) == 0:
taskset.discard(locale.LocaleBootstrapPackage)
taskset.discard(locale.GenerateLocale)
if dpkg.get('exclude_docs', False): if dpkg.get('exclude_docs', False):
taskset.update(filter_tasks) taskset.update(filter_tasks)
taskset.add(tasks.dpkg.ExcludeDocs) taskset.add(tasks.dpkg.ExcludeDocs)

View file

@ -1,6 +1,5 @@
from bootstrapvz.common.tasks import folder from bootstrapvz.common.tasks import folder
from bootstrapvz.common.tasks import filesystem from bootstrapvz.common.tasks import filesystem
from bootstrapvz.common.tasks import locale
from bootstrapvz.common import task_groups from bootstrapvz.common import task_groups
import tasks.commands import tasks.commands
import tasks.image import tasks.image
@ -16,12 +15,12 @@ def resolve_tasks(taskset, manifest):
taskset.update(task_groups.get_base_group(manifest)) taskset.update(task_groups.get_base_group(manifest))
taskset.update([folder.Create, taskset.update([folder.Create,
filesystem.CopyMountTable, filesystem.CopyMountTable,
locale.SetTimezone,
filesystem.RemoveMountTable, filesystem.RemoveMountTable,
folder.Delete, folder.Delete,
]) ])
taskset.update(task_groups.get_network_group(manifest)) taskset.update(task_groups.get_network_group(manifest))
taskset.update(task_groups.get_apt_group(manifest)) taskset.update(task_groups.get_apt_group(manifest))
taskset.update(task_groups.locale_group)
taskset.update(task_groups.security_group) taskset.update(task_groups.security_group)
taskset.update(task_groups.cleanup_group) taskset.update(task_groups.cleanup_group)

View file

@ -32,7 +32,5 @@ plugins:
gzip_indexes: true gzip_indexes: true
autoremove_suggests: true autoremove_suggests: true
dpkg: dpkg:
locales: locales: []
- en
- en_US
exclude_docs: true exclude_docs: true