Skip to content

Commit 3d69b9d

Browse files
authored
Merge pull request #10808 from jsquyres/pr/v5.0.x/autogen-fixup-for-oac
v5.0.x: autogen.pl: fix submodule hash check
2 parents 3a587a5 + b7b11eb commit 3d69b9d

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

autogen.pl

+8-16
Original file line numberDiff line numberDiff line change
@@ -1391,12 +1391,9 @@ sub replace_config_sub_guess {
13911391
open(IN, "git submodule status|")
13921392
|| die "Can't run \"git submodule status\"";
13931393
while (<IN>) {
1394-
chomp;
1395-
$_ =~ m/^(.)(.{40}) ([^ ]+) *\(*([^\(\)]*)\)*$/;
1396-
my $status = $1;
1397-
my $local_hash = $2;
1398-
my $path = $3;
1399-
my $extra = $4;
1394+
$_ =~ m/^(.)[0-9a-f]{40}\s+(\S+)/;
1395+
my $status = $1;
1396+
my $path = $2;
14001397

14011398
print("=== Submodule: $path\n");
14021399
if (index($path, "pmix") != -1 and list_contains("pmix", @disabled_3rdparty_packages)) {
@@ -1419,19 +1416,14 @@ sub replace_config_sub_guess {
14191416
exit(1);
14201417
}
14211418

1422-
# See if the submodule is at the expected git hash
1423-
# (it may be ok if it's not -- just warn the user)
1424-
$extra =~ m/-g(.+)/;
1425-
my $remote_hash = $1;
1426-
if ($remote_hash) {
1427-
my $abbrev_local_hash = substr($local_hash, 0, length($remote_hash));
1428-
if ($remote_hash ne $abbrev_local_hash) {
1419+
# See if the commit in the submodule is not the same as the
1420+
# commit that the git submodule thinks it should be.
1421+
elsif ($status eq "+") {
14291422
print(" ==> WARNING: Submodule hash is different than upstream.
14301423
If this is not intentional, you may want to run:
14311424
\"git submodule update --init --recursive\"\n");
1432-
} else {
1433-
print(" Local hash == remote hash (good!)\n");
1434-
}
1425+
} else {
1426+
print(" Local hash is what is expected by the submodule (good!)\n");
14351427
}
14361428
}
14371429
}

0 commit comments

Comments
 (0)