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 | |
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.
-rw-r--r-- | charclass_invlists.h | 2 | ||||
-rw-r--r-- | regen/mk_invlists.pl | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h index f6a7c75147..c037baedf2 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -97322,5 +97322,5 @@ static const UV XPosixXDigit_invlist[] = { /* for EBCDIC POSIX-BC */ * a17a0330e57d774343a53c019f1bc69827c2676982a1bf48e0898a76710e8877 lib/unicore/extracted/DNumType.txt * c2cb810a67cc5fb4a8d236b6c1bc6dd4d89733d8603881997e8aae2c816a3db1 lib/unicore/extracted/DNumValues.txt * 746472de66b936ac885ca6d6e68058242b4e909e3260c6317f3ec719f78f76cc lib/unicore/version - * 52906c205cae4bc9e878d2bcdf8c2bbb1382356f8b4870fe3ac1949ad59b03cd regen/mk_invlists.pl + * f401ed39bfaff60a47b89ddb89df4fe517a60a523c8f4332280b4fce0048434e regen/mk_invlists.pl * ex: set ro: */ 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) |