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:
CyberMind-FR 2025-12-25 20:17:00 +01:00
parent 0e5907da58
commit 1e9bc16aa7

View File

@ -500,24 +500,14 @@ jobs:
# Build with timeout (10 minutes per package)
BUILD_LOG="/tmp/build-${PKG_NAME}.log"
# Our packages are PKGARCH:=all (pure scripts), no compilation needed
# 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
BUILD_METHOD="standard"
else
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
# Build succeeded, check if .ipk was created
IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1)
# Check if .ipk was created
IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1)
if [[ -n "$IPK_FILE" ]]; then
if [[ -n "$IPK_FILE" ]]; then
echo "✅ Built: $PKG_NAME"
echo " → $IPK_FILE"
BUILT=$((BUILT + 1))