+2011-11-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: avoid another failure of 'uninstall-fail.test' on Solaris
+ * tests/uninstall-fail.test: On Solaris 10, if `/bin/rm' is run
+ with the `-f' option, it doesn't print any error message when
+ failing to remove a file (due to e.g., "Permission denied").
+ Yikes. Cater to this incompatibility, by relaxing the test when
+ a faulty `rm' is detected.
+
2011-11-03 Zack Weinberg <zackw@panix.com> (tiny change)
Stefano Lattarini <stefano.lattarini@gmail.com>
mkdir d
: > d/f
chmod a-w d || skip "cannot make directories unwritable"
-rm -f d/f && skip_ "can delete files from unwritable directories"
+
+# On Solaris 10, if `/bin/rm' is run with the `-f' option, it doesn't
+# print any error message when failing to remove a file (due to e.g.,
+# "Permission denied"). Yikes. We'll cater to this incompatibility
+# by relaxing a test below if a faulty `rm' is detected.
+st=0; rm -f d/f 2>stderr || st=$?
+cat stderr >&2
+test $st -gt 0 || skip_ "can delete files from unwritable directories"
+if grep 'rm:' stderr; then
+ rm_f_is_silent_on_error=no
+else
+ rm_f_is_silent_on_error=yes
+fi
cat >> configure.in << 'END'
AC_OUTPUT
chmod a-w $inst/share
$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
cat output
-grep "rm: .*foobar\.txt" output
+if test $rm_f_is_silent_on_failure = yes; then
+ : "rm -f" is silent on errors, skip the grepping of make output
+else
+ grep "rm: .*foobar\.txt" output
+fi
chmod a-rwx $inst/share
(cd $inst/share) && skip_ "cannot make directories fully unreadable"