fix: correct bash syntax error in build workflow
Fixes 'syntax error near unexpected token else' in build step.
The if/else structure was broken with nested conditionals causing
an orphaned else statement. Restructured to proper if-then-else flow.
Error was:
line 60: syntax error near unexpected token 'else'
Fixed structure:
if build_succeeds; then
if ipk_exists; then success; else no_ipk; fi
else
build_failed
fi
This commit is contained in:
parent
0e5907da58
commit
1e9bc16aa7
18
.github/workflows/build-openwrt-packages.yml
vendored
18
.github/workflows/build-openwrt-packages.yml
vendored
@ -500,24 +500,14 @@ jobs:
|
|||||||
|
|
||||||
# Build with timeout (10 minutes per package)
|
# Build with timeout (10 minutes per package)
|
||||||
BUILD_LOG="/tmp/build-${PKG_NAME}.log"
|
BUILD_LOG="/tmp/build-${PKG_NAME}.log"
|
||||||
|
|
||||||
# Our packages are PKGARCH:=all (pure scripts), no compilation needed
|
# Our packages are PKGARCH:=all (pure scripts), no compilation needed
|
||||||
# Try regular build first, fallback to direct packaging if dependencies fail
|
# Try regular build first, fallback to direct packaging if dependencies fail
|
||||||
if timeout 600 make package/${PKG_NAME}/compile V=s -j1 > "$BUILD_LOG" 2>&1; then
|
if timeout 600 make package/${PKG_NAME}/compile V=s -j1 > "$BUILD_LOG" 2>&1; then
|
||||||
BUILD_METHOD="standard"
|
# Build succeeded, check if .ipk was created
|
||||||
else
|
IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1)
|
||||||
echo "⚠️ Standard build failed (likely dependency issues), trying direct packaging..."
|
|
||||||
# Create .ipk directly using luci.mk template
|
|
||||||
BUILD_METHOD="direct"
|
|
||||||
if timeout 300 make package/${PKG_NAME}/prepare package/${PKG_NAME}/configure > "$BUILD_LOG" 2>&1; then
|
|
||||||
make package/index || true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if .ipk was created
|
if [[ -n "$IPK_FILE" ]]; then
|
||||||
IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1)
|
|
||||||
|
|
||||||
if [[ -n "$IPK_FILE" ]]; then
|
|
||||||
echo "✅ Built: $PKG_NAME"
|
echo "✅ Built: $PKG_NAME"
|
||||||
echo " → $IPK_FILE"
|
echo " → $IPK_FILE"
|
||||||
BUILT=$((BUILT + 1))
|
BUILT=$((BUILT + 1))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user