mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
import_layers: import other missing items
Import Machine, Distro, BBClass, BBAppend, IncFile objects. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
150b774cce
commit
71ff6571c6
|
@ -67,7 +67,7 @@ def main():
|
||||||
|
|
||||||
utils.setup_django()
|
utils.setup_django()
|
||||||
import settings
|
import settings
|
||||||
from layerindex.models import Branch, LayerItem, LayerBranch, LayerDependency, LayerMaintainer, LayerNote, Recipe, Source, Patch, PackageConfig, StaticBuildDep, DynamicBuildDep, RecipeFileDependency
|
from layerindex.models import Branch, LayerItem, LayerBranch, LayerDependency, LayerMaintainer, LayerNote, Recipe, Source, Patch, PackageConfig, StaticBuildDep, DynamicBuildDep, RecipeFileDependency, Machine, Distro, BBClass, BBAppend, IncFile
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
logger.setLevel(options.loglevel)
|
logger.setLevel(options.loglevel)
|
||||||
|
@ -96,6 +96,11 @@ def main():
|
||||||
layermaintainers_url = jsdata.get('layerMaintainers', None)
|
layermaintainers_url = jsdata.get('layerMaintainers', None)
|
||||||
layernotes_url = jsdata.get('layerNotes', None)
|
layernotes_url = jsdata.get('layerNotes', None)
|
||||||
recipes_url = jsdata.get('recipes', None)
|
recipes_url = jsdata.get('recipes', None)
|
||||||
|
machines_url = jsdata.get('machines', None)
|
||||||
|
distros_url = jsdata.get('distros', None)
|
||||||
|
classes_url = jsdata.get('classes', None)
|
||||||
|
appends_url = jsdata.get('appends', None)
|
||||||
|
incfiles_url = jsdata.get('incFiles', None)
|
||||||
|
|
||||||
logger.debug('Getting branches')
|
logger.debug('Getting branches')
|
||||||
|
|
||||||
|
@ -303,6 +308,49 @@ def main():
|
||||||
custom_field_cb=recipe_field_handler,
|
custom_field_cb=recipe_field_handler,
|
||||||
key_fields=['pn'])
|
key_fields=['pn'])
|
||||||
|
|
||||||
|
if machines_url:
|
||||||
|
import_child_items(layerbranch,
|
||||||
|
Machine,
|
||||||
|
url=machines_url,
|
||||||
|
parent_orig_id=layerbranchjs['id'],
|
||||||
|
exclude_fields=['id', 'layerbranch', 'updated'],
|
||||||
|
key_fields=['name'])
|
||||||
|
|
||||||
|
if distros_url:
|
||||||
|
import_child_items(layerbranch,
|
||||||
|
Distro,
|
||||||
|
url=distros_url,
|
||||||
|
parent_orig_id=layerbranchjs['id'],
|
||||||
|
exclude_fields=['id', 'layerbranch', 'updated'],
|
||||||
|
key_fields=['name'])
|
||||||
|
|
||||||
|
# The models below don't have an "updated" field at present, but it does
|
||||||
|
# no harm to leave it as excluded in case it does get added in the future
|
||||||
|
|
||||||
|
if classes_url:
|
||||||
|
import_child_items(layerbranch,
|
||||||
|
BBClass,
|
||||||
|
url=classes_url,
|
||||||
|
parent_orig_id=layerbranchjs['id'],
|
||||||
|
exclude_fields=['id', 'layerbranch', 'updated'],
|
||||||
|
key_fields=['name'])
|
||||||
|
|
||||||
|
if appends_url:
|
||||||
|
import_child_items(layerbranch,
|
||||||
|
BBAppend,
|
||||||
|
url=appends_url,
|
||||||
|
parent_orig_id=layerbranchjs['id'],
|
||||||
|
exclude_fields=['id', 'layerbranch', 'updated'],
|
||||||
|
key_fields=['filename'])
|
||||||
|
|
||||||
|
if incfiles_url:
|
||||||
|
import_child_items(layerbranch,
|
||||||
|
IncFile,
|
||||||
|
url=incfiles_url,
|
||||||
|
parent_orig_id=layerbranchjs['id'],
|
||||||
|
exclude_fields=['id', 'layerbranch', 'updated'],
|
||||||
|
key_fields=['path'])
|
||||||
|
|
||||||
|
|
||||||
# Get layer dependencies
|
# Get layer dependencies
|
||||||
logger.debug('Importing layer dependencies')
|
logger.debug('Importing layer dependencies')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user