From: Mischa POSLAWSKY Date: Wed, 15 Nov 2017 09:15:22 +0000 (+0100) Subject: tools: fix includes from relative paths for perl v5.26 X-Git-Tag: v1.11~15 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/00ffc9287b5766ce0c5ff89e1096200a1bc355be tools: fix includes from relative paths for perl v5.26 Data is assumed to be located relative to script directories. Like previous commit v1.10-62-gce551a5d55 (2018-03-05) [common: include from cwd to work around perl v5.26 security]. --- diff --git a/tools/mkdigraphlist b/tools/mkdigraphlist index 38978b6..2d1fdbd 100755 --- a/tools/mkdigraphlist +++ b/tools/mkdigraphlist @@ -9,18 +9,19 @@ use open OUT => ':utf8', ':std'; our $VERSION = '1.06'; # import and combine various digraph data -my $rfc = do 'data/digraphs-rfc.inc.pl' +push @INC, 'data'; +my $rfc = do 'digraphs-rfc.inc.pl' or die "error reading digraphs include: ", $@ // $!; -my $extra = do 'data/digraphs-shiar.inc.pl' +my $extra = do 'digraphs-shiar.inc.pl' or warn "could not include shiar proposals: ", $@ // $!; -my $vim = do 'data/digraphs-vim.inc.pl' +my $vim = do 'digraphs-vim.inc.pl' or warn "could not include vim extensions ", $@ // $!; -my $vimold = do 'data/digraphs-vim-74.inc.pl' +my $vimold = do 'digraphs-vim-74.inc.pl' or warn "could not include vim compatibility ", $@ // $!; my $di = { %{$vim // {}}, %{$rfc}, %{$extra // {}} }; # optionally get unicode character information -my $uninfo = do 'data/unicode-char.inc.pl' +my $uninfo = do 'unicode-char.inc.pl' or warn "could not include unicode details: ", $@ // $!; # output perl code of hash diff --git a/tools/mkfontinfo b/tools/mkfontinfo index b27b779..e7cd4f5 100755 --- a/tools/mkfontinfo +++ b/tools/mkfontinfo @@ -15,7 +15,11 @@ my %cover; 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(' ', @@ -31,7 +35,7 @@ my %charlist; $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}) { @@ -65,7 +69,7 @@ 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'; diff --git a/tools/mktermcol-xcolor b/tools/mktermcol-xcolor index 7f39c80..c705093 100755 --- a/tools/mktermcol-xcolor +++ b/tools/mktermcol-xcolor @@ -1,6 +1,7 @@ #!/usr/bin/env perl use 5.014; +BEGIN { push @INC, '.'; } use Shiar_Sheet::Colour 1.05; say "# automatically generated by $0";