summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-03-27 13:10:16 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-03-27 13:11:05 +0200
commit619c1b265564ba2aac50004dec9761df567c69b3 (patch)
tree2581fbc8f5a917e4ec249a82240ec9639d84d5e6
parent8bf5cacff594974000979c5b70e33ebbcfcde29a (diff)
downloadautomake-619c1b265564ba2aac50004dec9761df567c69b3.tar.gz
info: allow user to inhibit pruning of '${infodir}/dir'
This should have ideally been part of commit 'v1.11-519-g1ec1668' of 23-11-2011 "info: allow user to inhibit creation/update of '${infodir}/dir'". Well, better late than never. * lib/am/texinfos.am (uninstall-info-am): Don't look anymore at the output of "install-info --version" to decide whether to use it to update the '${infodir}/dir' or not; instead, honour the environment variable 'AM_UPDATE_INFO_DIR'. To avoid code duplication with ... (install-info-am): ... the recipe of this target, move common code out to ... (am__can_run_installinfo): ... this new internal variable. * tests/install-info-dir.test: Enhance. * doc/automake.texi (Texinfo): Update. * NEWS: Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r--NEWS6
-rw-r--r--doc/automake.texi10
-rw-r--r--lib/am/texinfos.am27
-rwxr-xr-xtests/install-info-dir.test40
4 files changed, 57 insertions, 26 deletions
diff --git a/NEWS b/NEWS
index 5d463da38..8809d2c78 100644
--- a/NEWS
+++ b/NEWS
@@ -103,9 +103,9 @@ New in 1.11.0a:
file generated by automake-provided rules by defining the special make
variable `$(EXTRA_DEJAGNU_SITE_CONFIG)'.
- - The `install-info' rule can now be instructed not to create/update
- the `${infodir}/dir' file, by exporting the new environment variable
- `AM_UPDATE_INFO_DIR' to the value "no".
+ - The `install-info' and `uninstall-info' rules can now be instructed
+ not to create/update the `${infodir}/dir' file, by exporting the new
+ environment variable `AM_UPDATE_INFO_DIR' to the value "no".
- For programs and libraries, automake now detects EXTRA_foo_DEPENDENCIES
and adds them to the normal list of dependencies, but without
diff --git a/doc/automake.texi b/doc/automake.texi
index 7421029dd..9b6b8f54e 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8025,11 +8025,11 @@ be prevented via the @code{no-installinfo} option. In this case,
request this explicitly using @samp{make install-info}.
@vindex AM_UPDATE_INFO_DIR
-By default, @code{make install-info} will try to run the
-@command{install-info} program (if available) to update (or create)
-the @file{@code{$@{infodir@}}/dir} index. If this is undesired, it
-can be prevented by exporting the @code{AM_UPDATE_INFO_DIR} variable
-to "@code{no}".
+By default, @code{make install-info} and @code{make install-info}
+will try to run the @command{install-info} program (if available)
+to update (or create) the @file{@code{$@{infodir@}}/dir} index.
+If this is undesired, it can be prevented by exporting the
+@code{AM_UPDATE_INFO_DIR} variable to "@code{no}".
The following variables are used by the Texinfo build rules.
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 9190e8fb4..1a1766ea6 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -94,6 +94,18 @@ endif ! %?LOCAL-TEXIS%
## Installing. ##
## ------------ ##
+## Some code should be run only if install-info actually exists, and
+## if the user doesn't request it not to be run (through the
+## 'AM_UPDATE_INFO_DIR' environment variable). See automake bug#9773
+## and Debian Bug#543992.
+if %?FIRST%
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+endif
+
## Look in both . and srcdir because the info pages might have been
## rebuilt in the build directory. Can't cd to srcdir; that might
## break a possible install-sh reference.
@@ -222,16 +234,7 @@ install-info-am: $(INFO_DEPS)
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
-## Only run this code if install-info actually exists, and if the user
-## doesn't request it not to be run (through the `AM_UPDATE_INFO_DIR'
-## environment variable). See automake bug#9773 and Debian Bug#543992.
- @am__run_installinfo=yes; \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) am__run_installinfo=no;; \
- *) (install-info --version) >/dev/null 2>&1 \
- || am__run_installinfo=no;; \
- esac; \
- if test $$am__run_installinfo = yes; then \
+ @if $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
## Strip directory
@@ -322,9 +325,7 @@ uninstall-info-am:
@$(PRE_UNINSTALL)
## Run two loops here so that we can handle PRE_UNINSTALL and
## NORMAL_UNINSTALL correctly.
- @if test -d '$(DESTDIR)$(infodir)' && \
- (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+ @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
diff --git a/tests/install-info-dir.test b/tests/install-info-dir.test
index 044bf6d2a..405480d78 100755
--- a/tests/install-info-dir.test
+++ b/tests/install-info-dir.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 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
@@ -78,12 +78,28 @@ fi
# by default (if the `install-info' program is available).
# This should happen in a normal as well as in a DESTDIR installation.
if test $have_installinfo = yes; then
+
$MAKE install-info
test -f $instdir/info/foo.info
test -f $instdir/info/dir
+ $FGREP 'Does nothing at all, but has a nice name' $instdir/info/dir
+
+ $MAKE uninstall
+ test ! -f $instdir/info/foo.info
+ $FGREP 'but has a nice name' $instdir/info/dir && Exit 1
+
+ dir="$destdir/$cwd/$instdir/info"
+
$MAKE DESTDIR="$cwd/$destdir" install-info
- test -f "$destdir/$cwd/$instdir"/info/foo.info
- test -f "$destdir/$cwd/$instdir"/info/dir
+ test -f "$dir"/foo.info
+ test -f "$dir"/dir
+ $FGREP 'Does nothing at all, but has a nice name' "$dir"/dir
+ $MAKE DESTDIR="$cwd/$destdir" uninstall
+ test ! -f "$dir"/foo.info
+ $FGREP 'but has a nice name' "$dir"/dir && Exit 1
+
+ unset dir
+
fi
rm -rf $instdir $destdir
@@ -121,6 +137,11 @@ END
$MAKE install-info
test -f $instdir/info/foo.info
test -f $instdir/info/dir
+ $MAKE uninstall
+ test ! -f $instdir/info/foo.info
+ test -f $instdir/info/dir
+ $FGREP 'but has a nice name' $instdir/info/dir && Exit 1
+ : For shells with busted 'set -e'.
fi
rm -rf $instdir bin/install-info
@@ -134,15 +155,24 @@ for val in no NO n; do
test -f $instdir/info/foo.info
test ! -f $instdir/info/dir
done
+
+$MAKE install-info
+chmod a-w $instdir/info/dir
+for val in no NO n; do
+ env AM_UPDATE_INFO_DIR="$val" $MAKE uninstall
+ $FGREP 'Does nothing at all, but has a nice name' $instdir/info/dir
+done
+
if test $have_installinfo = yes; then
for val in 'yes' 'who cares!'; do
rm -rf $instdir
env AM_UPDATE_INFO_DIR="$val" $MAKE install-info
test -f $instdir/info/foo.info
test -f $instdir/info/dir
+ env AM_UPDATE_INFO_DIR="$val" $MAKE uninstall
+ test ! -f $instdir/info/foo.info
+ $FGREP 'but has a nice name' $instdir/info/dir && Exit 1
done
fi
-rm -rf $instdir
-
: