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 1543E138334 for ; Thu, 8 Aug 2019 19:47:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 244C5E07FA; Thu, 8 Aug 2019 19:47:55 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 064A9E07FA for ; Thu, 8 Aug 2019 19:47:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 03DD13495F2 for ; Thu, 8 Aug 2019 19:47:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 80E74757 for ; Thu, 8 Aug 2019 19:47:52 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1565293663.59e3009e8893e44ebb52abefe8fb1fbcd2adf57c.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/savedconfig.eclass X-VCS-Directories: eclass/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 59e3009e8893e44ebb52abefe8fb1fbcd2adf57c X-VCS-Branch: master Date: Thu, 8 Aug 2019 19:47:52 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 078774c6-304d-451a-8c88-f8444e80312e X-Archives-Hash: a2dfb75652fc19478800f636bf27340f commit: 59e3009e8893e44ebb52abefe8fb1fbcd2adf57c Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Aug 3 12:43:17 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Aug 8 19:47:43 2019 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59e3009e savedconfig.eclass: Only check config file candidate once Due to the injection of $CTARGET and $CHOST in file path we could end up with an already checked config file candidate if $CTARGET or $CHOST isn't used. This commit will make sure that we don't check the same file twice. Signed-off-by: Thomas Deutschmann gentoo.org> eclass/savedconfig.eclass | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass index 1ea464271af..b2be715630a 100644 --- a/eclass/savedconfig.eclass +++ b/eclass/savedconfig.eclass @@ -113,20 +113,24 @@ restore_config() { use savedconfig || return - local found check configfile + local found check checked configfile local base=${PORTAGE_CONFIGROOT%/}/etc/portage/savedconfig for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do - configfile=${base}/${CTARGET}/${check} - [[ -r ${configfile} ]] || configfile=${base}/${CHOST}/${check} + configfile=${base}/${CTARGET:+"${CTARGET}/"}${check} + [[ -r ${configfile} ]] || configfile=${base}/${CHOST:+"${CHOST}/"}${check} [[ -r ${configfile} ]] || configfile=${base}/${check} - einfo "Checking existence of ${configfile} ..." + [[ "${checked}" == *"${configfile} "* ]] && continue + einfo "Checking existence of \"${configfile}\" ..." if [[ -r "${configfile}" ]] ; then einfo "Found \"${configfile}\"" found=${configfile} _SAVEDCONFIG_CONFIGURATION_FILE=${configfile#${base}/} break fi + + checked+="${configfile} " done + if [[ -f ${found} ]]; then elog "Building using saved configfile \"${found}\"" if [ $# -gt 0 ]; then