2 # ex:ts=4:sw=4:sts=4:et
3 # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
5 # Copyright (C) 2012 Wind River Systems, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 as
9 # published by the Free Software Foundation.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 # This is used for dumping the bb_cache.dat, the output format is:
22 # recipe_path PN PV PACKAGES
28 # For importing bb.cache
29 sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '../lib'))
30 from bb.cache import CoreRecipeInfo
32 import cPickle as pickle
36 Get the mapping for the target recipe.
39 print >>sys.stderr, "Error, need one argument!"
44 with open(cachefile, "rb") as cachefile:
45 pickled = pickle.Unpickler(cachefile)
52 if isinstance(val, CoreRecipeInfo) and (not val.skipped):
54 # Filter out the native recipes.
55 if key.startswith('virtual:native:') or pn.endswith("-native"):
58 # 1.0 is the default version for a no PV recipe.
59 if val.__dict__.has_key("pv"):
64 print("%s %s %s %s" % (key, pn, pv, ' '.join(val.packages)))
66 if __name__ == "__main__":
67 sys.exit(main(sys.argv[1:]))