scripts/rrs_update/__init__.py: Improve remove old recipes

Now if recipe have two differente versions there are compared using
bb.utils.vercmp_string in order to delete the old one.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
Aníbal Limón 2015-01-15 16:51:58 -06:00
parent 9a5de0e7ec
commit 27c318542f

View File

@ -112,17 +112,23 @@ class RrsUpdater:
recipe.delete() recipe.delete()
self._logger.debug('_remove_native_recipes: %s delete' % (recipe.pn)) self._logger.debug('_remove_native_recipes: %s delete' % (recipe.pn))
def _remove_older_recipes(self, cmp_recipe): def _remove_older_recipes(self, recipe):
pname = cmp_recipe.pn # get recipes with the same pn
pversion = cmp_recipe.pv recipes = Recipe.objects.filter(pn__iexact = recipe.pn)
recipes = Recipe.objects.filter(pn__iexact = pname).filter(pv__lt = pversion)
if recipes.count(): if recipes.count() == 1:
# Remove git recipes with no versioning if tarballs exist return
if pversion == 'git':
Recipe.objects.filter(pn__exact = pname).filter(pv__exact = if 'git' in recipe.pv:
pversion).delete() recipe.delete()
else: else:
recipes.delete() # remove recipes that have minor version
for r in recipes:
if r.id == recipe.id:
continue
if bb.utils.vercmp_string(r.pv, recipe.pv) == -1:
r.delete()
""" """
Get configuration data required by tinfoil for poky layer. Get configuration data required by tinfoil for poky layer.