Skip to content

Commit

Permalink
kas-container: Fix positional argument processing with for-all-repos
Browse files Browse the repository at this point in the history
While kas interprets "one positional arg" as "this is the command, use
default .config.yaml", kas-container failed in that case. This now take
the specialty into account.

Reported-by: Jörg Sommer <[email protected]>
Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Sep 3, 2024
1 parent 4e26e21 commit 1469b6d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions kas-container
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,21 @@ while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
shift 1
;;
*)
ARG="$1"
shift 1
if [ "$KAS_CMD" = "for-all-repos" ]; then
if [ $# -gt 0 ]; then
KAS_REPO_CMD="$1"
shift 1
else
KAS_REPO_CMD="$ARG"
unset ARG
fi
fi
KAS_FILES=
# SC2086: Double quote to prevent globbing and word splitting.
# shellcheck disable=2086
for FILE in $(IFS=':'; echo $1); do
for FILE in $(IFS=':'; echo $ARG); do
if ! KAS_REAL_FILE="$(realpath -qe "$FILE")"; then
fatal_error "configuration file '${FILE}' not found"
fi
Expand All @@ -368,11 +379,6 @@ while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
KAS_FILES="${KAS_FILES}:${KAS_REAL_FILE}"
fi
done
shift 1
if [ "$KAS_CMD" = "for-all-repos" ]; then
KAS_REPO_CMD="$1"
shift 1
fi
;;
esac
done
Expand Down

0 comments on commit 1469b6d

Please sign in to comment.