#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) . config/options "" # This function is passed a list of package.mk paths to be processed. # Each package.mk is sourced with relevant variables output in JSON format. json_worker() { local packages="$@" local pkgpath hierarchy exited exit() { exited=1; } for pkgpath in ${packages}; do pkgpath="${pkgpath%%@*}" exited=0 if ! source_package "${pkgpath}/package.mk" &>/dev/null; then unset -f exit die "$(print_color CLR_ERROR "FAILURE: sourcing package ${pkgpath}/package.mk")" fi [ ${exited} -eq 1 ] && continue [[ ${pkgpath} =~ ^${ROOT}/${PACKAGES}/ ]] && hierarchy="global" || hierarchy="local" cat <