mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
rrs_distros: match recipe on filename not PN
In the current RRS we should expect that more than one recipe with the same PN can exist in a layer - in fact it is common to have this (i.e. multiple versions of the same recipe). Use the filename to match the recipe record instead. At the same time, fix the exception handling. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
c629787630
commit
b34d5072d7
|
@ -22,6 +22,7 @@ from layerindex import utils
|
|||
|
||||
utils.setup_django()
|
||||
from django.db import transaction
|
||||
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
|
||||
import settings
|
||||
|
||||
logger = get_logger("RecipeDistros", settings)
|
||||
|
@ -139,11 +140,16 @@ if __name__=="__main__":
|
|||
|
||||
for recipe_data in recipes:
|
||||
pn = recipe_data.getVar('PN', True)
|
||||
fn = os.path.basename(recipe_data.getVar('FILE', True))
|
||||
|
||||
try:
|
||||
recipe = Recipe.objects.get(pn = pn, layerbranch = layerbranch)
|
||||
except:
|
||||
logger.warn('%s: layer branch %s, NOT found' % (pn,
|
||||
recipe = Recipe.objects.get(filename=fn, layerbranch=layerbranch)
|
||||
except MultipleObjectsReturned:
|
||||
logger.warn('Recipe file %s appears more than once in layerbranch %s!' % (fn,
|
||||
str(layerbranch)))
|
||||
continue
|
||||
except ObjectDoesNotExist:
|
||||
logger.warn('Recipe file %s not found in layerbranch %s' % (fn,
|
||||
str(layerbranch)))
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user