bug-coreutils
[Top][All Lists]
Advanced

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

Re: grep: version.c: No such file or directory


From: Jim Meyering
Subject: Re: grep: version.c: No such file or directory
Date: Sun, 12 Oct 2008 11:23:03 +0200

Andreas Schwab <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> However, it doesn't affect the exit status of that command,
>
> It does.  It will always be non-zero, thus useless.

Those checks are so old that I was tempted to remove them altogether.
In the end, I dropped one and moved two to maint.mk:

>From c3e1fe230b9858d94299ab6f106d4e37fa4a6d75 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 12 Oct 2008 11:05:00 +0200
Subject: [PATCH] tests: move check-misc targets from src/Makefile.am to maint.mk

* src/Makefile.am (check): Remove check-misc.
(check-misc): Remove target.
* maint.mk (sc_prohibit_stat_st_blocks): New target.
(sc_prohibit_S_IS_definition): New target.
* Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_stat_st_blocks.
* .x-sc_prohibit_stat_st_blocks: New file.
Andreas Schwab reported that "make check" could fail to detect
violation of the no-S_IS*-definition policy.
---
 .x-sc_prohibit_stat_st_blocks |    4 ++++
 Makefile.am                   |    1 +
 maint.mk                      |   15 +++++++++++++++
 src/Makefile.am               |   14 +-------------
 4 files changed, 21 insertions(+), 13 deletions(-)
 create mode 100644 .x-sc_prohibit_stat_st_blocks

diff --git a/.x-sc_prohibit_stat_st_blocks b/.x-sc_prohibit_stat_st_blocks
new file mode 100644
index 0000000..eb590cd
--- /dev/null
+++ b/.x-sc_prohibit_stat_st_blocks
@@ -0,0 +1,4 @@
+src/system.h
+tests/du/2g
+old/fileutils/ChangeLog-1997
+ChangeLog-2005
diff --git a/Makefile.am b/Makefile.am
index 8c99923..2bb0965 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST = cfg.mk maint.mk \
   .x-sc_obsolete_symbols \
   .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 \
diff --git a/maint.mk b/maint.mk
index 035e545..8db32d9 100644
--- a/maint.mk
+++ b/maint.mk
@@ -455,6 +455,21 @@ sc_no_exec_perl_coreutils:
              exit 1; } || :;                                           \
        fi

+# Make sure we don't use st_blocks.  Use ST_NBLOCKS instead.
+# This is a bit of a kludge, since it prevents use of the string
+# even in comments, but for now it does the job with no false positives.
+sc_prohibit_stat_st_blocks:
+       @grep -nE '[.>]st_blocks' $$($(VC_LIST_EXCEPT)) && \
+         { echo '$(ME): do not use st_blocks; use ST_NBLOCKS'          \
+               1>&2; exit 1; } || :
+
+# Make sure we don't define any S_IS* macros in src/*.c files.
+# They're already defined via gnulib's sys/stat.h replacement.
+sc_prohibit_S_IS_definition:
+       @grep -nE '^ *# *define  *S_IS' $$($(VC_LIST_EXCEPT)) &&        \
+         { echo '$(ME): do not define S_IS* macros; include <sys/stat.h>' \
+               1>&2; exit 1; } || :
+
 NEWS_hash = \
   $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
      $(srcdir)/NEWS | md5sum -)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3625878..097cc7a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -351,7 +351,7 @@ pm = progs-makefile
 pr = progs-readme
 # Ensure that the list of programs in README matches the list
 # of programs we can build.
-check: check-README check-misc check-duplicate-no-install
+check: check-README check-duplicate-no-install
 .PHONY: check-README
 check-README:
        rm -rf $(pr) $(pm)
@@ -391,18 +391,6 @@ check-AUTHORS: $(all_programs)
        sed -n '/^[^ ][^ ]*:/p' $(top_srcdir)/AUTHORS > $(au_dotdot)
        diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot)

-# Make sure we don't define any S_IS* macros in src/*.c files.
-# Not a big deal, but they're already defined via system.h.
-#
-# Also make sure we don't use st_blocks.  Use ST_NBLOCKS instead.
-# This is a bit of a kludge, since it prevents use of the string
-# even in comments, but for now it does the job with no false positives.
-.PHONY: check-misc
-check-misc:
-       cd $(srcdir); grep '^# *define  *S_IS' $(SOURCES) && exit 1 || :
-       cd $(srcdir); grep st_blocks $(SOURCES) && exit 1 || :
-       cd $(srcdir); grep '^# *define .*defined' $(SOURCES) && exit 1 || :
-
 # Extract the list of authors from each file.
 sed_filter = s/^ *//;s/N_ (//;s/^"//;s/")*$$//
 # Sometimes the string is on the same line as the #define...
--
1.6.0.2.514.g23abd3




reply via email to

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