sonic-buildimage/files/build_templates/packages.json.j2
Stepan Blyshchak a294bfb03b
[sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated (#8044)
After https://github.com/Azure/sonic-buildimage/pull/7598 the packages.json generation is broken. This change fixes it make the whole build fail in case generation failed.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
2021-07-09 12:29:33 -07:00

24 lines
974 B
Django/Jinja

{%- set docker_installation_targets = [] -%}
{%- for docker_installation_target in installer_images.strip().split() -%}
{%- set pkgname, docker_build_path, machine, image = docker_installation_target.split('|') -%}
{%- if not machine or (machine and machine == target_machine) -%}
{%- set _ = docker_installation_targets.append((pkgname, image)) -%}
{%- endif -%}
{%- endfor -%}
{
{% for pkgname, image in docker_installation_targets -%}
{% set imagefilepath = image.split(':')|first -%}
{% set imageversion = image.split(':')|last -%}
{% set imagefilename = imagefilepath.split('/')|last -%}
{% set imagename = imagefilename.split('.')|first -%}
"{{ pkgname }}": {
"repository": "{{ imagename }}",
"description": "SONiC {{ pkgname }} package",
"default-reference": "{{ imageversion }}",
"installed-version": "{{ imageversion }}",
"built-in": true,
"installed": true
}{% if not loop.last %},{% endif %}
{% endfor %}
}