From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7A81F138247 for ; Tue, 17 Dec 2013 23:23:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AABDBE09EC; Tue, 17 Dec 2013 23:23:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39743E09EA for ; Tue, 17 Dec 2013 23:23:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5B69433F3EC for ; Tue, 17 Dec 2013 23:23:23 +0000 (UTC) From: Mike Frysinger To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH] econf: update config.{sub,guess} atomically to avoid races Date: Tue, 17 Dec 2013 18:23:26 -0500 Message-Id: <1387322606-3867-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.8.4.3 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: 495c12aa-a36f-498e-b829-ac30522b57f9 X-Archives-Hash: 263b9139aaec26134f841e6efe9d3ed6 URL: https://bugs.gentoo.org/487478 --- bin/phase-helpers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index ec48c94..59c053a 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -512,7 +512,9 @@ econf() { -name config.guess -o -name config.sub ')' -print0 | \ while read -r -d $'\0' x ; do __vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}" - cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}" + # Make sure we do this atomically incase we're run in parallel. #487478 + cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}.$$" + mv -f "${x}.$$" "${x}" done fi -- 1.8.4.3