summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2018-03-05 09:22:46 +0000
committerAaron Crane <arc@cpan.org>2018-03-05 09:26:57 +0000
commit8e4ae0ffc862568e59935c22e552488892eabe59 (patch)
treebd08990567311b5b793f9ab5c68223d8a1c966c4 /configpm
parentef5d49f01a20e446aa8682e02aca0c966ed57455 (diff)
downloadperl-8e4ae0ffc862568e59935c22e552488892eabe59.tar.gz
RT #132834: prevent duplicate Config.pm vars
Commit 6c2ae6421675ba5ff81dd43f9167136f02dfe9d9 introduced variables whose need was forced by configpm (for compatibility with older software), but incorrectly added those variables to the generated Config_heavy.pl even when they were already in use. The resulting duplicate variables are clearly wrong, and in addition they broke ExtUtils::InferConfig.
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm2
1 files changed, 2 insertions, 0 deletions
diff --git a/configpm b/configpm
index 2fda5a57c3..09c4a3b7a7 100755
--- a/configpm
+++ b/configpm
@@ -574,9 +574,11 @@ local *_ = \my $a;
$_ = <<'!END!';
EOT
#proper lexicographical order of the keys
+my %seen_var;
$heavy_txt .= join('',
map { $_->[-1] }
sort {$a->[0] cmp $b->[0] }
+ grep { !$seen_var{ $_->[0] }++ }
map {
/^([^=]+)/ ? [ $1, $_ ]
: [ $_, $_ ] # shouldnt happen