summaryrefslogtreecommitdiff
path: root/Porting/checkcfgvar.pl
diff options
context:
space:
mode:
authorH.Merijn Brand <h.m.brand@xs4all.nl>2011-07-31 11:39:37 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2011-07-31 11:39:37 +0200
commitacad74ad9dedd627acc10569a429ca3271de29c9 (patch)
tree9ef1843142c0e65ec21632631f940d5c5fb66029 /Porting/checkcfgvar.pl
parentf2e96b5ddb6396417bc2fb71915c5025215060d6 (diff)
downloadperl-acad74ad9dedd627acc10569a429ca3271de29c9.tar.gz
Add --list to checkcfgvar.pl
Diffstat (limited to 'Porting/checkcfgvar.pl')
-rwxr-xr-xPorting/checkcfgvar.pl29
1 files changed, 26 insertions, 3 deletions
diff --git a/Porting/checkcfgvar.pl b/Porting/checkcfgvar.pl
index 0ee7ddbf76..60348855e6 100755
--- a/Porting/checkcfgvar.pl
+++ b/Porting/checkcfgvar.pl
@@ -1,6 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
-#
# Check that the various config.sh-clones have (at least) all the
# same symbols as the top-level config_h.SH so that the (potentially)
# needed symbols are not lagging after how Configure thinks the world
@@ -11,10 +10,26 @@
#
use strict;
+use warnings;
+
+sub usage
+{
+ my $err = shift and select STDERR;
+ print "usage: $0 [--list]\n";
+ exit $err;
+ } # usage
+
+use Getopt::Long;
+my $opt_l = 0;
+GetOptions (
+ "help|?" => sub { usage (0); },
+ "l|list!" => \$opt_l,
+ ) or usage (1);
my $MASTER_CFG = "config_h.SH";
my %MASTER_CFG;
+my %lst;
my @CFG = (
# This list contains both 5.8.x and 5.9.x files,
# we check from MANIFEST whether they are expected to be present.
@@ -77,7 +92,13 @@ my @MASTER_CFG = sort keys %MASTER_CFG;
sub check_cfg {
my ($fn, $cfg) = @_;
for my $v (@MASTER_CFG) {
- print "$fn: missing '$v'\n" unless exists $cfg->{$v};
+ exists $cfg->{$v} and next;
+ if ($opt_l) {
+ $lst{$fn}{$v}++;
+ }
+ else {
+ print "$fn: missing '$v'\n";
+ }
}
}
@@ -115,3 +136,5 @@ for my $cfg (@CFG) {
}
check_cfg($cfg, \%cfg);
}
+
+$opt_l and print "$_\n" for sort keys %lst;