]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
detect ln simple backup bug
authorJim Meyering <jim@meyering.net>
Sun, 24 Dec 2000 13:49:29 +0000 (13:49 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 24 Dec 2000 13:49:29 +0000 (13:49 +0000)
tests/ln/misc

index d4d7fbfaf69d0f3146528393fe63b439f6c51551..26db832ec66b95fe2efcac863a2529f3ae7b96bd 100755 (executable)
@@ -1,17 +1,19 @@
 #!/bin/sh
 
-tmp=t2-ln.$$
-
 if test "$VERBOSE" = yes; then
   set -x
   ln --version
 fi
 
+pwd=`pwd`
+tmp=t2-ln.$$
+trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap '(exit $?); exit' 1 2 13 15
+
 framework_failure=0
 mkdir $tmp || framework_failure=1
 cd $tmp || framework_failure=1
 
-
 t=tln-symlink
 d=tln-subdir
 ld=tln-symlink-to-subdir
@@ -113,8 +115,13 @@ fi
 rm -rf a symlink hard-to-sym hard-to-dangle
 # ===================================================
 
-cd ..
-../../src/rm -rf $tmp
+# Make sure ln can make simple backups.
+# This was fixed in 4.0.34.  Broken in 4.0r.
+touch a || framework_failure=1
+ln --backup=simple --suffix=.orig x a || fail=1
+test -f a.orig || fail=1
+
+# ===================================================
 
 if test $framework_failure = 1; then
   echo 'failure in testing framework' 1>&2