commit:     265ec148dd39af832c27a313aae594b84e384fe1
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Aug 13 09:58:16 2025 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Wed Aug 13 09:58:16 2025 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=265ec148

Don't report more workers than there are locales to be compiled

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

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

diff --git a/locale-gen b/locale-gen
index aa14728..ee96985 100755
--- a/locale-gen
+++ b/locale-gen
@@ -14,6 +14,7 @@ use File::Spec::Functions qw(canonpath catfile catdir 
splitpath);
 use File::Temp qw(tempdir);
 use Getopt::Long ();
 use JSON::PP ();
+use List::Util qw(min);
 use POSIX qw(LC_ALL setlocale);
 
 # Formally stable as of v5.40; sufficiently functional in both v5.36 and v5.38.
@@ -411,6 +412,7 @@ sub generate_locales ($workers, @locales) {
        local @SIG{'INT', 'TERM'} = ($handler, $handler);
 
        my $total = scalar @locales;
+       $workers = min($workers, $total);
        printf "Compiling %d locale definition file%s with %d worker%s ...\n",
                $total, plural($total), $workers, plural($workers);
 

Reply via email to