diff --git a/tools/verify_build.sh b/tools/verify_build.sh index 6c653679c63..6576bdd299d 100755 --- a/tools/verify_build.sh +++ b/tools/verify_build.sh @@ -24,7 +24,7 @@ fi # Versionstring aus version.inc lesen SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(dirname "$SCRIPT_DIR")" -VERSION=$(grep 'set(SoftFever_VERSION' "$REPO_ROOT/version.inc" | grep -oP '"\K[^"]+') +VERSION=$(grep 'set(SoftFever_VERSION' "$REPO_ROOT/version.inc" | head -1 | grep -oP 'SoftFever_VERSION\s+"\K[^"]+') if [[ -z "$VERSION" ]]; then echo "FEHLER: Konnte VERSION nicht aus version.inc lesen" @@ -49,14 +49,34 @@ CHECKS=( BINARY="" if [[ "$PLATFORM" == "linux" ]]; then - echo "Extrahiere AppImage..." - chmod +x "$ARTIFACT" - cd "$TMPDIR" - "$ARTIFACT" --appimage-extract bin/orca-slicer 2>/dev/null || \ - "$ARTIFACT" --appimage-extract 2>/dev/null - BINARY=$(find "$TMPDIR/squashfs-root" -name "orca-slicer" -type f | head -1) + # Bevorzugt die unkomprimierte Binary aus dem build/-Baum prüfen (kein FUSE, + # keine AppImage-Extraktion nötig). Fällt nur zurück auf --appimage-extract, + # wenn keine lose Binary gefunden wird. + # Echte ELF-Binary suchen, nicht die 4K-Shell-Wrapper im build/-Root. + BUILD_ROOT="$(dirname "$ARTIFACT")" + BINARY="" + while IFS= read -r cand; do + [[ -z "$cand" ]] && continue + if file -b "$cand" 2>/dev/null | grep -q "ELF"; then + BINARY="$cand" + break + fi + done < <(find "$BUILD_ROOT" -name "orca-slicer" -type f -not -path "*/squashfs-root/*" 2>/dev/null) + if [[ -z "$BINARY" ]]; then - echo "FEHLER: orca-slicer Binary nicht im AppImage gefunden" + echo "Keine lose Binary gefunden — extrahiere AppImage..." + chmod +x "$ARTIFACT" + cd "$TMPDIR" + if ! "$ARTIFACT" --appimage-extract bin/orca-slicer >/dev/null 2>&1; then + "$ARTIFACT" --appimage-extract >/dev/null 2>&1 || true + fi + BINARY=$(find "$TMPDIR/squashfs-root" -name "orca-slicer" -type f 2>/dev/null | head -1) + else + echo "Prüfe lose Binary aus build/: $BINARY" + fi + + if [[ -z "$BINARY" || ! -f "$BINARY" ]]; then + echo "FEHLER: orca-slicer Binary weder im build/-Baum noch im AppImage gefunden" exit 1 fi