Improve output from genVersionHeader.pl

Especially the responses in 'make --question' mode.
This commit is contained in:
Andrew Johnson
2018-10-25 14:37:50 -05:00
parent 46b5d6006e
commit ae38fb2c1c
+19 -4
View File
@@ -137,14 +137,29 @@ if (open($DST, '+<', $outfile)) {
print "== Current:\n$actual==\n" if $opt_v;
if ($actual eq $output) {
print "Keeping VCS header $outfile\n $opt_N = \"$opt_V\"\n"
close $DST;
print "Keeping VCS header $outfile\n",
" $opt_N = \"$opt_V\"\n"
unless $opt_q;
exit 0;
}
print "Updating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
unless $opt_q;
# This regexp must match the #define in $output above:
$actual =~ m/#define (\w+) ("[^"]*")\n/;
if ($opt_i) {
print "Outdated VCS header $outfile\n",
" has: $1 = $2\n",
" needs: $opt_N = \"$opt_V\"\n";
}
else {
print "Updating VCS header $outfile\n",
" from: $1 = $2\n",
" to: $opt_N = \"$opt_V\"\n"
unless $opt_q;
}
} else {
print "Creating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
print "Creating VCS header $outfile\n",
" $opt_N = \"$opt_V\"\n"
unless $opt_q;
open($DST, '>', $outfile)
or die "Can't create $outfile: $!\n";