commit: c043486241afc6237f7a821cf6659650212cb64e
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sat Jan 10 03:38:10 2026 +0000
Commit: Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Sat Jan 10 03:38:10 2026 +0000
URL: https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=c0434862
mkconfig: adjust the signature of the error thrower
Presently, an anonymous subroutine is declared for throwing exceptions,
which is assigned to the $thrower variable. Adjust its signature so as
to relieve its callers of the burden of explicitly reconveying the path
of the locale file that is being processed.
See-also: cd7e2c360254c94a1fdde6a26a3d88e38dfec402
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
mkconfig | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/mkconfig b/mkconfig
index 64b9eba..6aa7638 100755
--- a/mkconfig
+++ b/mkconfig
@@ -28,13 +28,15 @@ use File::Slurper qw(read_dir read_lines read_text);
# Use column(1) to write out a nicely columnated list.
my $pipe = open_column("\037");
- my $thrower = sub ($locale, $format) {
+ my $locale;
+
+ my $thrower = sub ($format) {
my $path = catfile($prefix, '/usr/share/i18n/locales', $locale);
die sprintf "mkconfig: $format", $path;
};
for my $line (@lines) {
- my ($locale, $charmap) = split ' ', $line;
+ ($locale, my $charmap) = split ' ', $line;
# The names of the templates do not incorporate a codeset part.
# Further, as of locale-gen 3.10, the locale.gen(5) file never
@@ -48,9 +50,9 @@ use File::Slurper qw(read_dir read_lines read_text);
# Compose a commented entry which also has a trailing comment,
# indicating the language and territory in plain English.
if (! exists $attr_by->{$locale}) {
- $thrower->($locale, "Aborting because the '%s' file is
missing\n");
+ $thrower->("Aborting because the '%s' file is
missing\n");
} elsif (! $attr_by->{$locale}->%*) {
- $thrower->($locale, "Aborting because no language
attribute was found in '%s'\n");
+ $thrower->("Aborting because no language attribute was
found in '%s'\n");
} else {
my ($comment, $territory) =
$attr_by->{$locale}->@{'language', 'territory'};
if (length $territory) {