aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 14:41:43 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 14:41:43 -0500
commit9aa6a32340cc3331fba385a791eebe36144dcb9d (patch)
tree264285c0984cd7ebe0b9758a489306a10386651c /docker
parentb54e479a3f9e973a083c643905f21c59fadd63bb (diff)
Fix launcher sync triggering on every fresh tarball extraction
Version fingerprint was stat -c '%i:%Y' which includes the inode number. Re-extracting the same tarball produces new inodes, so the marker never matched and the 237MB copy to ~/.local/share/fluorine/bin/ ran on every launch — painful cross-drive (tarball on one disk, home on another). Switch to '%s:%Y' (size + mtime). Survives re-extraction, still detects real updates. Also stage into bin.new/ and rename instead of rm -rf'ing bin/ before the tar pipe. If the user Ctrl+C's mid-sync (or the copy fails), the existing install stays intact instead of being left empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/build-inner.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/docker/build-inner.sh b/docker/build-inner.sh
index a5c8c0b..a53f79c 100755
--- a/docker/build-inner.sh
+++ b/docker/build-inner.sh
@@ -363,16 +363,23 @@ BIN_DST="${FLUORINE_DATA}/bin"
HERE_REAL="$(readlink -f "${HERE}")"
DST_REAL="$(readlink -f "${BIN_DST}" 2>/dev/null || echo "")"
if [ "${HERE_REAL}" != "${DST_REAL}" ]; then
- # Use the main binary's mtime as a version fingerprint.
- CURRENT_VER="$(stat -c '%i:%Y' "${HERE}/ModOrganizer-core" 2>/dev/null || echo "unknown")"
+ # Fingerprint from size+mtime (not inode) so re-extracting the same tarball
+ # onto a different filesystem doesn't trigger a spurious full resync.
+ CURRENT_VER="$(stat -c '%s:%Y' "${HERE}/ModOrganizer-core" 2>/dev/null || echo "unknown")"
MARKER="${BIN_DST}/.version"
if [ ! -f "${MARKER}" ] || [ "$(cat "${MARKER}" 2>/dev/null)" != "${CURRENT_VER}" ]; then
- echo "Syncing Fluorine to ${BIN_DST}..." >&2
+ echo "Syncing Fluorine to ${BIN_DST} (this may take a minute on first launch)..." >&2
+ # Stage into bin.new/ then rename. Protects the existing install if the
+ # user Ctrl+C's mid-sync or the copy fails partway.
+ STAGE="${BIN_DST}.new"
+ rm -rf "${STAGE}"
+ mkdir -p "${STAGE}"
+ (cd "${HERE}" && tar --exclude-vcs -cf - .) | (cd "${STAGE}" && tar -xf -)
rm -rf "${BIN_DST}"
- mkdir -p "${BIN_DST}"
- (cd "${HERE}" && tar --exclude-vcs -cf - .) | (cd "${BIN_DST}" && tar -xf -)
+ mv "${STAGE}" "${BIN_DST}"
echo "${CURRENT_VER}" > "${MARKER}"
+ echo "Sync complete." >&2
fi
fi