[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] top/maint.mk: Fix VC_LIST_EXCEPT for srcdir != builddir
From: |
Jim Meyering |
Subject: |
[PATCH 1/2] top/maint.mk: Fix VC_LIST_EXCEPT for srcdir != builddir |
Date: |
Thu, 21 Jan 2010 16:51:27 +0100 |
Here are a pair of maint.mk patches.
The first is from Jiri Denemark and makes VC_LIST-using
rules like "make syntax-check" also work when run from
a non-srcdir build.
The second tweaks things so that the pre-filter works robustly
even when $(srcdir) contains a '.'.
I'll push these as soon as I add a ChangeLog entry for Jiri's change.
>From b6c8f0c6bda9136638ad35ebdf9760a2dc2ba02e Mon Sep 17 00:00:00 2001
From: Jiri Denemark <address@hidden>
Date: Thu, 21 Jan 2010 14:23:17 +0100
Subject: [PATCH 1/2] top/maint.mk: Fix VC_LIST_EXCEPT for srcdir != builddir
Signed-off-by: Jiri Denemark <address@hidden>
---
top/maint.mk | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/top/maint.mk b/top/maint.mk
index 366d12a..bbf8a91 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -41,9 +41,11 @@ VC_LIST = $(build_aux)/vc-list-files -C $(srcdir)
VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
VC_LIST_EXCEPT = \
- $(VC_LIST) | 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)'
+ $(VC_LIST) | sed 's|^$(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)/|'
ifeq ($(origin prev_version_file), undefined)
prev_version_file = $(srcdir)/.prev-version
--
1.6.6.1.491.g5a5547
>From eb8d44d7a72131a7131c19769e8a784e2541babf Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 21 Jan 2010 16:47:34 +0100
Subject: [PATCH 2/2] maint.mk: make VC_LIST robustly handle a srcdir containing
"."
* top/maint.mk (_dot_escaped_srcdir): Define.
(VC_LIST): Use it in LHS of sed substitution.
---
ChangeLog | 6 ++++++
top/maint.mk | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a92aec0..ac333d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-21 Jim Meyering <address@hidden>
+
+ maint.mk: handle source file names containing "." robustly
+ * top/maint.mk (_dot_escaped_srcdir): Define.
+ (VC_LIST): Use it in LHS of sed substitution.
+
2010-01-20 Eric Blake <address@hidden>
warn-on-use: use instead of link-warning
diff --git a/top/maint.mk b/top/maint.mk
index bbf8a91..1ef28d3 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -40,8 +40,13 @@ VC_LIST = $(build_aux)/vc-list-files -C $(srcdir)
# matching files to ignore.
VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
+# This is to preprocess robustly the output of $(VC_LIST), so that even
+# when $(srcdir) is a pathological name like "....", the leading sed command
+# removes only the intended prefix.
+_dot_escaped_srcdir = $(subst .,\\.,$(srcdir))
+
VC_LIST_EXCEPT = \
- $(VC_LIST) | sed 's|^$(srcdir)/||' \
+ $(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)' \
--
1.6.6.1.491.g5a5547
- [PATCH 1/2] top/maint.mk: Fix VC_LIST_EXCEPT for srcdir != builddir,
Jim Meyering <=