bug-gnulib
[Top][All Lists]
Advanced

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

maint.mk: suppress missing-file diagnostics [Re: errors on QNX 6.4.1


From: Jim Meyering
Subject: maint.mk: suppress missing-file diagnostics [Re: errors on QNX 6.4.1
Date: Sat, 25 Jul 2009 15:47:29 +0200

Simon Josefsson wrote:

> Bruno Haible <address@hidden> writes:
>
>>> ./.prev-version: No such file or directory
>>> sed: can't read ./cfg.mk: No such file or directory
>>> make  all-recursive
>>> ./.prev-version: No such file or directory
>>> sed: can't read ./cfg.mk: No such file or directory
>>
>> This is a bug in gnulib-tool and the maintainer-makefile module.
>
> I think it is actually only a maintainer-makefile bug, a cfg.mk file
> shouldn't be required to exist.  It would be nice to keep the hard-coded
> exceptions in gnulib-tool to a minimum, so if possible I think we should
> fix the maintainer-makefile problems rather than working around them.
>
> First, the above output are warnings, not hard errors.  So we could say
> that you should just ignore the messages.
>
> To really silence the output, the two problems above are:
>
> 1) That the file .prev-version is required.  Jim, can't this be
> optional, and the file only required when the rules that use
> .prev-version are used?
>
> 2) That cfg.mk is passed to sed without first checking that it exists.
>
> Unless there are objections to fixing these problems, I can try to come
> up with two patches for them.

Good ideas both.
I've been annoyed at least by the .prev-version one
so propose this change to avoid the diagnostics:

>From 2cf93ffe2a4a3b47c5be31b84592e4e6bfa3b590 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 25 Jul 2009 15:43:11 +0200
Subject: [PATCH] maint.mk: avoid warnings about missing files

* top/maint.mk (PREV_VERSION): Suppress stderr, to hide a
diagnostic when .prev-version does not exist.
(_cfg_mk): Define, so it can be empty when cfg.mk does not exist.
(syntax-check-rules): Use $(_cfg_mk) to avoid a diagnostic about
nonexistent cfg.mk.
Suggestions from Simon Joseffson.
---
 ChangeLog    |   10 ++++++++++
 top/maint.mk |    6 ++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 55828ed..ae2b7f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-25  Jim Meyering  <address@hidden>
+
+       maint.mk: avoid warnings about missing files
+       * top/maint.mk (PREV_VERSION): Suppress stderr, to hide a
+       diagnostic when .prev-version does not exist.
+       (_cfg_mk): Define, so it can be empty when cfg.mk does not exist.
+       (syntax-check-rules): Use $(_cfg_mk) to avoid a diagnostic about
+       nonexistent cfg.mk.
+       Suggestions from Simon Joseffson.
+
 2009-07-23  Jim Meyering  <address@hidden>

        maint.mk: invoke "make dist" with a working value of XZ_OPT
diff --git a/top/maint.mk b/top/maint.mk
index c49fea3..228b414 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -44,7 +44,7 @@ ifeq ($(origin prev_version_file), undefined)
   prev_version_file = $(srcdir)/.prev-version
 endif

-PREV_VERSION := $(shell cat $(prev_version_file))
+PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
 VERSION_REGEXP = $(subst .,\.,$(VERSION))
 PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))

@@ -70,9 +70,11 @@ export LC_ALL = C
 ## Sanity checks.  ##
 ## --------------- ##

+_cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
+
 # Collect the names of rules starting with `sc_'.
 syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
-                       $(srcdir)/$(ME) $(srcdir)/cfg.mk)
+                       $(srcdir)/$(ME) $(_cfg_mk))
 .PHONY: $(syntax-check-rules)

 local-checks-available = \
--
1.6.4.rc2.182.g24de1




reply via email to

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