commit:     05bbf16bcf7c9cc690324182f411d98dddbae7c6
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 27 15:37:43 2020 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Mon Jul 27 15:37:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=05bbf16b

Fix error message if no locales are to be added

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 locale-gen | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/locale-gen b/locale-gen
index 93616b3..f0dc40e 100755
--- a/locale-gen
+++ b/locale-gen
@@ -376,12 +376,13 @@ ret=$(( 0 ${JOB_RETS[@]/#/+} ))
 einfo "Generation complete"
 
 if ${LOCALE_ARCHIVE} && [[ -z ${JUST_LIST} ]] ; then
-       if true ; then  # need to check that at least one locale has to be added
+       # need to check that at least one locale has to be added
+       if [[ $(echo "${LOCALEDIR}"/*/) != "${LOCALEDIR}"'/*/' ]] ; then
                ebegin "Adding locales to archive"
                # The pattern ends with / on purpose: we don't care about files 
(like
                # locale-archive) in the locale subdir, and we definitely don't 
want to
                # delete them!
-               for LOC in "${LOCALEDIR}"/*/; do 
+               for LOC in "${LOCALEDIR}"/*/; do
                        LOC=${LOC%/} # Strip trailing /, since localedef 
doesn't like it
                        x=$(
                                # In most cases, localedef can just use the 
system glibc.
@@ -415,6 +416,8 @@ if ${LOCALE_ARCHIVE} && [[ -z ${JUST_LIST} ]] ; then
                        )
                done
                eend $ret
+       else
+               einfo "No locales are to be added to the archive."
        fi
 fi
 

Reply via email to