Skip to content

Commit 1e82d8d

Browse files
committed
fix: align bash kernel_versions.txt parser with python
Strip inline comments and trim whitespace so build.sh and scripts/validate.py produce identical version names for entries like `6.1.158 # stable`.
1 parent 9274f23 commit 1e82d8d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,15 @@ main() {
161161
local version_name="${VERSION_NAME:-$(compute_version_name "$single_version")}"
162162
build_version "$single_version" "$target_arch" "$version_name"
163163
else
164-
grep -v '^ *#' <"$SCRIPT_DIR/kernel_versions.txt" | while IFS= read -r version; do
164+
while IFS= read -r raw; do
165+
local version="${raw%%#*}"
166+
version="${version#"${version%%[![:space:]]*}"}"
167+
version="${version%"${version##*[![:space:]]}"}"
165168
[ -z "$version" ] && continue
166169
local version_name
167170
version_name="$(compute_version_name "$version")"
168171
build_version "$version" "$target_arch" "$version_name"
169-
done
172+
done <"$SCRIPT_DIR/kernel_versions.txt"
170173
fi
171174
}
172175

0 commit comments

Comments
 (0)