From e190c6630d13363e72ec421e4734ae255c70fbc5 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 19 Feb 2010 12:15:16 +0100 Subject: [PATCH] Tweak last commit: Reduce the candidate list. --- gnulib-tool | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnulib-tool b/gnulib-tool index ef2bd46b71..a5c48cae74 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -5022,19 +5022,20 @@ s/\([.*$]\)/[\1]/g' do if test -f "$gnulib_dir/$filename" \ || { test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$filename"; }; then - filenameregex='^'`echo "$filename" | sed -e "$sed_literal_to_basic_regex"`'$' + filename_anywhere_regex=`echo "$filename" | sed -e "$sed_literal_to_basic_regex"` + filename_line_regex='^'"$filename_anywhere_regex"'$' module_candidates=` { - (cd "$gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filenameregex" /dev/null | sed -e 's,^modules/,,') + (cd "$gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_line_regex" /dev/null | sed -e 's,^modules/,,') if test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules"; then - (cd "$local_gnulib_dir" && find modules -type f -print | sed -e 's,^modules/,,' -e 's,\.diff$,,') + (cd "$local_gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_anywhere_regex" /dev/null | sed -e 's,^modules/,,' -e 's,\.diff$,,') fi } \ | func_sanitize_modulelist \ | LC_ALL=C sort -u ` for module in $module_candidates; do - if func_get_filelist $module | grep "$filenameregex" > /dev/null; then + if func_get_filelist $module | grep "$filename_line_regex" > /dev/null; then echo $module fi done -- 2.30.2