summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2018-12-21 16:30:13 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2020-05-12 07:12:04 +0300
commit3f617b2cc378016b4eaa458151b809487af54c8a (patch)
treebf64cb4a6a3c071a12d1d2171fb0a71ccf7eecaf
parentlocale-gen: Always build the C.UTF-8 locale (which we now patch in) (diff)
downloadlocale-gen-3f617b2cc378016b4eaa458151b809487af54c8a.tar.gz
locale-gen-3f617b2cc378016b4eaa458151b809487af54c8a.tar.bz2
locale-gen-3f617b2cc378016b4eaa458151b809487af54c8a.zip
locale-gen: do not touch locale-archive when no locales requested in config
Originally 3179a4df4ea81aa9116b70e2a064f55da65d13e8, gentoo/glibc-9999-10 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rwxr-xr-xlocale-gen16
1 files changed, 14 insertions, 2 deletions
diff --git a/locale-gen b/locale-gen
index f88c677..87dd30e 100755
--- a/locale-gen
+++ b/locale-gen
@@ -72,6 +72,7 @@ JOBS_MAX=""
QUIET=0
SET_X=""
LOCALE_ARCHIVE=true
+CUTF_ADDED=""
while [[ $# -gt 0 ]] ; do
case $1 in
-k|--keep|--keep-existing) KEEP=$1;;
@@ -183,13 +184,24 @@ if [[ -z ${locales_to_generate} ]] && [[ -e ${CONFIG} ]] ; then
fi
if echo ${locales_to_generate} | grep -vq 'C.UTF-8' ; then
- locales_to_generate=$(echo "${locales_to_generate}" ; echo "C.UTF-8 UTF-8")
+ if [[ -z ${locales_to_generate} ]] ; then
+ locales_to_generate='C.UTF-8 UTF-8'
+ else
+ locales_to_generate=$(echo "${locales_to_generate}" ; echo -n 'C.UTF-8 UTF-8')
+ fi
+ CUTF_ADDED="true"
fi
fi
if [[ -z ${locales_to_generate} ]] ; then
[[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \
- ewarn "No locales found"
+ ewarn "No locales found, keeping locale archive"
+ exit 0
+fi
+
+if [[ ${locales_to_generate} == "C.UTF-8 UTF-8" ]] && [[ -n ${CUTF_ADDED} ]] ; then
+ [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \
+ ewarn "No locales found, keeping locale archive"
exit 0
fi