kas-container: Add support for checkout and for-all-repos

Allow invoking those two new sub-commands also via the container
interface.

Closes #51
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2021-05-20 15:57:22 +02:00
parent 0e470dc644
commit 46eabc7be3
2 changed files with 11 additions and 3 deletions

View File

@ -40,7 +40,7 @@ fi
if [ -n "$1" ]; then
case "$1" in
build|shell|-*)
build|checkout|for-all-repos|shell|-*)
exec $GOSU kas "$@"
;;
*)

View File

@ -29,7 +29,8 @@ set -e
usage()
{
printf "%b" "Usage: $0 [OPTIONS] { build | shell } [KASOPTIONS] KASFILE\n"
printf "%b" "Usage: $0 [OPTIONS] { build | checkout | shell } [KASOPTIONS] KASFILE\n"
printf "%b" " $0 [OPTIONS] for-all-repos KASFILE COMMAND\n"
printf "%b" " $0 [OPTIONS] clean\n"
printf "%b" "\nPositional arguments:\n"
printf "%b" "build\t\t\tCheck out repositories and build target.\n"
@ -219,7 +220,7 @@ while [ $# -gt 0 ]; do
shift 1
break
;;
build)
build|checkout|for-all-repos)
KAS_REPO_MOUNT_OPT_DEFAULT="ro"
KAS_CMD=$1
shift 1
@ -277,6 +278,10 @@ while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
fi
done
shift 1
if [ "$KAS_CMD" = "for-all-repos" ]; then
KAS_REPO_CMD="$1"
shift 1
fi
;;
esac
done
@ -410,6 +415,9 @@ fi
# SC2086: Double quote to prevent globbing and word splitting.
# shellcheck disable=2086
set -- "$@" ${KAS_FILES}
if [ "$KAS_CMD" = "for-all-repos" ]; then
set -- "$@" "${KAS_REPO_CMD}"
fi
# rotate any extra bitbake args from the front to the end of the argument list
while [ $KAS_EXTRA_BITBAKE_ARGS -gt 0 ]; do