From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A3A19139694 for ; Wed, 22 Feb 2017 22:28:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB46EE0DB9; Wed, 22 Feb 2017 22:28:10 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 99854E0DB9 for ; Wed, 22 Feb 2017 22:28:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 829113413B7 for ; Wed, 22 Feb 2017 22:28:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D7DF5511F for ; Wed, 22 Feb 2017 22:28:07 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1487800648.246373bbe52c55e912381d8555cceb70db0ec41b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/etc-update X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 246373bbe52c55e912381d8555cceb70db0ec41b X-VCS-Branch: master Date: Wed, 22 Feb 2017 22:28:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a418a6e3-4b61-4001-b53c-f9bba54ae89b X-Archives-Hash: a916b15616d2c145612edab542a810c7 commit: 246373bbe52c55e912381d8555cceb70db0ec41b Author: Fabian Groffen gentoo org> AuthorDate: Wed Feb 22 19:10:07 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Feb 22 21:57:28 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=246373bb 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 bin/etc-update | 19 +++++++++++++++---- 1 file 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 }