]> 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)
committerDavid Levine <david.levine@gonift.com>
Sat, 21 May 2016 13:17:38 +0000 (09:17 -0400)
then don't run the refile -link test.

(cherry picked from commit 35fce21b692a6259138fc81caf13f4d07bb58da0)

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

index 936b89a..1e93f1b 100644 (file)
@@ -138,12 +138,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' \