bundles/basic: don't rewrite /etc/locale.gen every time

This commit is contained in:
Franzi 2021-05-23 14:53:45 +02:00
parent 56a36f8cae
commit 8dc66421c0
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -13,14 +13,20 @@ files = {
'/etc/htoprc.global': {
'source': 'htoprc',
},
'/etc/locale.gen': {
'content_type': 'mako',
'/etc/motd': {},
}
locale_needs = set()
for locale in sorted(node.metadata['locale']['installed']):
actions[f'ensure_locale_{locale}_is_enabled'] = {
'command': f"sed -i '/{locale}/s/^# *//g' /etc/locale.gen",
'unless': f"grep -e '^{locale}' /etc/locale.gen",
'triggers': {
'action:locale-gen',
},
},
'/etc/motd': {},
}
'needs': locale_needs,
}
locale_needs = {f'action:ensure_locale_{locale}_is_enabled'}
actions = {
'locale-gen': {