Skip to content

Commit 8a54967

Browse files
committed
fix: quote grep patterns in get_tag to match version delimiter correctly
The unquoted \. was likely a typo for a literal dot, but it expands to . (any char), which silently matches the - delimiter after the version. Quote the patterns and use an explicit - to match the actual tag format.
1 parent 7fa4f34 commit 8a54967

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ function install_dependencies {
2020

2121
# prints the git tag corresponding to the newest and best matching the provided kernel version $1
2222
function get_tag {
23-
local KERNEL_VERSION=$1
23+
local KERNEL_VERSION="${1}"
2424

2525
# list all tags from newest to oldest
26-
(git --no-pager tag -l --sort=-creatordate | grep microvm-kernel-$KERNEL_VERSION\..*\.amzn2 \
27-
|| git --no-pager tag -l --sort=-creatordate | grep kernel-$KERNEL_VERSION\..*\.amzn2) | head -n1
26+
(
27+
git --no-pager tag -l --sort=-creatordate | grep "microvm-kernel-${KERNEL_VERSION}-.*\.amzn2" \
28+
|| git --no-pager tag -l --sort=-creatordate | grep "kernel-${KERNEL_VERSION}-.*\.amzn2"
29+
) | head -n1
2830
}
2931

3032
function build_version {

0 commit comments

Comments
 (0)