automake-patches
[Top][All Lists]
Advanced

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

Re: .texi.html: Add a touch?


From: Alexandre Duret-Lutz
Subject: Re: .texi.html: Add a touch?
Date: Sat, 17 Jul 2004 11:47:58 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

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

 Akim> makeinfo does not update timestamps of directories:

 Akim> % ls -dltr maintain.{texi,html}              nostromo 15:12
 Akim> drwxr-xr-x    2 akim     lrde         4096 2004-05-25 14:38 
maintain.html/
 Akim> -rw-r--r--    1 akim     lrde        16132 2004-05-25 15:01 maintain.texi
 Akim> % LC_ALL=C /bin/sh /home/akim/lectures/maintain/config/missing --run 
makeinfo --html --enable-encoding --number-sections --fill-column=76  -I . \
 >> -o maintain.html maintain.texi
 Akim> % ls -dltr maintain.{texi,html}
 Akim> drwxr-xr-x    2 akim     lrde         4096 2004-05-25 14:38 
maintain.html/      
 Akim> -rw-r--r--    1 akim     lrde        16132 2004-05-25 15:01 maintain.texi

 Akim> which keeps this rule unsatisfied:

 Akim> .texi.html:
 Akim> $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
 Akim> -o $@ $<
 Akim> if test ! -d $@ && test -d $(@:.html=); then \
 Akim> mv $(@:.html=) $@; else :; fi

 Akim> This can cause bad problems when trying to install under a different
 Akim> identity:

 Akim> % sudo -u doc make install                   nostromo 15:06
 Akim> LC_ALL=C /bin/sh /home/akim/lectures/maintain/config/missing --run 
makeinfo --html --enable-encoding --number-sections --fill-column=76  -I . \
 Akim> -o maintain.html maintain.texi
 Akim> /home/akim/lectures/maintain/maintain.html/index.html: Permission denied
 Akim> make: *** [maintain.html] Erreur 1

Sorry for the delay.  I'm installing the following fix.

2004-07-17  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/texibuild.am (?GENERIC?%SOURCE_SUFFIX%.html,
        ?!GENERIC?%DEST_PREFIX%.html): Output .htp, and then rename to .html
        on success.  In case the target is a directory, this ensures its
        time stamp is updated and the no files are left over inside.
        * tests/txinfo21.test: Augment to test missing timestamp update
        reported by Akim Demaille.

Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.21
diff -u -r1.21 texibuild.am
--- lib/am/texibuild.am 15 May 2004 16:12:07 -0000      1.21
+++ lib/am/texibuild.am 17 Jul 2004 09:45:50 -0000
@@ -80,13 +80,27 @@
 
 ?GENERIC?%SOURCE_SUFFIX%.html:
 ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
-       $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) 
%MAKEINFOFLAGS% \
-?GENERIC?       -o $@ %SOURCE%
-?!GENERIC?      -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+## When --split (the default) is used, makeinfo will output a
+## directory.  However it will not update the time stamp of a
+## previously existing directory, and when the name of the nodes
+## in the manual change, it may leave unused pages.  Our fix
+## is to build under a temporary name, and replace the target on
+## success.
+       rm -rf ${@:.html=.htp}
+       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) 
%MAKEINFOFLAGS% \
+?GENERIC?       -o ${@:.html=.htp} %SOURCE%; \
+?!GENERIC?      -o ${@:.html=.htp} `test -f '%SOURCE%' || echo 
'$(srcdir)/'`%SOURCE%; \
+       then \
+         rm -rf $@; \
 ## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/
 ## instead of foo.html/).
-       if test ! -d $@ && test -d $(@:.html=); then \
-         mv $(@:.html=) $@; else :; fi
+         if test ! -d ${@:.html=.htp} && test -d $(@:.html=); then \
+           mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+       else \
+         if test ! -d ${@:.html=.htp} && test -d $(@:.html=); then \
+           rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+         exit 1; \
+       fi
 
 ## If we are using the generic rules, we need separate dependencies.
 ## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
Index: tests/txinfo21.test
===================================================================
RCS file: /cvs/automake/automake/tests/txinfo21.test,v
retrieving revision 1.2
diff -u -r1.2 txinfo21.test
--- tests/txinfo21.test 11 Nov 2003 00:07:17 -0000      1.2
+++ tests/txinfo21.test 17 Jul 2004 09:45:50 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -61,11 +61,20 @@
 
 $MAKE
 
+$sleep
 # Test production of split-per-node HTML.
 $MAKE html
 test -d main.html
 test -d sub/main.html
 test -d rec/main.html
+
+# Rebuilding main.html should cause its timestamp to be updated.
+test `ls -1td main.texi main.html | sed 1q` = main.html
+$sleep
+touch main.texi
+$MAKE html
+test `ls -1td main.texi main.html | sed 1q` = main.html
+
 $MAKE clean
 test ! -d main.html
 test ! -d sub/main.html
-- 
Alexandre Duret-Lutz





reply via email to

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