blob: 2a4fc720396e91aa6413d768f16ad9fbe773d84c [file] [log] [blame]
Patrick Williamsc0f7c042017-02-23 20:41:17 -06001#!/usr/bin/env python3
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2003, 2004 Chris Larson
6# Copyright (C) 2003, 2004 Phil Blundell
7# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
8# Copyright (C) 2005 Holger Hans Peter Freyther
9# Copyright (C) 2005 ROAD GmbH
10# Copyright (C) 2006 Richard Purdie
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License version 2 as
14# published by the Free Software Foundation.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License along
22# with this program; if not, write to the Free Software Foundation, Inc.,
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25import os
26import sys
27
28sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
29 'lib'))
30try:
31 import bb
32except RuntimeError as exc:
33 sys.exit(str(exc))
34
35from bb import cookerdata
36from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
37
Patrick Williamsc0f7c042017-02-23 20:41:17 -060038if sys.getfilesystemencoding() != "utf-8":
39 sys.exit("Please use a locale setting which supports 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.")
40
41__version__ = "1.32.0"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050042
43if __name__ == "__main__":
44 if __version__ != bb.__version__:
45 sys.exit("Bitbake core version and program version mismatch!")
46 try:
47 sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
48 cookerdata.CookerConfiguration()))
49 except BBMainException as err:
50 sys.exit(err)
51 except bb.BBHandledException:
52 sys.exit(1)
53 except Exception:
54 import traceback
55 traceback.print_exc()
56 sys.exit(1)