No LibreOffice in Open With: built bundle claims nothing, no image is mounted (R2.15)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 01:23:06 -04:00
1 parent 5a36ffc272
commit 466afe20a0
8 files changed
+80 -52

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Unpacks the official kernel's libraries, never mounting the image.
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
dmg=$root/engines/LibreOffice_26.2.6_MacOS_aarch64.dmg
out=$root/engines/lo-official
command -v 7zz >/dev/null || { echo "extract-official-lo.sh: needs 7zz (brew install sevenzip)" >&2; exit 1; }
[ -f "$dmg" ] || { echo "extract-official-lo.sh: no $dmg" >&2; exit 1; }
[ "$(stat -f %z "$dmg")" = 297798926 ] || { echo "extract-official-lo.sh: $dmg is not the pinned image" >&2; exit 1; }
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
7zz x -y -snld -o"$work" "$dmg" "LibreOffice/LibreOffice.app/Contents/Frameworks/*" "LibreOffice/LibreOffice.app/Contents/Resources/*" >/dev/null
rm -rf "$out"
mkdir -p "$out"
# A plain folder, not a bundle: nothing for macOS to register.
mv "$work/LibreOffice/LibreOffice.app/Contents" "$out/Contents"
echo "extract-official-lo.sh: $out/Contents/Frameworks"