From: Jim Meyering Date: Sun, 24 Jan 2010 13:24:00 +0000 (+0100) Subject: maint.mk: do not prepend "./" after filtering X-Git-Tag: v0.1~4714 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=8fc05d032b3f9a9d068613ab5ee297b4e7d5a08a;p=gnulib.git 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 ".". --- diff --git a/ChangeLog b/ChangeLog index 373a1bb09..813ae48db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-24 Jim Meyering + 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 314abc11b..346d6813b 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