diff options
author | Karl Williamson <khw@cpan.org> | 2015-03-13 12:20:18 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-03-19 16:18:00 -0600 |
commit | 2308ab830eeb3b85bac797c2cb240ce1f9af2710 (patch) | |
tree | 2024314524a37fdcb6910b35aa51b25d1aece2aa /regen | |
parent | fc809980424f38e78f04420842099c0978f0e40f (diff) | |
download | perl-2308ab830eeb3b85bac797c2cb240ce1f9af2710.tar.gz |
regen/mk_invlists.pl: Don't quit so easily
Like the previous commit, this script may be called before mktables.lst
exists, and we can't generate mktables.lst without this script
executing to completion. The missing file is only used to determine if
something has changed that we would need to recompile for so this script
can run faster next time it is called.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/mk_invlists.pl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index 1473b55d16..27e1e151fb 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -710,16 +710,22 @@ for my $charset (get_supported_code_pages()) { print $out_fh "\n" . get_conditional_compile_line_end(); } +my $sources_list = "lib/unicore/mktables.lst"; my @sources = ($0, "lib/Unicode/UCD.pm"); { # Depend on mktables’ own sources. It’s a shorter list of files than # those that Unicode::UCD uses. - open my $mktables_list, "lib/unicore/mktables.lst" - or die "$0 cannot open lib/unicore/mktables.lst: $!"; - while(<$mktables_list>) { - last if /===/; - chomp; - push @sources, "lib/unicore/$_" if /^[^#]/; + if (! open my $mktables_list, $sources_list) { + + # This should force a rebuild once $sources_list exists + push @sources, $sources_list; + } + else { + while(<$mktables_list>) { + last if /===/; + chomp; + push @sources, "lib/unicore/$_" if /^[^#]/; + } } } read_only_bottom_close_and_rename($out_fh, \@sources) |