bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

minor maint/test-related changes


From: Jim Meyering
Subject: minor maint/test-related changes
Date: Sat, 04 Apr 2009 19:36:43 +0200

coming soon...

>From 100d4983e77dc0c6b8efb588677ca6c9081d6e03 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 2 Apr 2009 16:44:44 +0200
Subject: [PATCH 1/3] tests: improve ChangeLog syntax check

* maint.mk (sc_changelog): Use $(VC_LIST_EXCEPT), not find.
Don't hang when there are no ChangeLog files.
(sc_require_config_h): For the file-name-filter, use grep -l
to be slightly more efficient.
(sc_require_config_h_first, _header_without_use, sc_program_name):
Likewise.
---
 maint.mk |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/maint.mk b/maint.mk
index dd780ad..ac6a2bc 100644
--- a/maint.mk
+++ b/maint.mk
@@ -193,7 +193,7 @@ sc_prohibit_have_config_h:

 # Nearly all .c files must include <config.h>.
 sc_require_config_h:
-       @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
+       @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then               
\
          grep -L '^# *include <config\.h>'                             \
                $$($(VC_LIST_EXCEPT) | grep '\.c$$')                    \
              | grep . &&                                               \
@@ -204,7 +204,7 @@ sc_require_config_h:

 # You must include <config.h> before including any other header file.
 sc_require_config_h_first:
-       @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
+       @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then       \
          fail=0;                                                       \
          for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do             \
            grep '^# *include\>' $$i | sed 1q                           \
@@ -226,7 +226,7 @@ sc_prohibit_HAVE_MBRTOWC:
 # re: a regular expression that matches IFF something provided by $h is used.
 define _header_without_use
   h_esc=`echo "$$h"|sed 's/\./\\./g'`;                                 \
-  if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then                        
\
+  if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then             \
     files=$$(grep -l '^# *include '"$$h_esc"                           \
             $$($(VC_LIST_EXCEPT) | grep '\.c$$')) &&                   \
     grep -LE "$$re" $$files | grep . &&                                        
\
@@ -332,16 +332,19 @@ sc_obsolete_symbols:

 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ

-# Each nonempty line must start with a year number, or a TAB.
+# Each nonempty ChangeLog line must start with a year number, or a TAB.
 sc_changelog:
-       @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) &&    \
+       @if $(VC_LIST_EXCEPT) | grep -l '^ChangeLog$$' >/dev/null; then \
+         grep -n '^[^12        ]'                                      \
+           $$($(VC_LIST_EXCEPT) | grep '^ChangeLog$$') &&              \
          { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2;  \
-           exit 1; } || :
+           exit 1; } || :;                                             \
+       fi

 # Ensure that each .c file containing a "main" function also
 # calls set_program_name.
 sc_program_name:
-       @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
+       @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then       \
          files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
          grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files         \
              | grep . &&                                               \
--
1.6.2.rc1.285.gc5f54


>From 7008e33441567ba87b3fb7538bd051e0bde2d155 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 2 Apr 2009 16:51:11 +0200
Subject: [PATCH 2/3] tests: tweak po_check syntax check

* maint.mk (sc_po_check): Don't let dangling lib/*.[ch] links cause
spurious "grep: lib/file.h: No such file or directory" warnings.
---
 maint.mk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/maint.mk b/maint.mk
index ac6a2bc..8b2ea6c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -566,6 +566,7 @@ sc_po_check:
            | grep -v '^src/false\.c$$' | sort > address@hidden;                
        \
          files=;                                                       \
          for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do              \
+           test -r $$file || continue;                                 \
            case $$file in                                              \
              *.?|*.??) ;;                                              \
              *) continue;;                                             \
--
1.6.2.rc1.285.gc5f54


>From 8e8b025c9000b781bee81cecd68f863d51c254a7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 4 Apr 2009 12:39:44 +0200
Subject: [PATCH 3/3] maint: clean up Makefile.am, rename remaining ChangeLog 
files

* Makefile.am (changelog_etc, syntax_check_exceptions): Define.
(EXTRA_DIST): Use.  Remove names that are now automatically
included: build-aux/git-version-gen, build-aux/vc-list-files.
* build-aux/ChangeLog-2007: Rename from */ChangeLog.
* doc/ChangeLog-2007: Likewise.
* lib/ChangeLog-2007: Likewise.
* m4/ChangeLog-2007: Likewise.
* po/ChangeLog-2007: Likewise.
---
 Makefile.am                             |   88 ++++++++++++++++++-------------
 build-aux/{ChangeLog => ChangeLog-2007} |    0
 doc/{ChangeLog => ChangeLog-2007}       |    0
 lib/{ChangeLog => ChangeLog-2007}       |    0
 m4/{ChangeLog => ChangeLog-2007}        |    0
 po/{ChangeLog => ChangeLog-2007}        |    0
 6 files changed, 51 insertions(+), 37 deletions(-)
 rename build-aux/{ChangeLog => ChangeLog-2007} (100%)
 rename doc/{ChangeLog => ChangeLog-2007} (100%)
 rename lib/{ChangeLog => ChangeLog-2007} (100%)
 rename m4/{ChangeLog => ChangeLog-2007} (100%)
 rename po/{ChangeLog => ChangeLog-2007} (100%)

diff --git a/Makefile.am b/Makefile.am
index 3964888..088cf4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 # Make coreutils.                                      -*-Makefile-*-

-# Copyright (C) 1990, 1993-2008 Free Software Foundation, Inc.
+# Copyright (C) 1990, 1993-2009 Free Software Foundation, Inc.

 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,42 +16,56 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.

 SUBDIRS = lib src doc man po tests gnulib-tests
-EXTRA_DIST = cfg.mk maint.mk \
-  .prev-version THANKS-to-translators THANKStt.in \
-  .version \
-  .vg-suppressions \
-  .x-sc_GPL_version \
-  .x-sc_file_system \
-  .x-sc_obsolete_symbols \
-  .x-sc_po_check \
-  .x-sc_program_name \
-  .x-sc_prohibit_atoi_atof \
-  .x-sc_prohibit_stat_st_blocks \
-  .x-sc_prohibit_strcmp \
-  .x-sc_require_config_h \
-  .x-sc_space_tab .x-sc_sun_os_names \
-  .x-sc_trailing_blank \
-  .x-sc_unmarked_diagnostics \
-  .x-sc_useless_cpp_parens \
-  ChangeLog-2005 \
-  ChangeLog-2006 \
-  ChangeLog-2007 \
-  ChangeLog-2008 \
-  bootstrap \
-  bootstrap.conf \
-  build-aux/cvsu \
-  build-aux/git-version-gen \
-  build-aux/vc-list-files \
-  gl/modules/getloadavg.diff \
-  m4/ChangeLog \
-  old/fileutils/ChangeLog \
-  old/fileutils/ChangeLog-1997 \
-  old/fileutils/NEWS \
-  old/sh-utils/ChangeLog \
-  old/sh-utils/ChangeLog.0 \
-  old/sh-utils/NEWS \
-  old/textutils/ChangeLog \
-  old/textutils/NEWS
+
+changelog_etc =                                \
+  ChangeLog-2005                       \
+  ChangeLog-2006                       \
+  ChangeLog-2007                       \
+  ChangeLog-2008                       \
+  build-aux/ChangeLog-2007             \
+  doc/ChangeLog-2007                   \
+  lib/ChangeLog-2007                   \
+  m4/ChangeLog-2007                    \
+  old/fileutils/ChangeLog              \
+  old/fileutils/ChangeLog-1997         \
+  old/fileutils/NEWS                   \
+  old/sh-utils/ChangeLog               \
+  old/sh-utils/ChangeLog.0             \
+  old/sh-utils/NEWS                    \
+  old/textutils/ChangeLog              \
+  old/textutils/NEWS                   \
+  po/ChangeLog-2007
+
+syntax_check_exceptions =              \
+  .x-sc_GPL_version                    \
+  .x-sc_file_system                    \
+  .x-sc_obsolete_symbols               \
+  .x-sc_po_check                       \
+  .x-sc_program_name                   \
+  .x-sc_prohibit_atoi_atof             \
+  .x-sc_prohibit_stat_st_blocks                \
+  .x-sc_prohibit_strcmp                        \
+  .x-sc_require_config_h               \
+  .x-sc_space_tab                      \
+  .x-sc_sun_os_names                   \
+  .x-sc_trailing_blank                 \
+  .x-sc_unmarked_diagnostics           \
+  .x-sc_useless_cpp_parens
+
+EXTRA_DIST =                           \
+  $(changelog_etc)                     \
+  $(syntax_check_exceptions)           \
+  .prev-version                                \
+  .version                             \
+  .vg-suppressions                     \
+  THANKS-to-translators                        \
+  THANKStt.in                          \
+  bootstrap                            \
+  bootstrap.conf                       \
+  build-aux/cvsu                       \
+  cfg.mk                               \
+  gl/modules/getloadavg.diff           \
+  maint.mk

 install-root:
        cd src && $(MAKE) $@
diff --git a/build-aux/ChangeLog b/build-aux/ChangeLog-2007
similarity index 100%
rename from build-aux/ChangeLog
rename to build-aux/ChangeLog-2007
diff --git a/doc/ChangeLog b/doc/ChangeLog-2007
similarity index 100%
rename from doc/ChangeLog
rename to doc/ChangeLog-2007
diff --git a/lib/ChangeLog b/lib/ChangeLog-2007
similarity index 100%
rename from lib/ChangeLog
rename to lib/ChangeLog-2007
diff --git a/m4/ChangeLog b/m4/ChangeLog-2007
similarity index 100%
rename from m4/ChangeLog
rename to m4/ChangeLog-2007
diff --git a/po/ChangeLog b/po/ChangeLog-2007
similarity index 100%
rename from po/ChangeLog
rename to po/ChangeLog-2007
--
1.6.2.rc1.285.gc5f54




reply via email to

[Prev in Thread] Current Thread [Next in Thread]