bug-automake
[Top][All Lists]
Advanced

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

Re: CVS: 1 failure: tagsub.test


From: Alexandre Duret-Lutz
Subject: Re: CVS: 1 failure: tagsub.test
Date: Sat, 24 Apr 2004 12:45:29 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "Akim" == Akim Demaille <address@hidden> writes:

[...]

 Akim> I'm not sure what `unique' is supposed to be, but if I run this last
 Akim> command with a period at the end, it works:

 Akim> am/tests/testSubDir % etags 
--etags-include=/home/akim/src/am/tests/testSubDir/sub/TAGS .
 Akim> am/tests/testSubDir % less TAGS                                   
nostromo 9:38
 Akim> ^L
 Akim> /home/akim/src/am/tests/testSubDir/sub/TAGS,include

 Akim> With the period, nothing is created, and no error is
 Akim> reported (I guess this is a bug).

I've reported this upstream and am installing the following on
HEAD and branch-1-8.

2004-04-24  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/tags.am (TAGS): Pass `.' to Exuberant Ctags if
        --etags-include is used but no other files are supplied, so it
        creates the TAGS file anyway.
        Report from Akim Demaille.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.256.2.43
diff -u -p -r1.256.2.43 NEWS
--- NEWS        24 Apr 2004 09:21:26 -0000      1.256.2.43
+++ NEWS        24 Apr 2004 10:41:36 -0000
@@ -30,6 +30,9 @@ Bugs fixed in 1.8.3c:
 
   - Fix tru64 dependency tracking for libtool objects.
 
+  - Work around Exuberant ctags when creating a TAGS files in a directory
+    without files to scan but with subdirectories to include.
+
 * Bugs introduced by 1.8:
 
   - Fix an "internal error" when @LIBOBJS@ is used in a variable that is
Index: lib/am/tags.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/tags.am,v
retrieving revision 1.40
diff -u -p -r1.40 tags.am
--- lib/am/tags.am      8 Nov 2003 16:07:45 -0000       1.40
+++ lib/am/tags.am      24 Apr 2004 10:41:38 -0000
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -49,10 +49,15 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %
 ## backslash will cause bad results (automake doesn't `see' the `if').
 ## Exuberant Ctags wants --etags-include,
 ## GNU Etags             --include
-?SUBDIRS?      if (etags --etags-include --version) >/dev/null 2>&1; then \
+## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files
+## when no files are supplied, despite any --etags-include option.
+## A workaround is to pass `.' as a file.  This is what $empty_fix is for.
+?SUBDIRS?      if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 ?SUBDIRS?        include_option=--etags-include; \
+?SUBDIRS?        empty_fix=.; \
 ?SUBDIRS?      else \
 ?SUBDIRS?        include_option=--include; \
+?SUBDIRS?        empty_fix=; \
 ?SUBDIRS?      fi; \
 ?SUBDIRS?      list='$(SUBDIRS)'; for subdir in $$list; do \
 ## Do nothing if we're trying to look in `.'.
@@ -71,9 +76,11 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %
          $(AWK) '    { files[$$0] = 1; } \
               END { for (i in files) print i; }'`; \
 ## Make sure we have something to run etags on.
-       test -z "$(ETAGS_ARGS)$$tags$$unique" \
-         || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-            $$tags $$unique
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -z "$$unique" && unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
 
 
 ## ------------- ##
-- 
Alexandre Duret-Lutz





reply via email to

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