Teach the oe tools to catch Exception so they fail a bit cleaner on exceptions it...
[vuplus_bitbake] / bin / oeread
1 #!/usr/bin/env python
2
3 import sys, copy, oe, oe.parse, oe.build
4 #from oe import *
5
6 cfg = {}
7 cfg = oe.parse.handle("conf/oe.conf", cfg)
8
9 cfgkeys = cfg.keys()
10 cfgkeys.sort()
11
12 if len(sys.argv) == 2:
13         oefile = copy.deepcopy(cfg)
14         try:
15                 oefile = oe.parse.handle(sys.argv[1], oefile)
16         except Exception, e:
17                 oe.fatal("%s" % e)
18         oefilekeys = oefile.keys()
19         oefilekeys.sort()
20         print "Variables in %s:" % sys.argv[1]
21         for k in oefilekeys:
22                 if k.startswith('base_'): continue
23                 if k.startswith('FILES_'): continue
24                 if k.startswith('do_'): continue
25                 if k.startswith('oe'): continue
26                 if k in cfg:
27                         if cfg[k] == oefile[k]:
28                                 continue
29                 if 'content' in oefile[k]:
30                         print k,'=',oe.data.expand(oefile[k]['content'], oefile)
31 else:
32         print "Variables in conf/oe.conf & friends:"
33         for k in cfgkeys:
34                 print "%-30s %s" % (k, cfg[k])
35