mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 19:56:35 +00:00
utils/test-pkg: clean output dir for successful builds
test-pkg will use gigabytes of space when testing all toolchains. Nevertheless, you are normally only interested in the actual build / host tree when there is a build failure. Do a 'make clean' for successful builds to save disk space, unless the new option '-k/--keep' is set. Note that the logfile and configuration is always retained for inspection. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Acked-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
989cda12ba
commit
72bf48606c
@ -13,17 +13,18 @@ do_clean() {
|
|||||||
main() {
|
main() {
|
||||||
local o O opts
|
local o O opts
|
||||||
local cfg dir pkg random toolchains_csv toolchain all number mode
|
local cfg dir pkg random toolchains_csv toolchain all number mode
|
||||||
local ret nb nb_skip nb_fail nb_legal nb_tc build_dir
|
local ret nb nb_skip nb_fail nb_legal nb_tc build_dir keep
|
||||||
local -a toolchains
|
local -a toolchains
|
||||||
local pkg_br_name
|
local pkg_br_name
|
||||||
|
|
||||||
o='hac:d:n:p:r:t:'
|
o='hakc:d:n:p:r:t:'
|
||||||
O='help,all,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:'
|
O='help,all,keep,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:'
|
||||||
opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
|
opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
|
||||||
eval set -- "${opts}"
|
eval set -- "${opts}"
|
||||||
|
|
||||||
random=0
|
random=0
|
||||||
all=0
|
all=0
|
||||||
|
keep=0
|
||||||
number=0
|
number=0
|
||||||
mode=0
|
mode=0
|
||||||
toolchains_csv="${TOOLCHAINS_CSV}"
|
toolchains_csv="${TOOLCHAINS_CSV}"
|
||||||
@ -35,6 +36,9 @@ main() {
|
|||||||
(-a|--all)
|
(-a|--all)
|
||||||
all=1; shift 1
|
all=1; shift 1
|
||||||
;;
|
;;
|
||||||
|
(-k|--keep)
|
||||||
|
keep=1; shift 1
|
||||||
|
;;
|
||||||
(-c|--config-snippet)
|
(-c|--config-snippet)
|
||||||
cfg="${2}"; shift 2
|
cfg="${2}"; shift 2
|
||||||
;;
|
;;
|
||||||
@ -176,6 +180,12 @@ build_one() {
|
|||||||
if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
|
if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If we get here, the build was successful. Clean up the build/host
|
||||||
|
# directories to save disk space, unless 'keep' was set.
|
||||||
|
if [ ${keep} -ne 1 ]; then
|
||||||
|
make O="${dir}" clean >> "${dir}/logfile" 2>&1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
@ -236,6 +246,11 @@ Options:
|
|||||||
try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be
|
try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be
|
||||||
used.
|
used.
|
||||||
|
|
||||||
|
-k, --keep
|
||||||
|
Keep the build directories even if the build succeeds.
|
||||||
|
Note: the logfile and configuration is always retained, even without
|
||||||
|
this option.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
Testing libcec would require a config snippet that contains:
|
Testing libcec would require a config snippet that contains:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user