From: Richard Levitte Date: Thu, 18 Sep 2025 10:04:41 +0000 (+0200) Subject: Fix util/find-doc-nits' check_env_vars to look for files with 'git ls-files' X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4da42df5d332987fd01d259e5c77d57be432bd84;p=thirdparty%2Fopenssl.git Fix util/find-doc-nits' check_env_vars to look for files with 'git ls-files' If that fails, it will fall back to finding the files with Find::file. Reviewed-by: Neil Horman Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/28601) --- diff --git a/util/find-doc-nits b/util/find-doc-nits index 28573a62694..cd9e502d53a 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -1309,6 +1309,7 @@ sub check_env_vars { if $debug; push @except_dirs, "$config{sourcedir}/$_"; } + close $gs_pipe; # git call has failed, trying to parse .gitmodules manually if (!$git_ok) { print STDERR "DEBUG[check_env_vars]: .gitmodules parsing fallback\n" @@ -1336,8 +1337,19 @@ sub check_env_vars { @except_env_files = map { realpath($_) } @except_env_files; # look for source files - find(sub { push @env_files, $File::Find::name if /\.c$|\.in$/; }, - $config{sourcedir}); + $git_ok = 0; + open my $glf_pipe, '-|', "git ls-files -- \"$config{sourcedir}\""; + while (<$glf_pipe>) { + $git_ok = 1; + s/\R$//; # better chomp + push @env_files, $_ if /\.c$|\.in$/; + } + close $glf_pipe; + # git call has failed, trying to find files manually + if (!$git_ok) { + find(sub { push @env_files, $File::Find::name if /\.c$|\.in$/; }, + $config{sourcedir}); + } foreach my $filename (@env_files) { my $realfilename = realpath($filename);