]> diplodocus.org Git - nmh/commitdiff
Check to see if cross-directory links are supported; if they are not,
authorKen Hornstein <kenh@pobox.com>
Wed, 18 May 2016 16:44:21 +0000 (12:44 -0400)
committerKen Hornstein <kenh@pobox.com>
Wed, 18 May 2016 16:44:54 +0000 (12:44 -0400)
then don't run the refile -link test.

test/common.sh.in
test/refile/test-refile

index 0aee867..29e8801 100644 (file)
@@ -135,12 +135,18 @@ check_for_hard_links () {
   set +e
 
   printf '' > "${MH_TEST_DIR}/$$-1"
+  xdir_links_supported=0
   if link "${MH_TEST_DIR}/$$-1" "${MH_TEST_DIR}/$$-2" 2>/dev/null; then
     hard_links_supported=1
+    mkdir "${MH_TEST_DIR}/xlinkdir"
+    if link "${MH_TEST_DIR}/$$-1" "${MH_TEST_DIR}/xlinkdir/$$-2" 2>/dev/null; then
+       xdir_links_supported=1
+    fi
   else
     hard_links_supported=0
   fi
   rm -f "${MH_TEST_DIR}/$$-1" "${MH_TEST_DIR}/$$-2"
+  rm -rf "${MH_TEST_DIR}/xlinkdir"
 
   set -e
 }
index 71b2baa..64df564 100755 (executable)
@@ -116,7 +116,7 @@ other+ has  1 message   (1- 1).
 TOTAL = 11 messages in 2 folders.'
 
 check_for_hard_links
-if [ $hard_links_supported -eq 1 ]; then
+if [ $xdir_links_supported -eq 1 ]; then
   # check -link
   run_test 'refile 7 -src +inbox +other -link' ''
   run_test 'folders -noheader' \