]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix for PR automake/345:
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 19 Aug 2002 13:09:00 +0000 (13:09 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 19 Aug 2002 13:09:00 +0000 (13:09 +0000)
* tests/defs: Add support for required=non-root, stolen
from fileutils' test suite.
* tests/destdir.test: Use required=non-root.

ChangeLog
tests/defs
tests/destdir.test

index e378f68f5578b89d30e0180dcb30b2005ff5dedc..08e8e9feb259a2551de5d7bdb0886832b59e7a21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-08-19  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       Fix for PR automake/345:
+       * tests/defs: Add support for required=non-root, stolen
+       from fileutils' test suite.
+       * tests/destdir.test: Use required=non-root.
+
        * tests/vtexi.test: Fix spurious failure introduced on 2002-07-30.
 
 2002-08-17  Tom Tromey  <tromey@redhat.com>
index 63150409905d66b7c6aa769fe2ad12c1f8e53b60..42ecd490ba0991ef6230353a80d3c9c4cc17d468 100644 (file)
@@ -56,6 +56,17 @@ then
        echo "$me: running $CXX --version"
        ( $CXX --version ) || exit 77
        ;;
+      non-root)
+       # Skip this test case if the user is root.
+       # We try to append to a read-only file to detect this.
+       priv_check_temp=priv-check.$$
+       touch $priv_check_temp || exit 1
+       chmod a-w $priv_check_temp || exit 1
+       (echo foo >> $priv_check_temp) >/dev/null 2>&1
+       overwrite_status=$?
+       rm -f $priv_check_temp
+       test $overwrite_status = 0 && exit 77
+       ;;
       # Generic case: the tool must support --version.
       *)
        echo "$me: running $tool --version"
index 8a4fd8c4c93cf289279f3777c946664a78931192..cccbd83683b448e6d6d8828f62a6626ec6906216 100755 (executable)
@@ -3,6 +3,10 @@
 # Make sure that `make distcheck' can find some $(DESTDIR) omissions.
 # PR/186.
 
+# The feature we test here relies on read-only files.
+# It will only work for non-root users.
+required='non-root'
+
 . $srcdir/defs || exit 1
 
 set -e