aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDorinda <dorindabassey@gmail.com>2021-02-01 09:46:38 -0500
committerSteve Sakoman <steve@sakoman.com>2021-02-11 04:27:21 -1000
commitdfa4b0e6cabb870a33627ff5a0b5f413f6edb1e2 (patch)
treee7b37d46ed29085971f5bd32ae94837b452a4e50
parent0807c033f13e49e2891bbc69858a4cf5221c8f2c (diff)
downloadopenembedded-core-contrib-dfa4b0e6cabb870a33627ff5a0b5f413f6edb1e2.tar.gz
openembedded-core-contrib-dfa4b0e6cabb870a33627ff5a0b5f413f6edb1e2.tar.bz2
openembedded-core-contrib-dfa4b0e6cabb870a33627ff5a0b5f413f6edb1e2.zip
oe-pkgdata-util: Check if environment script is initialized
Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized. [YOCTO #12096] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e88073e16f1b4cfd0f97c81a988640a84adad674) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-xscripts/oe-pkgdata-util3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 93220e36178..75dd23efa32 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -598,6 +598,9 @@ def main():
logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
sys.exit(1)
logger.debug('Found bitbake path: %s' % bitbakepath)
+ if not os.environ.get('BUILDDIR', ''):
+ logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+ sys.exit(1)
tinfoil = tinfoil_init()
try:
args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')