kas-container: Add cleansstate and cleanall
To complete the set of clean tasks that OE and Isar offer, add cleansstate to purge SSTATE_DIR and cleanall also delete DL_DIR. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
833a65124e
commit
484a3dda97
@ -31,14 +31,19 @@ usage()
|
|||||||
{
|
{
|
||||||
printf "%b" "Usage: $0 [OPTIONS] { build | checkout | shell } [KASOPTIONS] [KASFILE]\n"
|
printf "%b" "Usage: $0 [OPTIONS] { build | checkout | shell } [KASOPTIONS] [KASFILE]\n"
|
||||||
printf "%b" " $0 [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n"
|
printf "%b" " $0 [OPTIONS] for-all-repos [KASOPTIONS] [KASFILE] COMMAND\n"
|
||||||
printf "%b" " $0 [OPTIONS] clean\n"
|
printf "%b" " $0 [OPTIONS] { clean | cleansstate | cleanall}\n"
|
||||||
printf "%b" " $0 [OPTIONS] menu [KCONFIG]\n"
|
printf "%b" " $0 [OPTIONS] menu [KCONFIG]\n"
|
||||||
printf "%b" "\nPositional arguments:\n"
|
printf "%b" "\nPositional arguments:\n"
|
||||||
printf "%b" "build\t\t\tCheck out repositories and build target.\n"
|
printf "%b" "build\t\t\tCheck out repositories and build target.\n"
|
||||||
printf "%b" "checkout\t\tCheck out repositories but do not build.\n"
|
printf "%b" "checkout\t\tCheck out repositories but do not build.\n"
|
||||||
printf "%b" "shell\t\t\tRun a shell in the build environment.\n"
|
printf "%b" "shell\t\t\tRun a shell in the build environment.\n"
|
||||||
printf "%b" "for-all-repos\t\tRun specified command in each repository.\n"
|
printf "%b" "for-all-repos\t\tRun specified command in each repository.\n"
|
||||||
printf "%b" "clean\t\t\tClean build artifacts, keep downloads.\n"
|
printf "%b" "clean\t\t\tClean build artifacts, keep sstate cache and " \
|
||||||
|
"downloads.\n"
|
||||||
|
printf "%b" "cleanstate\t\tClean build artifacts and sstate cache, " \
|
||||||
|
"keep downloads.\n"
|
||||||
|
printf "%b" "cleanall\t\tClean build artifacts, sstate cache and " \
|
||||||
|
"downloads.\n"
|
||||||
printf "%b" "menu\t\t\tProvide configuration menu and trigger " \
|
printf "%b" "menu\t\t\tProvide configuration menu and trigger " \
|
||||||
"configured build.\n"
|
"configured build.\n"
|
||||||
printf "%b" "\nOptional arguments:\n"
|
printf "%b" "\nOptional arguments:\n"
|
||||||
@ -99,6 +104,16 @@ run_clean() {
|
|||||||
else
|
else
|
||||||
trace rm -rf "${KAS_BUILD_DIR}/tmp"
|
trace rm -rf "${KAS_BUILD_DIR}/tmp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" != "clean" ]; then
|
||||||
|
SSTATE_DIR=${SSTATE_DIR:-${KAS_BUILD_DIR}/sstate-cache}
|
||||||
|
trace rm -rf "${SSTATE_DIR}"
|
||||||
|
|
||||||
|
if [ "$1" = "cleanall" ]; then
|
||||||
|
DL_DIR=${DL_DIR:-${KAS_BUILD_DIR}/downloads}
|
||||||
|
trace rm -rf "${DL_DIR}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
KAS_IMAGE_VERSION_DEFAULT="2.6.3"
|
KAS_IMAGE_VERSION_DEFAULT="2.6.3"
|
||||||
@ -220,7 +235,7 @@ while [ $# -gt 0 ]; do
|
|||||||
--*)
|
--*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
clean)
|
clean|cleansstate|cleanall)
|
||||||
[ $# -eq 1 ] || usage
|
[ $# -eq 1 ] || usage
|
||||||
run_clean "$1"
|
run_clean "$1"
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user