tools: fix includes from relative paths for perl v5.26
[sheet.git] / tools / mkfontinfo
index b27b779fa86766b1fc2cd7e7c0fae0351e100ec4..e7cd4f53183c6de1cc7654c92de39b4331e0d83c 100755 (executable)
@@ -15,7 +15,11 @@ my %cover;
 my $incsuffix = '.inc.pl';
 for my $fontfile (glob 'data/font/*'.$incsuffix) {
        my ($fontid) = basename($fontfile, $incsuffix);
 my $incsuffix = '.inc.pl';
 for my $fontfile (glob 'data/font/*'.$incsuffix) {
        my ($fontid) = basename($fontfile, $incsuffix);
-       my ($fontmeta, @fontrange) = do $fontfile or next;
+       my ($fontmeta, @fontrange) = do "./$fontfile";
+       if (!$fontmeta) {
+               warn "$fontfile: $!";
+               next;
+       }
        $fontmeta->{file} = $fontid;
        my $year = substr $fontmeta->{date}, 0, 4;
        $fontmeta->{description} = join(' ',
        $fontmeta->{file} = $fontid;
        my $year = substr $fontmeta->{date}, 0, 4;
        $fontmeta->{description} = join(' ',
@@ -31,7 +35,7 @@ my %charlist;
 
 $charlist{table}->{abc} = ['A'..'Z', 'a'..'z'];
 
 
 $charlist{table}->{abc} = ['A'..'Z', 'a'..'z'];
 
-my $chartables = do 'unicode-table.inc.pl' or warn $@ || $!;
+my $chartables = do './unicode-table.inc.pl' or warn $@ || $!;
 if ($chartables) {
        while (my ($tablegroup, $grouprow) = each %{$chartables}) {
                while (my ($tablename, $chars) = each %{$grouprow}) {
 if ($chartables) {
        while (my ($tablegroup, $grouprow) = each %{$chartables}) {
                while (my ($tablename, $chars) = each %{$grouprow}) {
@@ -65,7 +69,7 @@ eval {
 } or warn "Could not include count for html entities: $@";
 
 eval {
 } or warn "Could not include count for html entities: $@";
 
 eval {
-       my $agemap = do 'data/unicode-age.inc.pl'
+       my $agemap = do './data/unicode-age.inc.pl'
                or warn "Could not include unicode version data: $!";
 
        use Unicode::UCD 'charinfo';
                or warn "Could not include unicode version data: $!";
 
        use Unicode::UCD 'charinfo';