bitbake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env python
  2. # 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. import os
  25. import sys
  26. sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
  27. 'lib'))
  28. try:
  29. import bb
  30. except RuntimeError as exc:
  31. sys.exit(str(exc))
  32. from bb import cookerdata
  33. from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
  34. __version__ = "1.27.1"
  35. if __name__ == "__main__":
  36. if __version__ != bb.__version__:
  37. sys.exit("Bitbake core version and program version mismatch!")
  38. try:
  39. sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
  40. cookerdata.CookerConfiguration()))
  41. except BBMainException as err:
  42. sys.exit(err)
  43. except bb.BBHandledException:
  44. sys.exit(1)
  45. except Exception:
  46. import traceback
  47. traceback.print_exc()
  48. sys.exit(1)