Skip to content

Commit

Permalink
mktables more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Nov 20, 2023
1 parent 1fa2768 commit b290e62
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/unicore/Makefile
@@ -1,5 +1,5 @@
all:
../../miniperl -I../../lib ./mktables -P ../../pod -maketest -makelist -p
../../miniperl -I../../lib ./mktables -P ../../pod -maketest -makelist -v

clean:
rm -fr *.pl *.pm To lib
Expand Down
25 changes: 19 additions & 6 deletions lib/unicore/mktables
Expand Up @@ -35,7 +35,7 @@ use feature 'state';
use feature 'signatures';
no warnings qw( experimental::builtin );

sub DEBUG () { 0 } # Set to 0 for production; 1 for development
sub DEBUG () { 1 } # Set to 0 for production; 1 for development
$| = 1 if DEBUG;
my $debugging_build = $Config{"ccflags"} =~ /-DDEBUGGING/;

Expand Down Expand Up @@ -811,6 +811,7 @@ usage: $0 [-c|-p|-q|-v|-w] [-C dir] [-L filelist] [ -P pod_dir ]
END
}
}
$verbosity = $VERBOSE;

# Stores the most-recently changed file. If none have changed, can skip the
# build
Expand Down Expand Up @@ -19981,12 +19982,19 @@ if ( $verbosity >= $VERBOSE ) {
"Checking ".scalar( @mktables_list_output_files )." output files.\n";
}

local $to_trace = 1 if main::DEBUG;
# We set $most_recent to be the most recently changed input file, including
# this program itself (done much earlier in this file)
foreach my $in (@input_files) {
next unless -e $in; # Keep going even if missing a file
my $mod_time = (stat $in)[9];
$most_recent = $mod_time if $mod_time > $most_recent;
if ($mod_time > $most_recent) {
print "$in (", scalar localtime($mod_time),
"is more recent than",
scalar localtime($most_recent),
"\n" if $verbosity >= $VERBOSE;
$most_recent = $mod_time;
}

# See that the input files have distinct names, to warn someone if they
# are adding a new one
Expand All @@ -20005,8 +20013,14 @@ 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_options ne $command_line_arguments; # or with different
#|| $old_options ne $command_line_arguments; # or with different
;
# options
trace $write_unchanged_files,
"delta (positive means rebuild) =", $most_recent - $old_start_time,
scalar localtime($most_recent), scalar localtime($old_start_time),
scalar @mktables_list_output_files, $rebuild;
local $to_trace = 0 if main::DEBUG;

# 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.
Expand All @@ -20017,10 +20031,9 @@ if (! $rebuild) {
$rebuild = 1;
last;
}
#local $to_trace = 1 if main::DEBUG;
trace $most_recent, (stat $out)[9] if main::DEBUG && $to_trace;
local $to_trace = 1 if main::DEBUG;
if ( (stat $out)[9] <= $most_recent ) {
#trace "$out: most recent mod time: ", (stat $out)[9], ", youngest: $most_recent\n" if main::DEBUG && $to_trace;
trace "$out: most recent mod time: ", (stat $out)[9], ", youngest: $most_recent\n" if main::DEBUG && $to_trace;
print "'$out' is too old.\n" if $verbosity >= $VERBOSE;
$rebuild = 1;
last;
Expand Down

0 comments on commit b290e62

Please sign in to comment.