* lib/am/tags.am (TAGS): Use positional parameters to avoid the need to quote absolute file names. (GTAGS): Quote absolute file name. (CTAGS): Simplify, dropping unused variable `$tags'. ---
Posting this for review here. I'll apply in a few days if noone objects. Cheers, Ralf lib/am/tags.am | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/am/tags.am b/lib/am/tags.am index b3cfe6f..38c629b 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -43,7 +43,9 @@ tags: TAGS TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ +## We use the positional parameters to build the subdir list with +## absolute names, without the need to worry about white space in `pwd`. + set x; \ here=`pwd`; \ ## It is tempting to use if/endif here, but don't: the previous ## backslash will cause bad results (automake doesn't `see' the `if'). @@ -64,7 +66,7 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ ?SUBDIRS? if test "$$subdir" = .; then :; else \ ?SUBDIRS? test ! -f $$subdir/TAGS || \ ## Note that the = is mandatory for --etags-include. -?SUBDIRS? tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ +?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ ?SUBDIRS? fi; \ ?SUBDIRS? done; \ ## Make sure the list of sources is unique. @@ -75,11 +77,13 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ +## Remove the `x' we added first: + shift; \ ## Make sure we have something to run etags on. - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + "$$@" $$unique; \ fi @@ -96,7 +100,6 @@ ctags: CTAGS ## dependencies here are useless. CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ ## Make sure the list of sources is unique. list='$(SOURCES) $(HEADERS) %CONFIG% $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -106,9 +109,9 @@ CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ ## Make sure we have something to run ctags on. - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique ## --------------- ## @@ -119,7 +122,7 @@ CTAGS: %CTAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && gtags -i $(GTAGS_ARGS) "$$here" ## ---------- ## -- 1.5.3.3.g34c6d