mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
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:
parent
9a5de0e7ec
commit
27c318542f
|
@ -112,17 +112,23 @@ class RrsUpdater:
|
|||
recipe.delete()
|
||||
self._logger.debug('_remove_native_recipes: %s delete' % (recipe.pn))
|
||||
|
||||
def _remove_older_recipes(self, cmp_recipe):
|
||||
pname = cmp_recipe.pn
|
||||
pversion = cmp_recipe.pv
|
||||
recipes = Recipe.objects.filter(pn__iexact = pname).filter(pv__lt = pversion)
|
||||
if recipes.count():
|
||||
# Remove git recipes with no versioning if tarballs exist
|
||||
if pversion == 'git':
|
||||
Recipe.objects.filter(pn__exact = pname).filter(pv__exact =
|
||||
pversion).delete()
|
||||
else:
|
||||
recipes.delete()
|
||||
def _remove_older_recipes(self, recipe):
|
||||
# get recipes with the same pn
|
||||
recipes = Recipe.objects.filter(pn__iexact = recipe.pn)
|
||||
|
||||
if recipes.count() == 1:
|
||||
return
|
||||
|
||||
if 'git' in recipe.pv:
|
||||
recipe.delete()
|
||||
else:
|
||||
# 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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user