aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2017-02-22 20:10:07 +0100
committerZac Medico <zmedico@gentoo.org>2017-02-22 13:57:28 -0800
commit246373bbe52c55e912381d8555cceb70db0ec41b (patch)
tree3ffa241e728acea4273aa07de853dd3b432e22aa
parentrepoman: Deprecate confutils.eclass (diff)
downloadportage-246373bbe52c55e912381d8555cceb70db0ec41b.tar.gz
portage-246373bbe52c55e912381d8555cceb70db0ec41b.tar.bz2
portage-246373bbe52c55e912381d8555cceb70db0ec41b.zip
etc-update: fix hang when using_editor is set, bug #544440
Don't try to use an interactive editor to obtain the difference between files. Fall back to plain `diff -q` in this case. X-Gentoo-Bug: 544440 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=544440
-rwxr-xr-xbin/etc-update19
1 files changed, 15 insertions, 4 deletions
diff --git a/bin/etc-update b/bin/etc-update
index e0f7224dc..ea69f1478 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -649,10 +649,21 @@ do_distconf() {
elif [[ -L ${efile} || -L ${file} ]] ; then
# not the same file types
continue
- elif diff_command "${file}" "${efile}" &> /dev/null; then
- # replace identical copy
- mv "${file}" "${efile}"
- break
+ else
+ local ret=
+ if [[ ${using_editor} == 0 ]] ; then
+ diff_command "${file}" "${efile}" &> /dev/null
+ ret=$?
+ else
+ # fall back to plain diff
+ diff -q "${file}" "${efile}" &> /dev/null
+ ret=$?
+ fi
+ if [[ ${ret} == 0 ]] ; then
+ # replace identical copy
+ mv "${file}" "${efile}"
+ break
+ fi
fi
done
}