update_classic_status: update for other distro comparisons

* Only apply OE-Classic-specific logic after checking that it's actually
  OE-Classic
* Ignore recipes marked deleted

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-05-14 15:26:24 +12:00
parent 87e27a26d5
commit cbdd7771dd

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
# Update migration info in OE-Classic recipes in OE layer index database # Update cover info for OE-Classic / other distro recipes in OE layer index database
# #
# Copyright (C) 2013 Intel Corporation # Copyright (C) 2013, 2018 Intel Corporation
# Author: Paul Eggleton <paul.eggleton@linux.intel.com> # Author: Paul Eggleton <paul.eggleton@linux.intel.com>
# #
# Licensed under the MIT license, see COPYING.MIT for details # Licensed under the MIT license, see COPYING.MIT for details
@ -17,7 +17,7 @@ import re
import utils import utils
import logging import logging
logger = utils.logger_create('LayerIndexClassicUpdate') logger = utils.logger_create('LayerIndexComparisonUpdate')
class DryRunRollbackException(Exception): class DryRunRollbackException(Exception):
pass pass
@ -70,7 +70,7 @@ def main():
def recipe_pn_query(pn): def recipe_pn_query(pn):
return Recipe.objects.filter(layerbranch__branch__name='master').filter(pn=pn).order_by('-layerbranch__layer__index_preference') return Recipe.objects.filter(layerbranch__branch__name='master').filter(pn=pn).order_by('-layerbranch__layer__index_preference')
recipequery = ClassicRecipe.objects.filter(layerbranch=layerbranch).filter(cover_status__in=['U', 'N']) recipequery = ClassicRecipe.objects.filter(layerbranch=layerbranch).filter(deleted=False).filter(cover_status__in=['U', 'N'])
for recipe in recipequery: for recipe in recipequery:
replquery = recipe_pn_query(recipe.pn) replquery = recipe_pn_query(recipe.pn)
found = False found = False
@ -83,6 +83,7 @@ def main():
found = True found = True
break break
if not found: if not found:
if layerbranch.layer.name == 'oe-classic':
if recipe.pn.endswith('-native') or recipe.pn.endswith('-nativesdk'): if recipe.pn.endswith('-native') or recipe.pn.endswith('-nativesdk'):
searchpn, _, suffix = recipe.pn.rpartition('-') searchpn, _, suffix = recipe.pn.rpartition('-')
replquery = recipe_pn_query(searchpn) replquery = recipe_pn_query(searchpn)