From d37e82fe14a76bf4e2c7713ec744f15972ee6c3e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 12 Jun 2010 02:14:06 +0200 Subject: [PATCH] Avoid grepping through monster files. --- gettext-runtime/po/ChangeLog | 6 ++++++ gettext-runtime/po/Makefile.in.in | 12 ++++++++++-- gettext-tools/po/ChangeLog | 6 ++++++ gettext-tools/po/Makefile.in.in | 12 ++++++++++-- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/gettext-runtime/po/ChangeLog b/gettext-runtime/po/ChangeLog index 557a0b21a..fcacd91da 100644 --- a/gettext-runtime/po/ChangeLog +++ b/gettext-runtime/po/ChangeLog @@ -1,3 +1,9 @@ +2010-06-12 Bruno Haible + + * Makefile.in.in ($(DOMAIN).pot-update): When GNU find is available, + avoid grepping through monster files. + Reported by Jim Meyering . + 2010-06-04 Bruno Haible * gettext-0.18.1 released. diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in index 83d8838ac..e666eaaa2 100644 --- a/gettext-runtime/po/Makefile.in.in +++ b/gettext-runtime/po/Makefile.in.in @@ -8,7 +8,7 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.18 +# Origin: gettext-0.18.2 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ @@ -137,8 +137,16 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ diff --git a/gettext-tools/po/ChangeLog b/gettext-tools/po/ChangeLog index 2667b20ce..d5c1ea924 100644 --- a/gettext-tools/po/ChangeLog +++ b/gettext-tools/po/ChangeLog @@ -1,3 +1,9 @@ +2010-06-12 Bruno Haible + + * Makefile.in.in ($(DOMAIN).pot-update): When GNU find is available, + avoid grepping through monster files. + Reported by Jim Meyering . + 2010-06-04 Bruno Haible Offer more choices in the Makevars template. diff --git a/gettext-tools/po/Makefile.in.in b/gettext-tools/po/Makefile.in.in index 83d8838ac..e666eaaa2 100644 --- a/gettext-tools/po/Makefile.in.in +++ b/gettext-tools/po/Makefile.in.in @@ -8,7 +8,7 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.18 +# Origin: gettext-0.18.2 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ @@ -137,8 +137,16 @@ stamp-po: $(srcdir)/$(DOMAIN).pot # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ -- 2.47.2