#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 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
# inlined, below.
# FIXME: this test is a good candidate for a conversion to TAP,
-# FIXME: and could be merged with 'txinfo27.test'.
+# FIXME: and could be merged with 'txinfo27.sh'.
required=makeinfo
-. ./defs || Exit 1
+. test-init.sh
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir bin
saved_PATH=$PATH; export saved_PATH
test -f foo.info
if install-info --version; then
- have_installinfo=yes
+ # Skip some checks even if 'install-info' is the one from dpkg, not
+ # the one from GNU info, as the former might try to create files in
+ # '/var/backups/', causing spurious failures like this for non-root
+ # users.
+ if install-info --version | $EGREP -i '(dpkg|debian) install-info'; then
+ have_installinfo=no
+ else
+ have_installinfo=yes
+ fi
else
have_installinfo=no
fi
$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
+ test ! -e $instdir/info/foo.info
+ $FGREP 'but has a nice name' $instdir/info/dir && exit 1
dir="$destdir/$cwd/$instdir/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
+ test ! -e "$dir"/foo.info
+ $FGREP 'but has a nice name' "$dir"/dir && exit 1
unset dir
exit 127
END
chmod a+x bin/install-info
-$MAKE install-info >output 2>&1 || { cat output; Exit 1; }
-cat output
+run_make -M install-info
test -f $instdir/info/foo.info
-test ! -f $instdir/info/dir
-grep 'error from install-info' output && Exit 1
+test ! -e $instdir/info/dir
+grep 'error from install-info' output && exit 1
rm -rf $instdir output
test -f $instdir/info/foo.info
test -f $instdir/info/dir
$MAKE uninstall
- test ! -f $instdir/info/foo.info
+ test ! -e $instdir/info/foo.info
test -f $instdir/info/dir
- $FGREP 'but has a nice name' $instdir/info/dir && Exit 1
+ $FGREP 'but has a nice name' $instdir/info/dir && exit 1
: For shells with busted 'set -e'.
fi
rm -rf $instdir
env AM_UPDATE_INFO_DIR="$val" $MAKE install-info
test -f $instdir/info/foo.info
- test ! -f $instdir/info/dir
+ test ! -e $instdir/info/dir
done
$MAKE install-info
+if test $have_installinfo != yes; then
+ echo 'Does nothing at all, but has a nice name' > $instdir/info/dir
+fi
+
chmod a-w $instdir/info/dir
for val in no NO n; do
env AM_UPDATE_INFO_DIR="$val" $MAKE uninstall
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
+ test ! -e $instdir/info/foo.info
+ $FGREP 'but has a nice name' $instdir/info/dir && exit 1
: For shells with busted 'set -e'.
done
fi