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:
parent
f48d34a79f
commit
6a4b5469f6
1 changed files with 7 additions and 9 deletions
|
|
@ -162,18 +162,16 @@ jobs:
|
|||
if ls ../*.deb >/dev/null 2>&1; then
|
||||
echo "✅ Debian package created successfully"
|
||||
ls -la ../*.deb
|
||||
|
||||
|
||||
# Rename packages with build version to ensure uniqueness
|
||||
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"
|
||||
|
|
@ -182,7 +180,7 @@ jobs:
|
|||
cp "$pkg" .
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo "✅ Packages renamed and copied to current directory"
|
||||
ls -la *.deb
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue