aboutsummaryrefslogtreecommitdiffstats
path: root/rrs/models.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-04-03 15:30:00 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commit6a332c5d8fa9ceb59be7f5e1c1db5dda11cd55ce (patch)
treefa1d9cdf76247400453a4516ce706138f0f507a2 /rrs/models.py
parent0d112b1d9749da4b6b527ae24c328b3d85e7d1b2 (diff)
downloadopenembedded-core-contrib-6a332c5d8fa9ceb59be7f5e1c1db5dda11cd55ce.tar.gz
rrs: handle linking maintainership
Provide a mechanism set the maintainer for things like gcc-cross-<arch> to the same as gcc. (We do have entries in the .inc file for these, however they aren't useful as they don't match the recipe name when we parse it, and due to the fact that RecipeMaintainer objects link directly to Recipe objects, we can't handle entries that don't map to a real recipe). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'rrs/models.py')
-rw-r--r--rrs/models.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/rrs/models.py b/rrs/models.py
index 536f3b1329..c86dc93ece 100644
--- a/rrs/models.py
+++ b/rrs/models.py
@@ -408,3 +408,23 @@ class RecipeUpgrade(models.Model):
return '%s: (%s, %s)' % (self.recipe.pn, self.version,
self.commit_date)
+
+class RecipeMaintenanceLink(models.Model):
+ pn_match = models.CharField(max_length=100, help_text='Expression to match against pn of recipes that should be linked (glob expression)')
+ pn_target = models.CharField(max_length=100, help_text='Name of recipe to link to')
+
+ @staticmethod
+ def link_maintainer(pn, rmh):
+ import fnmatch
+ for rml in RecipeMaintenanceLink.objects.all():
+ if fnmatch.fnmatch(pn, rml.pn_match):
+ recipe_link_objs = rmh.layerbranch.recipe_set.filter(pn=rml.pn_target)
+ if recipe_link_objs:
+ lrm = RecipeMaintainer.objects.filter(recipe=recipe_link_objs[0], history=rmh)
+ if lrm:
+ return lrm[0]
+ return None
+
+
+ def __str__(self):
+ return '%s -> %s' % (self.pn_match, self.pn_target)