diff options
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index bf5bf9b53d..70894e60e1 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -162,6 +162,53 @@ Options: | |||
162 | 162 | ||
163 | items_listed = self.list_recipes('Overlayed recipes', None, True, show_same_ver_only, show_filenames, True) | 163 | items_listed = self.list_recipes('Overlayed recipes', None, True, show_same_ver_only, show_filenames, True) |
164 | 164 | ||
165 | # Check for overlayed .bbclass files | ||
166 | classes = defaultdict(list) | ||
167 | for layerdir in self.bblayers: | ||
168 | classdir = os.path.join(layerdir, 'classes') | ||
169 | if os.path.exists(classdir): | ||
170 | for classfile in os.listdir(classdir): | ||
171 | if os.path.splitext(classfile)[1] == '.bbclass': | ||
172 | classes[classfile].append(classdir) | ||
173 | |||
174 | # Locating classes and other files is a bit more complicated than recipes - | ||
175 | # layer priority is not a factor; instead BitBake uses the first matching | ||
176 | # file in BBPATH, which is manipulated directly by each layer's | ||
177 | # conf/layer.conf in turn, thus the order of layers in bblayers.conf is a | ||
178 | # factor - however, each layer.conf is free to either prepend or append to | ||
179 | # BBPATH (or indeed do crazy stuff with it). Thus the order in BBPATH might | ||
180 | # not be exactly the order present in bblayers.conf either. | ||
181 | bbpath = str(self.config_data.getVar('BBPATH', True)) | ||
182 | overlayed_class_found = False | ||
183 | for (classfile, classdirs) in classes.items(): | ||
184 | if len(classdirs) > 1: | ||
185 | if not overlayed_class_found: | ||
186 | logger.plain('=== Overlayed classes ===') | ||
187 | overlayed_class_found = True | ||
188 | |||
189 | mainfile = bb.utils.which(bbpath, os.path.join('classes', classfile)) | ||
190 | if show_filenames: | ||
191 | logger.plain('%s' % mainfile) | ||
192 | else: | ||
193 | # We effectively have to guess the layer here | ||
194 | logger.plain('%s:' % classfile) | ||
195 | mainlayername = '?' | ||
196 | for layerdir in self.bblayers: | ||
197 | classdir = os.path.join(layerdir, 'classes') | ||
198 | if mainfile.startswith(classdir): | ||
199 | mainlayername = self.get_layer_name(layerdir) | ||
200 | logger.plain(' %s' % mainlayername) | ||
201 | for classdir in classdirs: | ||
202 | fullpath = os.path.join(classdir, classfile) | ||
203 | if fullpath != mainfile: | ||
204 | if show_filenames: | ||
205 | print(' %s' % fullpath) | ||
206 | else: | ||
207 | print(' %s' % self.get_layer_name(os.path.dirname(classdir))) | ||
208 | |||
209 | if overlayed_class_found: | ||
210 | items_listed = True; | ||
211 | |||
165 | if not items_listed: | 212 | if not items_listed: |
166 | logger.note('No overlayed files found') | 213 | logger.note('No overlayed files found') |
167 | 214 | ||