diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-10-07 14:55:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-11 05:39:04 +0100 |
commit | 41286f473086ef025d075bae1bb03a2929d1bfca (patch) | |
tree | 1dfd59e0e18bad170174c85d42a750656bd978ad /bitbake/lib | |
parent | 97d000677eb3d28c7f88f93a0c3c5154c3df32ad (diff) | |
download | poky-41286f473086ef025d075bae1bb03a2929d1bfca.tar.gz |
bitbake: toaster: buildinfohelper Skip packages we have no build info about
If there are more packages listed as installed than we know about from
bitbake, and therefore have insufficient information to be able to
create a Toaster Package object then skip it. Also handle the case where
a dependency references such a package.
Also clarify the error logging.
(Bitbake rev: b4ce793685f70cab3f28cb4329aaaf3878cd62e8)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index fc59c57d02..2d76403ecc 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -320,7 +320,7 @@ class ORMWrapper(object): | |||
320 | commit=layer_version_information['commit'], | 320 | commit=layer_version_information['commit'], |
321 | local_path = layer_version_information['local_path'], | 321 | local_path = layer_version_information['local_path'], |
322 | ) | 322 | ) |
323 | logger.warning("created new historical layer version %d", layer_copy.pk) | 323 | logger.info("created new historical layer version %d", layer_copy.pk) |
324 | 324 | ||
325 | self.layer_version_built.append(layer_copy) | 325 | self.layer_version_built.append(layer_copy) |
326 | 326 | ||
@@ -511,6 +511,12 @@ class ORMWrapper(object): | |||
511 | errormsg = "" | 511 | errormsg = "" |
512 | for p in packagedict: | 512 | for p in packagedict: |
513 | searchname = p | 513 | searchname = p |
514 | if p not in pkgpnmap: | ||
515 | logger.warning("Image packages list contains %p, but is" | ||
516 | " missing from all packages list where the" | ||
517 | " metadata comes from. Skipping...", p) | ||
518 | continue | ||
519 | |||
514 | if 'OPKGN' in pkgpnmap[p].keys(): | 520 | if 'OPKGN' in pkgpnmap[p].keys(): |
515 | searchname = pkgpnmap[p]['OPKGN'] | 521 | searchname = pkgpnmap[p]['OPKGN'] |
516 | 522 | ||
@@ -554,13 +560,20 @@ class ORMWrapper(object): | |||
554 | elif deptype == 'recommends': | 560 | elif deptype == 'recommends': |
555 | tdeptype = Package_Dependency.TYPE_TRECOMMENDS | 561 | tdeptype = Package_Dependency.TYPE_TRECOMMENDS |
556 | 562 | ||
557 | packagedeps_objs.append(Package_Dependency( package = packagedict[p]['object'], | 563 | try: |
558 | depends_on = packagedict[px]['object'], | 564 | packagedeps_objs.append(Package_Dependency( |
559 | dep_type = tdeptype, | 565 | package = packagedict[p]['object'], |
560 | target = target_obj)) | 566 | depends_on = packagedict[px]['object'], |
567 | dep_type = tdeptype, | ||
568 | target = target_obj)) | ||
569 | except KeyError as e: | ||
570 | logger.warn("Could not add dependency to the package %s " | ||
571 | "because %s is an unknown package", p, px) | ||
561 | 572 | ||
562 | if len(packagedeps_objs) > 0: | 573 | if len(packagedeps_objs) > 0: |
563 | Package_Dependency.objects.bulk_create(packagedeps_objs) | 574 | Package_Dependency.objects.bulk_create(packagedeps_objs) |
575 | else: | ||
576 | logger.info("No package dependencies created") | ||
564 | 577 | ||
565 | if len(errormsg) > 0: | 578 | if len(errormsg) > 0: |
566 | logger.warn("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg) | 579 | logger.warn("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg) |
@@ -1155,15 +1168,22 @@ class BuildInfoHelper(object): | |||
1155 | # for all image targets | 1168 | # for all image targets |
1156 | for target in self.internal_state['targets']: | 1169 | for target in self.internal_state['targets']: |
1157 | if target.is_image: | 1170 | if target.is_image: |
1171 | pkgdata = BuildInfoHelper._get_data_from_event(event)['pkgdata'] | ||
1172 | imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target] | ||
1173 | filedata = BuildInfoHelper._get_data_from_event(event)['filedata'][target.target] | ||
1174 | |||
1158 | try: | 1175 | try: |
1159 | pkgdata = BuildInfoHelper._get_data_from_event(event)['pkgdata'] | ||
1160 | imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target] | ||
1161 | self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes']) | 1176 | self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes']) |
1162 | filedata = BuildInfoHelper._get_data_from_event(event)['filedata'][target.target] | 1177 | except KeyError as e: |
1178 | logger.warn("KeyError in save_target_package_information" | ||
1179 | "%s ", e) | ||
1180 | |||
1181 | try: | ||
1163 | self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata) | 1182 | self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata) |
1164 | except KeyError: | 1183 | except KeyError as e: |
1165 | # we must have not got the data for this image, nothing to save | 1184 | logger.warn("KeyError in save_target_file_information" |
1166 | pass | 1185 | "%s ", e) |
1186 | |||
1167 | 1187 | ||
1168 | 1188 | ||
1169 | 1189 | ||