From: Jim Meyering Date: Thu, 21 Jan 2010 15:47:34 +0000 (+0100) Subject: maint.mk: make VC_LIST_EXCEPT robustly handle a srcdir containing "." X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6da6c45;p=pspp maint.mk: make VC_LIST_EXCEPT robustly handle a srcdir containing "." * top/maint.mk (_dot_escaped_srcdir): Define. (VC_LIST_EXCEPT): Use it in LHS of preprocessing sed substitution. --- diff --git a/ChangeLog b/ChangeLog index 681b56a268..e294c72523 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-21 Jim Meyering + + 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-21 Jiri Denemark maint.mk: fix VC_LIST_EXCEPT for srcdir != builddir diff --git a/top/maint.mk b/top/maint.mk index bbf8a91975..1ef28d3919 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)' \