Bug #195949 - Use a different diff_command sanity check
authorZac Medico <zmedico@gentoo.org>
Mon, 15 Oct 2007 16:15:16 +0000 (16:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 15 Oct 2007 16:15:16 +0000 (16:15 -0000)
when using_editor is true.

svn path=/main/trunk/; revision=8129

bin/etc-update

index 16fb1fae46ec2824971156f174f262f239a48701..60a55e3b099572a929ff252e78673ebda0443682 100755 (executable)
@@ -517,13 +517,20 @@ declare -i mode=$(get_config mode)
 [[ -z ${mode} ]] && mode=0
 [[ -z ${pager} ]] && pager="cat"
 
-# Sanity check to make sure diff exists and works
-echo > "${TMP}"/.diff-test-1
-echo > "${TMP}"/.diff-test-2
-
-if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 &> /dev/null ; then
-       echo "ERROR: '${diff_command}' does not seem to work, aborting"
-       exit 1
+if [ "${using_editor}" == 0 ]; then
+       # Sanity check to make sure diff exists and works
+       echo > "${TMP}"/.diff-test-1
+       echo > "${TMP}"/.diff-test-2
+       
+       if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 ; then
+               echo "ERROR: '${diff_command}' does not seem to work, aborting"
+               exit 1
+       fi
+else
+       if ! type ${diff_command%% *} >/dev/null; then
+               echo "ERROR: '${diff_command}' does not seem to work, aborting"
+               exit 1
+       fi
 fi
 
 #echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts"