Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/oab-instance-mcp/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CoreGraphics
import Foundation
import InstanceMCPCore

let version = "0.6.1"
let version = "0.6.2"

struct Options {
var host = "127.0.0.1"
Expand Down
4 changes: 2 additions & 2 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ lipo -create /tmp/imcp-arm64/release/oab-instance-mcp \
/tmp/imcp-x86_64/release/oab-instance-mcp \
-output /tmp/oab-instance-mcp
chmod +x /tmp/oab-instance-mcp
scripts/assemble-app.sh /tmp/oab-instance-mcp /tmp/oab-instance-mcp.app 0.6.1
ALLOW_UNSIGNED=1 scripts/package-pkg.sh /tmp/oab-instance-mcp.app /tmp/oab-instance-mcp.pkg 0.6.1
scripts/assemble-app.sh /tmp/oab-instance-mcp /tmp/oab-instance-mcp.app 0.6.2
ALLOW_UNSIGNED=1 scripts/package-pkg.sh /tmp/oab-instance-mcp.app /tmp/oab-instance-mcp.pkg 0.6.2
```

Unsigned artifacts are testing inputs only; do not install or publish them.
14 changes: 14 additions & 0 deletions scripts/pkg/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ UID_=$(/usr/bin/id -u "$CONSOLE_USER")
HOME_DIR=$(/usr/bin/dscl . -read "/Users/$CONSOLE_USER" NFSHomeDirectory | \
/usr/bin/sed 's/^NFSHomeDirectory: //')
[ -d "$HOME_DIR" ] || { echo "oab-instance-mcp: home not found for $CONSOLE_USER" >&2; exit 1; }
GID_=$(/usr/bin/id -g "$CONSOLE_USER")

# Repair only our own per-user paths before dropping root. v0.6.0's relocatable
# component was moved by PackageKit into ~/.local as root; the fixed installer
# then correctly ran as the desktop user but could not rename that root-owned app.
# This also makes a partially interrupted package retry idempotent. Do not chown
# a parent directory owned by the user, and never touch unrelated files.
for owned in \
"$HOME_DIR/.local/oab-instance-mcp" \
"$HOME_DIR/.config/oab-instance-mcp" \
"$HOME_DIR/Library/Logs/oab-instance-mcp" \
"$HOME_DIR/Library/LaunchAgents/dev.openab.instance-mcp.plist"; do
if [ -e "$owned" ]; then /usr/sbin/chown -R "$UID_:$GID_" "$owned"; fi
done

SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
SOURCE="/Library/Application Support/OpenAB/instance-mcp/oab-instance-mcp.app"
Expand Down
5 changes: 5 additions & 0 deletions scripts/test-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ EXPANDED="$TMP/expanded"
/usr/sbin/pkgutil --expand "$PKG" "$EXPANDED"
[ -x "$EXPANDED/Scripts/postinstall" ]
[ -x "$EXPANDED/Scripts/install-prebuilt.sh" ]
# v0.6.0 could leave a root-owned relocated app in ~/.local. A later package
# must repair only our paths before dropping root, or the user installer cannot
# atomically rename it.
grep -q '/usr/sbin/chown -R' "$EXPANDED/Scripts/postinstall"
grep -q '\.local/oab-instance-mcp' "$EXPANDED/Scripts/postinstall"
# A bundle listed under <relocate> is moved to any existing matching bundle on
# the target Mac; then postinstall's payload path vanishes (the first v0.6.0
# install failed exactly this way). The explicit component plist must remove it.
Expand Down
Loading