diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-01-17 17:58:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-27 21:01:07 +0000 |
commit | e5b3918bb9b334ad077213e8ea039789da440ee2 (patch) | |
tree | afec7eea7f6fd9cf855203df030d041778cf8e4e /bitbake | |
parent | 9677275d0de94108689db300ca4637a2774ab2e3 (diff) | |
download | poky-e5b3918bb9b334ad077213e8ea039789da440ee2.tar.gz |
bitbake: toaster: fix package data gathering
Under OE-Core, the name under which a package would
be installed in a target may have been different than the
name under it has been built or recorded in the dependencies
listings.
This patch addresses the way that Toaster records package
names, and adds the field of "installed_name" to save the
name under which a package have been installed in an image.
(Bitbake rev: 24e0367429b248108b104ab5a2af05efcf7a8c39)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 14 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/migrations/0004_auto__add_field_package_installed_name.py | 180 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 1 |
3 files changed, 193 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 3b4d7c9c10..0a8073f916 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -152,13 +152,18 @@ class ORMWrapper(object): | |||
152 | 152 | ||
153 | def save_target_package_information(self, build_obj, target_obj, packagedict, pkgpnmap, recipes): | 153 | def save_target_package_information(self, build_obj, target_obj, packagedict, pkgpnmap, recipes): |
154 | for p in packagedict: | 154 | for p in packagedict: |
155 | packagedict[p]['object'], created = Package.objects.get_or_create( build = build_obj, name = p ) | 155 | searchname = p |
156 | if 'OPKGN' in pkgpnmap[p].keys(): | ||
157 | searchname = pkgpnmap[p]['OPKGN'] | ||
158 | |||
159 | packagedict[p]['object'], created = Package.objects.get_or_create( build = build_obj, name = searchname ) | ||
156 | if created: | 160 | if created: |
157 | # package was not build in the current build, but | 161 | # package was not build in the current build, but |
158 | # fill in everything we can from the runtime-reverse package data | 162 | # fill in everything we can from the runtime-reverse package data |
159 | try: | 163 | try: |
160 | packagedict[p]['object'].recipe = recipes[pkgpnmap[p]['PN']] | 164 | packagedict[p]['object'].recipe = recipes[pkgpnmap[p]['PN']] |
161 | packagedict[p]['object'].version = pkgpnmap[p]['PV'] | 165 | packagedict[p]['object'].version = pkgpnmap[p]['PV'] |
166 | packagedict[p]['object'].installed_name = p | ||
162 | packagedict[p]['object'].revision = pkgpnmap[p]['PR'] | 167 | packagedict[p]['object'].revision = pkgpnmap[p]['PR'] |
163 | packagedict[p]['object'].license = pkgpnmap[p]['LICENSE'] | 168 | packagedict[p]['object'].license = pkgpnmap[p]['LICENSE'] |
164 | packagedict[p]['object'].section = pkgpnmap[p]['SECTION'] | 169 | packagedict[p]['object'].section = pkgpnmap[p]['SECTION'] |
@@ -209,9 +214,14 @@ class ORMWrapper(object): | |||
209 | 214 | ||
210 | def save_build_package_information(self, build_obj, package_info, recipes): | 215 | def save_build_package_information(self, build_obj, package_info, recipes): |
211 | # create and save the object | 216 | # create and save the object |
217 | pname = package_info['PKG'] | ||
218 | if 'OPKGN' in package_info.keys(): | ||
219 | pname = package_info['OPKGN'] | ||
220 | |||
212 | bp_object, created = Package.objects.get_or_create( build = build_obj, | 221 | bp_object, created = Package.objects.get_or_create( build = build_obj, |
213 | name = package_info['PKG'] ) | 222 | name = pname ) |
214 | 223 | ||
224 | bp_object.installed_name = package_info['PKG'] | ||
215 | bp_object.recipe = recipes[package_info['PN']] | 225 | bp_object.recipe = recipes[package_info['PN']] |
216 | bp_object.version = package_info['PKGV'] | 226 | bp_object.version = package_info['PKGV'] |
217 | bp_object.revision = package_info['PKGR'] | 227 | bp_object.revision = package_info['PKGR'] |
diff --git a/bitbake/lib/toaster/orm/migrations/0004_auto__add_field_package_installed_name.py b/bitbake/lib/toaster/orm/migrations/0004_auto__add_field_package_installed_name.py new file mode 100644 index 0000000000..ca114de6bf --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0004_auto__add_field_package_installed_name.py | |||
@@ -0,0 +1,180 @@ | |||
1 | # -*- coding: utf-8 -*- | ||
2 | from south.utils import datetime_utils as datetime | ||
3 | from south.db import db | ||
4 | from south.v2 import SchemaMigration | ||
5 | from django.db import models | ||
6 | |||
7 | |||
8 | class Migration(SchemaMigration): | ||
9 | |||
10 | def forwards(self, orm): | ||
11 | # Adding field 'Package.installed_name' | ||
12 | db.add_column(u'orm_package', 'installed_name', | ||
13 | self.gf('django.db.models.fields.CharField')(default='', max_length=100), | ||
14 | keep_default=False) | ||
15 | |||
16 | |||
17 | def backwards(self, orm): | ||
18 | # Deleting field 'Package.installed_name' | ||
19 | db.delete_column(u'orm_package', 'installed_name') | ||
20 | |||
21 | |||
22 | models = { | ||
23 | u'orm.build': { | ||
24 | 'Meta': {'object_name': 'Build'}, | ||
25 | 'bitbake_version': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
26 | 'build_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
27 | 'completed_on': ('django.db.models.fields.DateTimeField', [], {}), | ||
28 | 'cooker_log_path': ('django.db.models.fields.CharField', [], {'max_length': '500'}), | ||
29 | 'distro': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
30 | 'distro_version': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
31 | 'errors_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
32 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
33 | 'image_fstypes': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
34 | 'machine': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
35 | 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '2'}), | ||
36 | 'started_on': ('django.db.models.fields.DateTimeField', [], {}), | ||
37 | 'warnings_no': ('django.db.models.fields.IntegerField', [], {'default': '0'}) | ||
38 | }, | ||
39 | u'orm.layer': { | ||
40 | 'Meta': {'object_name': 'Layer'}, | ||
41 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
42 | 'layer_index_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), | ||
43 | 'local_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}), | ||
44 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
45 | }, | ||
46 | u'orm.layer_version': { | ||
47 | 'Meta': {'object_name': 'Layer_Version'}, | ||
48 | 'branch': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | ||
49 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_build'", 'to': u"orm['orm.Build']"}), | ||
50 | 'commit': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
51 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
52 | 'layer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'layer_version_layer'", 'to': u"orm['orm.Layer']"}), | ||
53 | 'priority': ('django.db.models.fields.IntegerField', [], {}) | ||
54 | }, | ||
55 | u'orm.logmessage': { | ||
56 | 'Meta': {'object_name': 'LogMessage'}, | ||
57 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
58 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
59 | 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
60 | 'lineno': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
61 | 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}), | ||
62 | 'pathname': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}) | ||
63 | }, | ||
64 | u'orm.package': { | ||
65 | 'Meta': {'object_name': 'Package'}, | ||
66 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
67 | 'description': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), | ||
68 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
69 | 'installed_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '100'}), | ||
70 | 'installed_size': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
71 | 'license': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}), | ||
72 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
73 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Recipe']", 'null': 'True'}), | ||
74 | 'revision': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), | ||
75 | 'section': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}), | ||
76 | 'size': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
77 | 'summary': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), | ||
78 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}) | ||
79 | }, | ||
80 | u'orm.package_dependency': { | ||
81 | 'Meta': {'object_name': 'Package_Dependency'}, | ||
82 | 'dep_type': ('django.db.models.fields.IntegerField', [], {}), | ||
83 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_target'", 'to': u"orm['orm.Package']"}), | ||
84 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
85 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'package_dependencies_source'", 'to': u"orm['orm.Package']"}), | ||
86 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']", 'null': 'True'}) | ||
87 | }, | ||
88 | u'orm.package_file': { | ||
89 | 'Meta': {'object_name': 'Package_File'}, | ||
90 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
91 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'buildfilelist_package'", 'to': u"orm['orm.Package']"}), | ||
92 | 'path': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
93 | 'size': ('django.db.models.fields.IntegerField', [], {}) | ||
94 | }, | ||
95 | u'orm.recipe': { | ||
96 | 'Meta': {'object_name': 'Recipe'}, | ||
97 | 'bugtracker': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), | ||
98 | 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
99 | 'file_path': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}), | ||
100 | 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), | ||
101 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
102 | 'layer_version': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recipe_layer_version'", 'to': u"orm['orm.Layer_Version']"}), | ||
103 | 'license': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), | ||
104 | 'licensing_info': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
105 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
106 | 'section': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
107 | 'summary': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
108 | 'version': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}) | ||
109 | }, | ||
110 | u'orm.recipe_dependency': { | ||
111 | 'Meta': {'object_name': 'Recipe_Dependency'}, | ||
112 | 'dep_type': ('django.db.models.fields.IntegerField', [], {}), | ||
113 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_depends'", 'to': u"orm['orm.Recipe']"}), | ||
114 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
115 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'r_dependencies_recipe'", 'to': u"orm['orm.Recipe']"}) | ||
116 | }, | ||
117 | u'orm.target': { | ||
118 | 'Meta': {'object_name': 'Target'}, | ||
119 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Build']"}), | ||
120 | 'file_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
121 | 'file_size': ('django.db.models.fields.IntegerField', [], {}), | ||
122 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
123 | 'is_image': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
124 | 'target': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
125 | }, | ||
126 | u'orm.target_installed_package': { | ||
127 | 'Meta': {'object_name': 'Target_Installed_Package'}, | ||
128 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
129 | 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Package']"}), | ||
130 | 'target': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['orm.Target']"}) | ||
131 | }, | ||
132 | u'orm.task': { | ||
133 | 'Meta': {'ordering': "('order', 'recipe')", 'object_name': 'Task'}, | ||
134 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_build'", 'to': u"orm['orm.Build']"}), | ||
135 | 'cpu_usage': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2'}), | ||
136 | 'disk_io': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
137 | 'elapsed_time': ('django.db.models.fields.CharField', [], {'default': '0', 'max_length': '50'}), | ||
138 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
139 | 'line_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
140 | 'logfile': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
141 | 'message': ('django.db.models.fields.CharField', [], {'max_length': '240'}), | ||
142 | 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
143 | 'outcome': ('django.db.models.fields.IntegerField', [], {'default': '5'}), | ||
144 | 'path_to_sstate_obj': ('django.db.models.fields.FilePathField', [], {'max_length': '500', 'blank': 'True'}), | ||
145 | 'recipe': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'build_recipe'", 'to': u"orm['orm.Recipe']"}), | ||
146 | 'script_type': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
147 | 'source_url': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}), | ||
148 | 'sstate_checksum': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), | ||
149 | 'sstate_result': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | ||
150 | 'task_executed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
151 | 'task_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
152 | 'work_directory': ('django.db.models.fields.FilePathField', [], {'max_length': '255', 'blank': 'True'}) | ||
153 | }, | ||
154 | u'orm.task_dependency': { | ||
155 | 'Meta': {'object_name': 'Task_Dependency'}, | ||
156 | 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_depends'", 'to': u"orm['orm.Task']"}), | ||
157 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
158 | 'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'task_dependencies_task'", 'to': u"orm['orm.Task']"}) | ||
159 | }, | ||
160 | u'orm.variable': { | ||
161 | 'Meta': {'object_name': 'Variable'}, | ||
162 | 'build': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'variable_build'", 'to': u"orm['orm.Build']"}), | ||
163 | 'changed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
164 | 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), | ||
165 | 'human_readable_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), | ||
166 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
167 | 'variable_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
168 | 'variable_value': ('django.db.models.fields.TextField', [], {'blank': 'True'}) | ||
169 | }, | ||
170 | u'orm.variablehistory': { | ||
171 | 'Meta': {'object_name': 'VariableHistory'}, | ||
172 | 'file_name': ('django.db.models.fields.FilePathField', [], {'max_length': '255'}), | ||
173 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
174 | 'line_number': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), | ||
175 | 'operation': ('django.db.models.fields.CharField', [], {'max_length': '16'}), | ||
176 | 'variable': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'vhistory'", 'to': u"orm['orm.Variable']"}) | ||
177 | } | ||
178 | } | ||
179 | |||
180 | complete_apps = ['orm'] \ No newline at end of file | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 81dae48e10..3abee016c4 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -148,6 +148,7 @@ class Package(models.Model): | |||
148 | build = models.ForeignKey('Build') | 148 | build = models.ForeignKey('Build') |
149 | recipe = models.ForeignKey('Recipe', null=True) | 149 | recipe = models.ForeignKey('Recipe', null=True) |
150 | name = models.CharField(max_length=100) | 150 | name = models.CharField(max_length=100) |
151 | installed_name = models.CharField(max_length=100, default='') | ||
151 | version = models.CharField(max_length=100, blank=True) | 152 | version = models.CharField(max_length=100, blank=True) |
152 | revision = models.CharField(max_length=32, blank=True) | 153 | revision = models.CharField(max_length=32, blank=True) |
153 | summary = models.CharField(max_length=200, blank=True) | 154 | summary = models.CharField(max_length=200, blank=True) |