commit:     d9a99681c4fa8f11010087ae938752d489be2223
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Aug 22 20:42:40 2025 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Fri Aug 22 22:44:46 2025 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=d9a99681

Compose an array of canonicals before passing to generate_archive()

Construct an array of canonical locale names before passing the array as
a parameter list to the generate_archive() subroutine. Though the array
is not truly needed, this should render the code easier for the casual
observer to understand.

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

 locale-gen | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/locale-gen b/locale-gen
index 236f8fc..f7812aa 100755
--- a/locale-gen
+++ b/locale-gen
@@ -112,7 +112,10 @@ umask 0022;
        generate_locales($opt{'jobs'}, @locales);
 
        # Integrate the newly compiled locales into the system's locale archive.
-       my $size = generate_archive($prefix, $gentoo_prefix, $locale_dir, 
$opt{'update'}, map +( $_->[2] ), @locales);
+       my $size = do {
+               my @canonicals = map +( $_->[2] ), @locales;
+               generate_archive($prefix, $gentoo_prefix, $locale_dir, 
$opt{'update'}, @canonicals);
+       };
 
        my $total = scalar @locales + scalar %installed_by;
        printf "Successfully installed an archive containing %d locale%s, of %s 
MiB in size.\n",

Reply via email to