]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] texi: be more aware of possible failures in recipes
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 12 Aug 2012 09:47:58 +0000 (11:47 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 12 Aug 2012 09:47:58 +0000 (11:47 +0200)
* lib/am/texibuild.mk: Here, mostly by using "cmd1 && cmd2" or
"cmd1 || exit $?; cmd2" rather than "cmd1; cmd2" in some places.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/texibuild.mk

index 48f2ea12cbaf60d6c2298831f51ab1907905714f..876c788fde789bb7123756cde67965f6c579996a 100644 (file)
@@ -66,12 +66,12 @@ define am.texi.build.info
                       -I $(@D) -I $(srcdir)/$(@D) -o $@ $<; \
        then \
          rc=0; \
-         $(if $(am__info_insrc),cd $(srcdir);) \
+         $(if $(am__info_insrc),cd $(srcdir) || exit 1;) \
        else \
          rc=$$?; \
 ## Beware that backup info files might come from a subdirectory.
          $(if $(am__info_insrc),cd $(srcdir) &&) \
-         $$restore $$backupdir/* $(@D); \
+         $$restore $$backupdir/* $(@D) || exit 1; \
        fi; \
        rm -rf $$backupdir; exit $$rc
 endef
@@ -90,12 +90,10 @@ define am.texi.build.html
                            -I $(@D) -I $(srcdir)/$(@D) \
                            -o $(@:.html=.htp) $<; \
        then \
-         rm -rf $@; \
-         mv $(@:.html=.htp) $@; \
+         rm -rf $@ && mv $(@:.html=.htp) $@; \
        else \
 ## on failure, remove the temporary directory before exiting.
-         rm -rf $(@:.html=.htp) $@; \
-         exit 1; \
+         rm -rf $(@:.html=.htp) $@; exit 1; \
        fi
 endef