mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
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 <whissi@gentoo.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user