diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2011-07-02 23:15:30 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-05 13:36:54 +0100 |
commit | 7a2a24de094ce8f2e2068bbee6709dfc2cdc69b9 (patch) | |
tree | 4d3037cc69d1800c33bd78568dda5fb172ab41aa | |
parent | deb14487d1267afbbcb6796035926470cd8152d7 (diff) | |
download | poky-7a2a24de094ce8f2e2068bbee6709dfc2cdc69b9.tar.gz |
bitbake/cooker, bitbake-layers: show the .bbappend files that matches no existing .bb recipe
This patch moves the logic of show_appends_with_no_recipes from bitbake-layers
into bitbake. By default, a fatal message is printed; we can also define a variable
BB_DANGLINGAPPENDS_WARNONLY to make the message only a warning(the variables
could be defined in conf/local.conf with a value "yes", "true" or "1").
(Bitbake rev: f5ba7c795df7cbd58124e35970ddc5bd84cbfb8e)
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | bitbake/bin/bitbake-layers | 21 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 22 |
2 files changed, 23 insertions, 20 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index dfbdb7032a..5abf26cfbd 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -55,7 +55,7 @@ class Commands(cmd.Cmd): | |||
55 | 55 | ||
56 | def prepare_cooker(self): | 56 | def prepare_cooker(self): |
57 | sys.stderr.write("Parsing recipes..") | 57 | sys.stderr.write("Parsing recipes..") |
58 | logger.setLevel(logging.ERROR) | 58 | logger.setLevel(logging.WARNING) |
59 | 59 | ||
60 | try: | 60 | try: |
61 | while self.cooker.state in (state.initial, state.parsing): | 61 | while self.cooker.state in (state.initial, state.parsing): |
@@ -156,8 +156,6 @@ class Commands(cmd.Cmd): | |||
156 | 156 | ||
157 | self.show_appends_for_skipped() | 157 | self.show_appends_for_skipped() |
158 | 158 | ||
159 | self.show_appends_with_no_recipes() | ||
160 | |||
161 | def show_appends_for_pn(self, pn): | 159 | def show_appends_for_pn(self, pn): |
162 | filenames = self.cooker_data.pkg_pn[pn] | 160 | filenames = self.cooker_data.pkg_pn[pn] |
163 | 161 | ||
@@ -204,23 +202,6 @@ class Commands(cmd.Cmd): | |||
204 | notappended.append(basename) | 202 | notappended.append(basename) |
205 | return appended, notappended | 203 | return appended, notappended |
206 | 204 | ||
207 | def show_appends_with_no_recipes(self): | ||
208 | recipes = set(os.path.basename(f) | ||
209 | for f in self.cooker_data.pkg_fn.iterkeys()) | ||
210 | recipes |= set(os.path.basename(f) | ||
211 | for f in self.cooker.skiplist.iterkeys()) | ||
212 | appended_recipes = self.cooker_data.appends.iterkeys() | ||
213 | appends_without_recipes = [self.cooker_data.appends[recipe] | ||
214 | for recipe in appended_recipes | ||
215 | if recipe not in recipes] | ||
216 | if appends_without_recipes: | ||
217 | appendlines = (' %s' % append | ||
218 | for appends in appends_without_recipes | ||
219 | for append in appends) | ||
220 | logger.warn('No recipes available for:\n%s', | ||
221 | '\n'.join(appendlines)) | ||
222 | self.returncode |= 4 | ||
223 | |||
224 | def do_EOF(self, line): | 205 | def do_EOF(self, line): |
225 | return True | 206 | return True |
226 | 207 | ||
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 67f0805cbb..7976d299c0 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -483,6 +483,27 @@ class BBCooker: | |||
483 | return pri | 483 | return pri |
484 | return 0 | 484 | return 0 |
485 | 485 | ||
486 | def show_appends_with_no_recipes( self ): | ||
487 | recipes = set(os.path.basename(f) | ||
488 | for f in self.status.pkg_fn.iterkeys()) | ||
489 | recipes |= set(os.path.basename(f) | ||
490 | for f in self.skiplist.iterkeys()) | ||
491 | appended_recipes = self.appendlist.iterkeys() | ||
492 | appends_without_recipes = [self.appendlist[recipe] | ||
493 | for recipe in appended_recipes | ||
494 | if recipe not in recipes] | ||
495 | if appends_without_recipes: | ||
496 | appendlines = (' %s' % append | ||
497 | for appends in appends_without_recipes | ||
498 | for append in appends) | ||
499 | msg = 'No recipes available for:\n%s' % '\n'.join(appendlines) | ||
500 | warn_only = data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \ | ||
501 | self.configuration.data, False) or "no" | ||
502 | if warn_only.lower() in ("1", "yes", "true"): | ||
503 | bb.warn(msg) | ||
504 | else: | ||
505 | bb.fatal(msg) | ||
506 | |||
486 | def buildDepgraph( self ): | 507 | def buildDepgraph( self ): |
487 | all_depends = self.status.all_depends | 508 | all_depends = self.status.all_depends |
488 | pn_provides = self.status.pn_provides | 509 | pn_provides = self.status.pn_provides |
@@ -1009,6 +1030,7 @@ class BBCooker: | |||
1009 | 1030 | ||
1010 | if not self.parser.parse_next(): | 1031 | if not self.parser.parse_next(): |
1011 | collectlog.debug(1, "parsing complete") | 1032 | collectlog.debug(1, "parsing complete") |
1033 | self.show_appends_with_no_recipes() | ||
1012 | self.buildDepgraph() | 1034 | self.buildDepgraph() |
1013 | self.state = state.running | 1035 | self.state = state.running |
1014 | return None | 1036 | return None |