Hash :
d91f357d
Author :
Date :
2011-10-20T17:31:11
tests: avoid spurious failure of 'uninstall-fail.test' on Solaris * tests/uninstall-fail.test: All the Solaris 10 shells (/bin/sh, /bin/ksh, and /usr/xpg4/bin/sh), upon failing to chdir to a directory with the `cd' builtin, print a message like: "sh: /root: permission denied" which doesn't report the `cd' builtin anywhere. Relax the grepping of the error message accordingly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#! /bin/sh
# Copyright (C) 2011 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# "make uninstall" complains and errors out on failures.
# FIXME: this test only deal with DATA primary; maybe we need sister
# tests for other primaries too? E.g., SCRIPTS, PROGRAMS, LISP, PYTHON,
# etc...
. ./defs || Exit 1
set -e
mkdir d
: > d/f
chmod a-w d || skip "cannot make directories unwritable"
rm -f d/f && skip_ "can delete files from unwritable directories"
cat >> configure.in << 'END'
AC_OUTPUT
END
cat > Makefile.am << 'END'
data_DATA = foobar.txt
END
: > foobar.txt
$ACLOCAL
$AUTOMAKE
$AUTOCONF
inst=__inst-dir__
./configure --prefix="`pwd`/$inst"
mkdir $inst $inst/share
: > $inst/share/foobar.txt
chmod a-w $inst/share
$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
cat output
grep "rm: .*foobar\.txt" output
chmod a-rwx $inst/share
(cd $inst/share) && skip_ "cannot make directories fully unreadable"
$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
cat output
# Some shells, like Solaris 10 /bin/sh and /bin/ksh, do not report
# the name of the `cd' builtin upon a chdir error.
$EGREP "(cd|sh): .*$inst/share" output
: