forked from ROCKNIX/distribution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewplan
executable file
·29 lines (21 loc) · 991 Bytes
/
viewplan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
unset _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL _DEBUG_DEPENDS_LIST _DEBUG_PACKAGE_LIST
. config/options ""
. config/multithread
# Fake the parallel command if GNU parallel is not available - slow, but works.
fake_parallel() {
while read -r line; do
json_worker "${line}"
done
}
PARALLEL_BIN=${TOOLCHAIN}/bin/parallel
[ -x ${PARALLEL_BIN} ] || PARALLEL_BIN=parallel
command -v ${PARALLEL_BIN} >/dev/null || PARALLEL_BIN=fake_parallel
# pipefail: return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status
set -o pipefail
cat ${_CACHE_PACKAGE_GLOBAL} ${_CACHE_PACKAGE_LOCAL} | \
${PARALLEL_BIN} --plain --no-notice --max-args 30 --halt now,fail=1 json_worker | \
${SCRIPTS}/genbuildplan.py --no-reorder --show-wants --build ${@:-image} --warn-invalid ${GENFLAGS} || \
die "FAILURE: Unable to generate plan"