bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] maint.mk: do not prepend "./" after filtering


From: Jim Meyering
Subject: [PATCH] maint.mk: do not prepend "./" after filtering
Date: Sun, 24 Jan 2010 14:44:21 +0100

FYI,

>From 8fc05d032b3f9a9d068613ab5ee297b4e7d5a08a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 24 Jan 2010 14:24:00 +0100
Subject: [PATCH] maint.mk: do not prepend "./" after filtering

* top/maint.mk (_prepend_srcdir_prefix): New variable
(VC_LIST_EXCEPT): Use it to avoid prepending (post-filter)
"./" when $(srcdir) is ".".
---
 ChangeLog    |    5 +++++
 top/maint.mk |   13 ++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 373a1bb..813ae48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-01-24  Jim Meyering  <address@hidden>

+       maint.mk: do not prepend "./" after filtering
+       * top/maint.mk (_prepend_srcdir_prefix): New variable
+       (VC_LIST_EXCEPT): Use it to avoid prepending (post-filter)
+       "./" when $(srcdir) is ".".
+
        define STREQ(a,b) consistently, removing useless parentheses
        #define STREQ(a, b) (strcmp ((a), (b)) == 0) is over-parenthesized,
        since the only risk is that "a" or "b" contains an unparenthesized
diff --git a/top/maint.mk b/top/maint.mk
index 314abc1..346d681 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -45,12 +45,23 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
 # removes only the intended prefix.
 _dot_escaped_srcdir = $(subst .,\.,$(srcdir))

+# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
+# when $(srcdir) is not ".".
+ifeq ($(srcdir),.)
+_prepend_srcdir_prefix =
+else
+_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
+endif
+
+# In order to be able to consistently filter "."-relative names,
+# (i.e., with no $(srcdir) prefix), this definition is careful to
+# remove any $(srcdir) prefix, and to restore what it removes.
 VC_LIST_EXCEPT = \
   $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
        | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
          else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
        | grep -Ev -e '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)' \
-       | sed 's|^|$(srcdir)/|'
+       $(_prepend_srcdir_prefix)

 ifeq ($(origin prev_version_file), undefined)
   prev_version_file = $(srcdir)/.prev-version
--
1.6.6.1.557.g77031




reply via email to

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