Skip to content

Commit 4003360

Browse files
authored
Merge pull request #9687 from bwbarrett/bugfix/smartmatch
Remove smartmatch warnings from autogen.pl
2 parents ed12420 + 5e79c38 commit 4003360

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

autogen.pl

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ sub debug_dump {
134134

135135
##############################################################################
136136

137+
sub list_contains {
138+
my $searched_string = shift;
139+
foreach my $str (@_) {
140+
if ($searched_string eq $str) {
141+
return 1;
142+
}
143+
}
144+
return 0;
145+
}
146+
147+
##############################################################################
148+
137149
sub read_config_params {
138150
my ($filename, $dir_prefix) = @_;
139151

@@ -1589,15 +1601,16 @@ sub replace_config_sub_guess {
15891601
dnl 3rd-party package information\n";
15901602

15911603
# Extract the OMPI options to exclude them when processing PMIx and PRRTE
1592-
if ( ! ("pmix" ~~ @disabled_3rdparty_packages && "prrte" ~~ @disabled_3rdparty_packages) ) {
1604+
if ( ! (list_contains("pmix", @disabled_3rdparty_packages) &&
1605+
list_contains("prrte", @disabled_3rdparty_packages))) {
15931606
safe_system("./config/extract-3rd-party-configure.pl -p . -n \"OMPI\" -l > config/auto-generated-ompi-exclude.ini");
15941607
}
15951608

15961609
# these are fairly one-off, so we did not try to do anything
15971610
# generic. Sorry :).
15981611

15991612
verbose "=== Libevent\n";
1600-
if ("libevent" ~~ @disabled_3rdparty_packages) {
1613+
if (list_contains("libevent", @disabled_3rdparty_packages)) {
16011614
verbose "--- Libevent disabled\n";
16021615
} else {
16031616
my $libevent_directory = "libevent-" . $libevent_version;
@@ -1612,7 +1625,7 @@ sub replace_config_sub_guess {
16121625
}
16131626

16141627
verbose "=== hwloc\n";
1615-
if ("hwloc" ~~ @disabled_3rdparty_packages) {
1628+
if (list_contains("hwloc", @disabled_3rdparty_packages)) {
16161629
verbose "--- hwloc disabled\n";
16171630
} else {
16181631
my $hwloc_directory = "hwloc-" . $hwloc_version;
@@ -1623,11 +1636,11 @@ sub replace_config_sub_guess {
16231636
$m4 .= "m4_define([package_hwloc], [1])\n";
16241637
$m4 .= "m4_define([hwloc_tarball], [" . $hwloc_tarball . "])\n";
16251638
$m4 .= "m4_define([hwloc_directory], [" . $hwloc_directory . "])\n";
1626-
verbose "--- hwloc enabled\n";
1639+
verbose "--- hwloc enabled (" . $hwloc_version . ")\n";
16271640
}
16281641

16291642
verbose "=== PMIx\n";
1630-
if ("pmix" ~~ @disabled_3rdparty_packages) {
1643+
if (list_contains("pmix", @disabled_3rdparty_packages)) {
16311644
verbose "--- PMIx disabled\n";
16321645
} else {
16331646
# sanity check pmix files exist
@@ -1646,7 +1659,7 @@ sub replace_config_sub_guess {
16461659
}
16471660

16481661
verbose "=== PRRTE\n";
1649-
if ("prrte" ~~ @disabled_3rdparty_packages) {
1662+
if (list_contains("prrte", @disabled_3rdparty_packages)) {
16501663
verbose "--- PRRTE disabled\n";
16511664
} else {
16521665
# sanity check prrte files exist

0 commit comments

Comments
 (0)