blob: 61db6b70f1e7f04efe9ab1ff44b01b99b5ebd16f [file] [log] [blame]
Patrick Williamsc0f7c042017-02-23 20:41:17 -06001#!/usr/bin/env python3
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002#
3# Copyright (C) 2003, 2004 Chris Larson
4# Copyright (C) 2003, 2004 Phil Blundell
5# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
6# Copyright (C) 2005 Holger Hans Peter Freyther
7# Copyright (C) 2005 ROAD GmbH
8# Copyright (C) 2006 Richard Purdie
9#
Brad Bishopc342db32019-05-15 21:57:59 -040010# SPDX-License-Identifier: GPL-2.0-only
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011#
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13import os
14import sys
15
16sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
17 'lib'))
18try:
19 import bb
20except RuntimeError as exc:
21 sys.exit(str(exc))
22
23from bb import cookerdata
24from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
25
Patrick Williamsc0f7c042017-02-23 20:41:17 -060026if sys.getfilesystemencoding() != "utf-8":
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027 sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028
Andrew Geisslerd25ed322020-06-27 00:28:28 -050029__version__ = "1.47.0"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
31if __name__ == "__main__":
32 if __version__ != bb.__version__:
33 sys.exit("Bitbake core version and program version mismatch!")
34 try:
35 sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
36 cookerdata.CookerConfiguration()))
37 except BBMainException as err:
38 sys.exit(err)
39 except bb.BBHandledException:
40 sys.exit(1)
41 except Exception:
42 import traceback
43 traceback.print_exc()
44 sys.exit(1)