diff --git a/cdist/conf/type/__localedef/gencode-remote b/cdist/conf/type/__localedef/gencode-remote index 17941c63..d7fd6942 100755 --- a/cdist/conf/type/__localedef/gencode-remote +++ b/cdist/conf/type/__localedef/gencode-remote @@ -84,8 +84,19 @@ in EOF ;; (absent) - localename=$(format_locale "${lang}" "$(gnu_normalize_codeset "${codeset}")" "${modifier}") - printf "localedef --delete-from-archive '%s'\n" "${localename}" + main_localename=$(format_locale "${lang}" "$(gnu_normalize_codeset "${codeset}")" "${modifier}") + + cat <<-EOF + while read -r _alias _localename + do + if test "\${_localename}" = '$(format_locale "${lang}" "${codeset}")' + then + localedef --delete-from-archive "\${_alias}" + fi + done <'${aliasfile}' + + localedef --delete-from-archive '${main_localename}' + EOF ;; esac ;; diff --git a/cdist/conf/type/__localedef/man.rst b/cdist/conf/type/__localedef/man.rst index 0ccf484a..454ce9d1 100644 --- a/cdist/conf/type/__localedef/man.rst +++ b/cdist/conf/type/__localedef/man.rst @@ -13,6 +13,11 @@ This cdist type allows you to define locales on the system using On systems that don't support definition of new locales, the type will raise an error. +**NB:** This type respects the glibc ``locale.alias`` file, +i.e. it defines alias locales or deletes aliases of a locale when it is removed. +It is not possible, however, to use alias names to define locales or only remove +certain aliases of a locale. + OPTIONAL PARAMETERS -------------------