automake-patches
[Top][All Lists]
Advanced

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

Multiple 'make uninstall' should not fail even for TEXINFOS.


From: Ralf Wildenhues
Subject: Multiple 'make uninstall' should not fail even for TEXINFOS.
Date: Mon, 3 Nov 2008 05:52:27 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello help-texinfo readers,

I'm considering putting this into Automake.  It would let the uninstall
rules generated by automake be idempotent, which seems sensible to me.
Any reasons against doing so?

Thanks!
Ralf

    Multiple 'make uninstall' should not fail even for TEXINFOS.
    
    * lib/am/texinfos.am (uninstall-info-am): Do not fail due to
    install-info if the installed file does not exist (any more).
    * tests/txinfo26.test: Issue multiple `make uninstall'.
    * tests/instmany-mans.test: Likewise.
    * tests/instmany-python.test: Likewise.
    * tests/instmany.test: Likewise.
    * tests/txinfo26.test: Likewise.
    * NEWS: Update.

diff --git a/NEWS b/NEWS
index cc7c41f..48f8b71 100644
--- a/NEWS
+++ b/NEWS
@@ -75,7 +75,8 @@ New in 1.10a:
     installation directory now, when no build-local scripts are used.
 
     For built-in rules, `make install' now fails reliably if installation
-    of a file failed.
+    of a file failed.  Conversely, `make uninstall' even succeeds when
+    issued multiple times.
 
     These changes may need some adjustments from users:  For example,
     some `install' programs refuse to install multiple copies of the
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 9cfc645..382a7c8 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -306,8 +306,11 @@ uninstall-info-am:
            relfile=`echo "$$file" | sed 's|^.*/||'`; \
 ## install-info needs the actual info file.  We use the installed one,
 ## rather than relying on one still being in srcdir or builddir.
+## However, `make uninstall && make uninstall' should not fail,
+## so we ignore failure if the file did not exist.
            echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove 
'$(DESTDIR)$(infodir)/$$relfile'"; \
-           install-info --info-dir="$(DESTDIR)$(infodir)" --remove 
"$(DESTDIR)$(infodir)/$$relfile"; \
+           if install-info --info-dir="$(DESTDIR)$(infodir)" --remove 
"$(DESTDIR)$(infodir)/$$relfile"; \
+           then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; 
fi; \
          done; \
        else :; fi
        @$(NORMAL_UNINSTALL)
diff --git a/tests/instmany-mans.test b/tests/instmany-mans.test
index 3f331a6..773fa76 100755
--- a/tests/instmany-mans.test
+++ b/tests/instmany-mans.test
@@ -117,6 +117,8 @@ cd build
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+# Multiple uninstall should work, too.
+$MAKE uninstall
 $MAKE uninstall
 test `find "$instdir" -type f -print | wc -l` = 0
 
diff --git a/tests/instmany-python.test b/tests/instmany-python.test
index beace0c..9f65237 100755
--- a/tests/instmany-python.test
+++ b/tests/instmany-python.test
@@ -106,6 +106,8 @@ cd build
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+# Multiple uninstall should work, too.
+$MAKE uninstall
 $MAKE uninstall
 test `find "$instdir" -type f -print | wc -l` = 0
 
diff --git a/tests/instmany.test b/tests/instmany.test
index f67e6fa..31176d7 100755
--- a/tests/instmany.test
+++ b/tests/instmany.test
@@ -132,6 +132,8 @@ cd build
 $MAKE
 # Try whether native install (or install-sh) works.
 $MAKE install
+# Multiple uninstall should work, too.
+$MAKE uninstall
 $MAKE uninstall
 test `find "$instdir" -type f -print | wc -l` = 0
 
diff --git a/tests/txinfo26.test b/tests/txinfo26.test
index 52a7f78..87b4ba6 100755
--- a/tests/txinfo26.test
+++ b/tests/txinfo26.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2007, 2008  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -64,3 +64,6 @@ test -f _inst/info/main.info
 $MAKE uninstall
 test ! -f _inst/info/main.info
 test -f ../main.info
+
+# multiple uninstall should not fail.
+$MAKE uninstall




reply via email to

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