fix: Replace bash-specific regex with POSIX-compliant shell syntax

- Replace [[ =~ ]] regex pattern with grep + sed for compatibility
- Remove bash-specific BASH_REMATCH array usage
- Use POSIX-compliant shell commands for package renaming
- Fix syntax error that was causing CI workflow to fail
- Clean up trailing spaces for yamllint compliance

Resolves shell syntax error in CI workflow package renaming logic.
This commit is contained in:
joe 2025-08-15 15:39:07 -07:00
parent f48d34a79f
commit 6a4b5469f6

View file

@ -167,13 +167,11 @@ jobs:
echo "Renaming packages with build version..."
for pkg in ../*.deb; do
pkg_name=$(basename "$pkg")
pkg_ext="${pkg_name##*.}"
pkg_base="${pkg_name%.*}"
# Extract current version and replace with build version
if [[ "$pkg_name" =~ ^apt-ostree_([^-]+)_([^.]+)\.deb$ ]]; then
current_version="${BASH_REMATCH[1]}"
arch="${BASH_REMATCH[2]}"
# Extract current version and replace with build version using sed
if echo "$pkg_name" | grep -q "^apt-ostree_.*_.*\.deb$"; then
# Extract architecture (last part before .deb)
arch=$(echo "$pkg_name" | sed 's/.*_\([^.]*\)\.deb$/\1/')
new_name="apt-ostree_${BUILD_VERSION}_${arch}.deb"
echo "Renaming: $pkg_name -> $new_name"
cp "$pkg" "$new_name"