build_torcx_store: store additional 'metaPackage' field in torcx manifest

The torcx_manifest.json file currently has a 'sourcePackage' field which is
extracted from the first runtime dependency of the torcx package ebuild. This
is a convention, and causes sourcePackage to hold 'app-emulation/docker' for
the 'app-torcx/docker' package. This does not carry enough information to be
able to figure out what other packages are part of the torcx package.

Store an additional field, 'metaPackage', in the manifest which contains the
name of the torcx package. With the right ebuild it is then possible to figure
out what other packages are part of a given torcx package. This can then be
used to add that information to the image packages list.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2022-01-14 15:37:39 +00:00
parent 78254a18eb
commit 499fade8d3
2 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ function torcx_manifest::add_pkg() {
pkg_hash="${1}"; shift pkg_hash="${1}"; shift
cas_digest="${1}"; shift cas_digest="${1}"; shift
source_package="${1}"; shift source_package="${1}"; shift
meta_package="${1}"; shift
update_default="${1}"; shift update_default="${1}"; shift
local manifest=$(cat "${path}") local manifest=$(cat "${path}")
@ -39,6 +40,7 @@ function torcx_manifest::add_pkg() {
"hash": "${pkg_hash}", "hash": "${pkg_hash}",
"casDigest": "${cas_digest}", "casDigest": "${cas_digest}",
"sourcePackage": "${source_package}", "sourcePackage": "${source_package}",
"metaPackage": "${meta_package}",
"locations": [] "locations": []
} }
EOF EOF

View File

@ -230,6 +230,7 @@ function torcx_package() {
"sha512-${sha512sum}" \ "sha512-${sha512sum}" \
"${digest}" \ "${digest}" \
"${source_pkg}" \ "${source_pkg}" \
"${pkg}" \
"${update_default}" \ "${update_default}" \
"${pkg_locations[@]}" "${pkg_locations[@]}"
) )