From: Karl Williamson Date: Sun, 20 Oct 2013 16:20:13 +0000 (-0600) Subject: mktables: Regenerate if called with different cmd line args X-Git-Tag: upstream/5.20.0~894^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0458fbc1e9212c308dd4062c84b32aa9b9e1e8f9;p=platform%2Fupstream%2Fperl.git mktables: Regenerate if called with different cmd line args mktables acts pretty much like its own Makefile. This is because the rules for regenerating are complicated and too hard to keep in sync in a Makefile with new versions of Unicode. mktables itself already has enough intelligence to automatically update the rules when it gets modified to account for new files from Unicode. However, prior to this commit, it didn't keep track of the options it was called with, thus it wouldn't necessarily run when those options changed to affect the desired outputs. --- diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 959bfa6..0781267 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -679,6 +679,11 @@ my $VERBOSE = 3; my $verbosity = $NORMAL_VERBOSITY; +# Stored in mktables.lst so that if this program is called with different +# options, will regenerate even if the files otherwise look like they're +# up-to-date. +my $command_line_arguments = join " ", @ARGV; + # Process arguments while (@ARGV) { my $arg = shift @ARGV; @@ -17810,6 +17815,7 @@ File::Find::find({ my @mktables_list_output_files; my $old_start_time = 0; +my $old_options = ""; if (! -e $file_list) { print "'$file_list' doesn't exist, so forcing rebuild.\n" if $verbosity >= $VERBOSE; @@ -17836,6 +17842,10 @@ else { $old_start_time = $1; next; } + if (/^ \s* \# \s* From\ options\ (.+) /x) { + $old_options = $1; + next; + } next if /^ \s* (?: \# .* )? $/x; last if /^ =+ $/x; my ( $file ) = split /\t/; @@ -17967,7 +17977,9 @@ foreach my $in (@input_files) { my $rebuild = $write_unchanged_files # Rebuild: if unconditional rebuild || ! scalar @mktables_list_output_files # or if no outputs known - || $old_start_time < $most_recent; # or out-of-date + || $old_start_time < $most_recent # or out-of-date + || $old_options ne $command_line_arguments; # or with different + # options # Now we check to see if any output files are older than youngest, if # they are, we need to continue on, otherwise we can presumably bail. @@ -18038,6 +18050,7 @@ if ( $file_list and $make_list ) { # $file_list -- File list for $0. # # Autogenerated starting on $start_time ($localtime) +# From options $command_line_arguments # # - First section is input files # ($0 itself is not listed but is automatically considered an input)