summaryrefslogtreecommitdiffstats
path: root/bin/etc-update
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-15 18:56:20 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-15 18:56:20 +0000
commit4332653b636fcd65c50c3b34e9fbbc574250dda9 (patch)
treedb45065971f53c777e7d959ce4f0d5b05cc60d18 /bin/etc-update
parentdc4b80780d635c71e8b2d44de367a71db33c0511 (diff)
downloadportage-4332653b636fcd65c50c3b34e9fbbc574250dda9.tar.gz
portage-4332653b636fcd65c50c3b34e9fbbc574250dda9.tar.bz2
portage-4332653b636fcd65c50c3b34e9fbbc574250dda9.zip
Bug #195949 - Use a different diff_command sanity check
when using_editor is true. (trunk r8129) svn path=/main/branches/2.1.2/; revision=8134
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update21
1 files changed, 14 insertions, 7 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 16fb1fae4..60a55e3b0 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -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"