From c2a2eb36f09ed8b9dcf513f948e0291044792507 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Wed, 4 Nov 2015 09:50:57 -0700 Subject: [PATCH 1/2] tcmode: kill redundant Error: in sanity check errors bb.fatal already prints ERROR:, so prefixing it with Error: is pointless and redundant. JIRA: SB-6206 Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index bfb0e7e..fc2b960 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -177,17 +177,17 @@ python toolchain_sanity_check () { d = e.data external_toolchain = d.getVar('EXTERNAL_TOOLCHAIN', True) if not external_toolchain or external_toolchain == 'UNDEFINED': - bb.fatal("Error: EXTERNAL_TOOLCHAIN must be set to the path to your sourcery toolchain") + bb.fatal("EXTERNAL_TOOLCHAIN must be set to the path to your sourcery toolchain") if not os.path.exists(external_toolchain): - bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' does not exist" % external_toolchain) + bb.fatal("EXTERNAL_TOOLCHAIN is invalid: path '%s' does not exist" % external_toolchain) gccpath = os.path.join(external_toolchain, 'bin', e.data.expand('${EXTERNAL_TARGET_SYS}-gcc')) if not os.path.exists(gccpath): if (os.path.exists(os.path.dirname(gccpath)) and d.getVar('EXTERNAL_TARGET_SYS', True) == d.getVar('TARGET_SYS', True)): bb.warn("EXTERNAL_TARGET_SYS == TARGET_SYS. This indicates that the prefixes specified by EXTERNAL_TARGET_SYSTEMS were not found.") - bb.fatal("Error: EXTERNAL_TOOLCHAIN gcc path '%s' does not exist" % gccpath) + bb.fatal("EXTERNAL_TOOLCHAIN gcc path '%s' does not exist" % gccpath) if d.getVar('GCC_VERSION', True) == 'UNKNOWN': bb.warn("EXTERNAL_TOOLCHAIN gcc version extraction failed, see debug messages for details") From d2b3e641de4fbe3e1194d203cdacfd688f6cbcae Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Wed, 4 Nov 2015 09:52:24 -0700 Subject: [PATCH 2/2] tcmode: explicitly check for bindir's existence JIRA: SB-6206 Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index fc2b960..ac18afa 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -182,10 +182,13 @@ python toolchain_sanity_check () { if not os.path.exists(external_toolchain): bb.fatal("EXTERNAL_TOOLCHAIN is invalid: path '%s' does not exist" % external_toolchain) - gccpath = os.path.join(external_toolchain, 'bin', e.data.expand('${EXTERNAL_TARGET_SYS}-gcc')) + bindir = os.path.join(external_toolchain, 'bin') + if not os.path.exists(bindir): + bb.fatal("EXTERNAL_TOOLCHAIN is invalid: path '%s' does not exist" % bindir) + + gccpath = os.path.join(bindir, e.data.expand('${EXTERNAL_TARGET_SYS}-gcc')) if not os.path.exists(gccpath): - if (os.path.exists(os.path.dirname(gccpath)) and - d.getVar('EXTERNAL_TARGET_SYS', True) == d.getVar('TARGET_SYS', True)): + if d.getVar('EXTERNAL_TARGET_SYS', True) == d.getVar('TARGET_SYS', True): bb.warn("EXTERNAL_TARGET_SYS == TARGET_SYS. This indicates that the prefixes specified by EXTERNAL_TARGET_SYSTEMS were not found.") bb.fatal("EXTERNAL_TOOLCHAIN gcc path '%s' does not exist" % gccpath)