summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2014-01-23 11:47:41 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-17 15:38:52 +0000
commit620553df864634e7061c9124ea70a90e5c067cde (patch)
treed196d7dbea61da09846e9a645f245ab931889516 /bitbake/lib/toaster/orm
parent47634378ac516496bcc155e001983973f241ee61 (diff)
downloadpoky-620553df864634e7061c9124ea70a90e5c067cde.tar.gz
bitbake: toaster: Implementation of package detail views
Adds new package detail views. The views are based on specifications found in attachments to: https://bugzilla.yoctoproject.org/show_bug.cgi?id=4328 specifically: design-1.5.1-package-details.pdf, and design-1.1.1-included-package-details. This patch includes a redefinition of constant numbers for task dependency tasks. This is needed in order to achieve sorting criteria from the design. This change invalidates currently dependency information for currently existing builds, as it breaks compatibility. [YOCTO #4328] (Bitbake rev: 6855925c06e7e5bb15ae9d0c08d77f3a9a2574bc) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm')
-rw-r--r--bitbake/lib/toaster/orm/models.py47
1 files changed, 32 insertions, 15 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 3abee016c4..113631def0 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -145,6 +145,7 @@ class Task_Dependency(models.Model):
145 145
146 146
147class Package(models.Model): 147class Package(models.Model):
148 search_allowed_fields = ['name', 'installed_name', 'section', 'summary']
148 build = models.ForeignKey('Build') 149 build = models.ForeignKey('Build')
149 recipe = models.ForeignKey('Recipe', null=True) 150 recipe = models.ForeignKey('Recipe', null=True)
150 name = models.CharField(max_length=100) 151 name = models.CharField(max_length=100)
@@ -160,23 +161,39 @@ class Package(models.Model):
160 161
161class Package_Dependency(models.Model): 162class Package_Dependency(models.Model):
162 TYPE_RDEPENDS = 0 163 TYPE_RDEPENDS = 0
163 TYPE_RPROVIDES = 1 164 TYPE_TRDEPENDS = 1
164 TYPE_RRECOMMENDS = 2 165 TYPE_RRECOMMENDS = 2
165 TYPE_RSUGGESTS = 3 166 TYPE_TRECOMMENDS = 3
166 TYPE_RREPLACES = 4 167 TYPE_RSUGGESTS = 4
167 TYPE_RCONFLICTS = 5 168 TYPE_RPROVIDES = 5
168 TYPE_TRDEPENDS = 6 169 TYPE_RREPLACES = 6
169 TYPE_TRECOMMENDS = 7 170 TYPE_RCONFLICTS = 7
171 ' TODO: bpackage should be changed to remove the DEPENDS_TYPE access '
170 DEPENDS_TYPE = ( 172 DEPENDS_TYPE = (
171 (TYPE_RDEPENDS, "rdepends"), 173 (TYPE_RDEPENDS, "depends"),
172 (TYPE_RPROVIDES, "rprovides"), 174 (TYPE_TRDEPENDS, "depends"),
173 (TYPE_RRECOMMENDS, "rrecommends"), 175 (TYPE_TRECOMMENDS, "recommends"),
174 (TYPE_RSUGGESTS, "rsuggests"), 176 (TYPE_RRECOMMENDS, "recommends"),
175 (TYPE_RREPLACES, "rreplaces"), 177 (TYPE_RSUGGESTS, "suggests"),
176 (TYPE_RCONFLICTS, "rconflicts"), 178 (TYPE_RPROVIDES, "provides"),
177 (TYPE_TRDEPENDS, "trdepends"), 179 (TYPE_RREPLACES, "replaces"),
178 (TYPE_TRECOMMENDS, "trecommends"), 180 (TYPE_RCONFLICTS, "conflicts"),
179 ) 181 )
182 ''' Indexed by dep_type, in view order, key for short name and help
183 description which when viewed will be printf'd with the
184 package name.
185 '''
186 DEPENDS_DICT = {
187 TYPE_RDEPENDS : ("depends", "%s is required to run %s"),
188 TYPE_TRDEPENDS : ("depends", "%s is required to run %s"),
189 TYPE_TRECOMMENDS : ("recommends", "%s extends the usability of %s"),
190 TYPE_RRECOMMENDS : ("recommends", "%s extends the usability of %s"),
191 TYPE_RSUGGESTS : ("suggests", "%s is suggested for installation with %s"),
192 TYPE_RPROVIDES : ("provides", "%s is provided by %s"),
193 TYPE_RREPLACES : ("replaces", "%s is replaced by %s"),
194 TYPE_RCONFLICTS : ("conflicts", "%s conflicts with %s, which will not be installed if this package is not first removed"),
195 }
196
180 package = models.ForeignKey(Package, related_name='package_dependencies_source') 197 package = models.ForeignKey(Package, related_name='package_dependencies_source')
181 depends_on = models.ForeignKey(Package, related_name='package_dependencies_target') # soft dependency 198 depends_on = models.ForeignKey(Package, related_name='package_dependencies_target') # soft dependency
182 dep_type = models.IntegerField(choices=DEPENDS_TYPE) 199 dep_type = models.IntegerField(choices=DEPENDS_TYPE)
@@ -184,7 +201,7 @@ class Package_Dependency(models.Model):
184 201
185class Target_Installed_Package(models.Model): 202class Target_Installed_Package(models.Model):
186 target = models.ForeignKey(Target) 203 target = models.ForeignKey(Target)
187 package = models.ForeignKey(Package) 204 package = models.ForeignKey(Package, related_name='buildtargetlist_package')
188 205
189class Package_File(models.Model): 206class Package_File(models.Model):
190 package = models.ForeignKey(Package, related_name='buildfilelist_package') 207 package = models.ForeignKey(Package, related_name='buildfilelist_package')