From 5c66993c27977c1b0e31ca1e38a2cb75a5372403 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 16 Sep 2022 08:55:14 -0400 Subject: [PATCH] autogen.pl: tweak a regexp to handle more cases The output of `git submodule status` will be of the following form: ``` Xgit_hash submodule_path [(git_ref)] ``` * `X` is either a space, `+`, or `-` * `git_hash` is 40 hex digits * `submodule_path` is the path in the repo where the submodule is located * `(git_ref)` is optional, and will not be there if the submodule is missing (which the previous regexp did not handle). This commit tightens up the regexp to be a bit more robust and handle the case where the git_ref token is not present. Signed-off-by: Jeff Squyres --- autogen.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.pl b/autogen.pl index 4aa7a0f65fd..3d4e3acde94 100755 --- a/autogen.pl +++ b/autogen.pl @@ -1409,7 +1409,7 @@ sub replace_config_sub_guess { open(IN, "git submodule status|") || die "Can't run \"git submodule status\""; while () { - $_ =~ m/^(.).{40} ([^ ]+) /; + $_ =~ m/^(.)[0-9a-f]{40}\s+(\S+)/; my $status = $1; my $path = $2;