mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-12-14 23:53:29 +00:00
ubuntu: add --comp for each optional component from the model
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
a19f30b9d6
commit
5cbea9f677
@ -42,6 +42,25 @@ get_snaps_args()
|
||||
| jq --raw-output '.snaps[] | "--snap=" + .name + "=" + .["default-channel"]'
|
||||
}
|
||||
|
||||
get_all_components()
|
||||
{
|
||||
# Get list of all components in every snaps
|
||||
local model=$1
|
||||
local jq_filter='
|
||||
# Find all snaps that have components
|
||||
.snaps[] | select(.components)
|
||||
# Then save the name of each snap in a variable
|
||||
| .name as $snap
|
||||
# Then for each entry that has "optional"
|
||||
| .components | to_entries | map(select(.value.presence == "optional"))
|
||||
# Output its name with the snap name prepended
|
||||
| "\($snap)" + "+" + .[].key'
|
||||
|
||||
sed '/^$/,$d' -- "$model" \
|
||||
| yaml_to_json \
|
||||
| jq --raw-output "$jq_filter"
|
||||
}
|
||||
|
||||
# Generation of the model:
|
||||
# * At https://github.com/canonical/models one can find a repo of raw,
|
||||
# unsigned, input .json files, and their signed .model equivalents.
|
||||
@ -91,6 +110,10 @@ else
|
||||
| grep -v -F -e pc-kernel -e snapd -e firmware-updater -e desktop-security-center)
|
||||
fi
|
||||
|
||||
for comp in $(get_all_components "$model"); do
|
||||
prepare_args+=(--comp "$comp")
|
||||
done
|
||||
|
||||
channel=""
|
||||
if [ -n "${CHANNEL:-}" ]; then
|
||||
channel="--channel $CHANNEL"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user