summaryrefslogtreecommitdiff
path: root/gnulib-tool
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-07 14:09:03 +0200
committerBruno Haible <bruno@clisp.org>2022-08-07 23:04:16 +0200
commit858467abd14f2f513d407dbdc5a5093dc0147096 (patch)
tree2b9c7815de834e5951dc990b735b3a9acdad6489 /gnulib-tool
parent6a795cb6b5c9f2b42058f444c61291f751c356e2 (diff)
downloadgnulib-858467abd14f2f513d407dbdc5a5093dc0147096.tar.gz
gnulib-tool: Fix option --find in combination with option --local-dir.
* gnulib-tool (func_prefixed_modules_in_dir): New function. (find): Use it, and filter the directory names away after the 'grep' pass.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-xgnulib-tool8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnulib-tool b/gnulib-tool
index e49d1bc8a8..028bcf36ad 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -7162,6 +7162,12 @@ case $mode in
s/\[/\\[/g
s/\^/\\^/g
s/\([.*$]\)/[\1]/g'
+ # func_prefixed_modules_in_dir dir
+ # outputs all module files in dir to standard output, with dir as prefix.
+ func_prefixed_modules_in_dir ()
+ {
+ (test -d "$1" && cd "$1" && find modules -type f -print | sed -e "s|^|$1/|")
+ }
for filename
do
if test -f "$gnulib_dir/$filename" \
@@ -7171,7 +7177,7 @@ s/\([.*$]\)/[\1]/g'
module_candidates=`
{
(cd "$gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_line_regex" /dev/null | sed -e 's,^modules/,,')
- func_path_foreach "$local_gnulib_path" func_modules_in_dir %dir% | xargs -n 100 grep -l "$filename_anywhere_regex" /dev/null | sed -e 's,^modules/,,' -e 's,\.diff$,,'
+ func_path_foreach "$local_gnulib_path" func_prefixed_modules_in_dir %dir% | xargs -n 100 grep -l "$filename_anywhere_regex" /dev/null | sed -e 's,^.*/modules/,,' -e 's,\.diff$,,'
} \
| func_sanitize_modulelist \
| LC_ALL=C sort -u