Skip to content

Commit 78b565d

Browse files
authored
Merge pull request #9709 from jsquyres/pr/v5.0.x/die-smartmatch-die-die-die
v5.0.x: Remove smartmatch warnings from autogen.pl
2 parents 8b7a413 + 9addf00 commit 78b565d

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

@@ -1571,15 +1583,16 @@ sub replace_config_sub_guess {
15711583
dnl 3rd-party package information\n";
15721584

15731585
# Extract the OMPI options to exclude them when processing PMIx and PRRTE
1574-
if ( ! ("pmix" ~~ @disabled_3rdparty_packages && "prrte" ~~ @disabled_3rdparty_packages) ) {
1586+
if ( ! (list_contains("pmix", @disabled_3rdparty_packages) &&
1587+
list_contains("prrte", @disabled_3rdparty_packages))) {
15751588
safe_system("./config/extract-3rd-party-configure.pl -p . -n \"OMPI\" -l > config/auto-generated-ompi-exclude.ini");
15761589
}
15771590

15781591
# these are fairly one-off, so we did not try to do anything
15791592
# generic. Sorry :).
15801593

15811594
verbose "=== Libevent\n";
1582-
if ("libevent" ~~ @disabled_3rdparty_packages) {
1595+
if (list_contains("libevent", @disabled_3rdparty_packages)) {
15831596
verbose "--- Libevent disabled\n";
15841597
} else {
15851598
my $libevent_directory = "libevent-" . $libevent_version;
@@ -1594,7 +1607,7 @@ sub replace_config_sub_guess {
15941607
}
15951608

15961609
verbose "=== hwloc\n";
1597-
if ("hwloc" ~~ @disabled_3rdparty_packages) {
1610+
if (list_contains("hwloc", @disabled_3rdparty_packages)) {
15981611
verbose "--- hwloc disabled\n";
15991612
} else {
16001613
my $hwloc_directory = "hwloc-" . $hwloc_version;
@@ -1605,11 +1618,11 @@ sub replace_config_sub_guess {
16051618
$m4 .= "m4_define([package_hwloc], [1])\n";
16061619
$m4 .= "m4_define([hwloc_tarball], [" . $hwloc_tarball . "])\n";
16071620
$m4 .= "m4_define([hwloc_directory], [" . $hwloc_directory . "])\n";
1608-
verbose "--- hwloc enabled\n";
1621+
verbose "--- hwloc enabled (" . $hwloc_version . ")\n";
16091622
}
16101623

16111624
verbose "=== PMIx\n";
1612-
if ("pmix" ~~ @disabled_3rdparty_packages) {
1625+
if (list_contains("pmix", @disabled_3rdparty_packages)) {
16131626
verbose "--- PMIx disabled\n";
16141627
} else {
16151628
# sanity check pmix files exist
@@ -1628,7 +1641,7 @@ sub replace_config_sub_guess {
16281641
}
16291642

16301643
verbose "=== PRRTE\n";
1631-
if ("prrte" ~~ @disabled_3rdparty_packages) {
1644+
if (list_contains("prrte", @disabled_3rdparty_packages)) {
16321645
verbose "--- PRRTE disabled\n";
16331646
} else {
16341647
# sanity check prrte files exist

0 commit comments

Comments
 (0)