Subject: | mklocale fails because it creates Locale direcory without executable bit |
I tried to run mklocale and it failed for me:
$ perl mklocale
Unicode::Collate, locale: Locale/zh_pin.pl can't be made at mklocale line 523.
It's because the "mkdir $target, 0666;" creates the directory without executable bit on POSIX platforms, thus even the user cannot descent into the directory and create files there. $! returns "Permission denied".
Attach patch fixes it as well as it adds the $! into error messages for better diagnostics.
Subject: | Unicode-Collate-1.12-Create-Locale-directory-with-default-mask.patch |
From 444b828e15fd7e507c283120e6bd88a264ae5b91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 2 Jul 2015 16:06:11 +0200
Subject: [PATCH] Create Locale directory with default mask
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
mklocale | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mklocale b/mklocale
index fc3f269..53b8a1c 100644
--- a/mklocale
+++ b/mklocale
@@ -511,7 +511,7 @@ my @txts = grep /^[a-zA-Z]/, readdir DIR;
closedir DIR;
my $target = 'Locale';
-mkdir $target, 0666;
+mkdir $target;
for my $txt (@txts) {
my %locale_keys;
my $txtfile = File::Spec->catfile($source, $txt);
@@ -519,8 +519,8 @@ for my $txt (@txts) {
$pl =~ s/\.txt\z/.pl/ or croak "$PACKAGE: $source/$txt is not .txt";
my $plfile = File::Spec->catfile($target, $pl);
- open my $fh, $txtfile or croak "$PACKAGE: $source/$txt is not found";
- open my $ph, ">$plfile" or croak "$PACKAGE: $target/$pl can't be made";
+ open my $fh, $txtfile or croak "$PACKAGE: $source/$txt is not found: $!";
+ open my $ph, ">$plfile" or croak "$PACKAGE: $target/$pl can't be made: $!";
binmode $ph;
my $ptxt = '';
--
2.4.3