diff options
author | Liping Ke <liping.ke@intel.com> | 2011-06-03 08:20:15 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-07 22:39:12 +0100 |
commit | 43eb7d956333b07108c89995148d17341b9561f6 (patch) | |
tree | 583cae2fb62d8ea1d5515e5364c9c2c5dd966a15 | |
parent | 8df355140c5afb683cb97fed82f679366e60320b (diff) | |
download | poky-43eb7d956333b07108c89995148d17341b9561f6.tar.gz |
Introduce extra cache class for image creator
Extra RecipeInfo will be all defined in this file. Currently,
Only Hob (Image Creator) Requests some extra fields. So
HobRecipeInfo is defined. It's named HobRecipeInfo because it
is introduced by 'hob'. Users could also introduce other
RecipeInfo or simply use those already defined RecipeInfo.
In the following patch, this newly defined new extra RecipeInfo
will be dynamically loaded and used for loading/saving the extra
cache fields.
(Bitbake rev: 75d9add923560af9fdd772a363c68337d2c9a97d)
Signed-off-by: Liping Ke <liping.ke@intel.com>
-rw-r--r-- | bitbake/lib/bb/cache_extra.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cache_extra.py b/bitbake/lib/bb/cache_extra.py new file mode 100644 index 0000000000..4c8841f857 --- /dev/null +++ b/bitbake/lib/bb/cache_extra.py | |||
@@ -0,0 +1,54 @@ | |||
1 | # ex:ts=4:sw=4:sts=4:et | ||
2 | # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- | ||
3 | # | ||
4 | # Extra RecipeInfo will be all defined in this file. Currently, | ||
5 | # Only Hob (Image Creator) Requests some extra fields. So | ||
6 | # HobRecipeInfo is defined. It's named HobRecipeInfo because it | ||
7 | # is introduced by 'hob'. Users could also introduce other | ||
8 | # RecipeInfo or simply use those already defined RecipeInfo. | ||
9 | # In the following patch, this newly defined new extra RecipeInfo | ||
10 | # will be dynamically loaded and used for loading/saving the extra | ||
11 | # cache fields | ||
12 | |||
13 | # Copyright (C) 2011, Intel Corporation. All rights reserved. | ||
14 | |||
15 | # This program is free software; you can redistribute it and/or modify | ||
16 | # it under the terms of the GNU General Public License version 2 as | ||
17 | # published by the Free Software Foundation. | ||
18 | # | ||
19 | # This program is distributed in the hope that it will be useful, | ||
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | # GNU General Public License for more details. | ||
23 | # | ||
24 | # You should have received a copy of the GNU General Public License along | ||
25 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
27 | |||
28 | from bb.cache import RecipeInfoCommon | ||
29 | |||
30 | class HobRecipeInfo(RecipeInfoCommon): | ||
31 | __slots__ = () | ||
32 | |||
33 | classname = "HobRecipeInfo" | ||
34 | # please override this member with the correct data cache file | ||
35 | # such as (bb_cache.dat, bb_extracache_hob.dat) | ||
36 | cachefile = "bb_extracache_" + classname +".dat" | ||
37 | |||
38 | def __init__(self, filename, metadata): | ||
39 | |||
40 | self.summary = self.getvar('SUMMARY', metadata) | ||
41 | self.license = self.getvar('LICENSE', metadata) | ||
42 | self.section = self.getvar('SECTION', metadata) | ||
43 | |||
44 | @classmethod | ||
45 | def init_cacheData(cls, cachedata): | ||
46 | # CacheData in Hob RecipeInfo Class | ||
47 | cachedata.summary = {} | ||
48 | cachedata.license = {} | ||
49 | cachedata.section = {} | ||
50 | |||
51 | def add_cacheData(self, cachedata, fn): | ||
52 | cachedata.summary[fn] = self.summary | ||
53 | cachedata.license[fn] = self.license | ||
54 | cachedata.section[fn] = self.section | ||